all: unwrap const() blocks

This commit is contained in:
Alexander Medvednikov 2023-11-25 10:02:51 +03:00
parent 399af6768d
commit f09826e928
436 changed files with 10448 additions and 11207 deletions

View file

@ -17,11 +17,9 @@ import sokol.sapp
import sokol.gfx
import sokol.sgl
const (
win_width = 800
win_height = 800
bg_color = gx.white
)
const win_width = 800
const win_height = 800
const bg_color = gx.white
struct App {
mut:

View file

@ -28,11 +28,9 @@ import gg.m4
fn C.cube_shader_desc(gfx.Backend) &gfx.ShaderDesc
const (
win_width = 800
win_height = 800
bg_color = gx.white
)
const win_width = 800
const win_height = 800
const bg_color = gx.white
struct App {
mut:

View file

@ -29,11 +29,9 @@ import time
fn C.rt_shader_desc(gfx.Backend) &gfx.ShaderDesc
const (
win_width = 800
win_height = 800
bg_color = gx.white
)
const win_width = 800
const win_height = 800
const bg_color = gx.white
struct App {
mut:

View file

@ -30,11 +30,9 @@ import time
fn C.rt_march_shader_desc(gfx.Backend) &gfx.ShaderDesc
fn C.rt_puppy_shader_desc(gfx.Backend) &gfx.ShaderDesc
const (
win_width = 800
win_height = 800
bg_color = gx.white
)
const win_width = 800
const win_height = 800
const bg_color = gx.white
struct App {
mut:

View file

@ -21,12 +21,10 @@ import sokol.gfx
// import sokol.sgl
import time
const (
win_width = 800
win_height = 800
bg_color = gx.white
num_inst = 16384
)
const win_width = 800
const win_height = 800
const bg_color = gx.white
const num_inst = 16384
struct App {
mut:

View file

@ -37,11 +37,9 @@ import obj
fn C.gouraud_shader_desc(gfx.Backend) &gfx.ShaderDesc
const (
win_width = 600
win_height = 600
bg_color = gx.white
)
const win_width = 600
const win_height = 600
const bg_color = gx.white
struct App {
mut:

View file

@ -7,9 +7,7 @@ struct AppState {
pass_action gfx.PassAction
}
const (
used_import = sokol.used_import
)
const used_import = sokol.used_import
fn main() {
state := &AppState{

View file

@ -6,8 +6,7 @@ import fontstash
import sokol.sfons
import os
const (
text = '
const text = '
Once upon a midnight dreary, while I pondered, weak and weary,
Over many a quaint and curious volume of forgotten lore
While I nodded, nearly napping, suddenly there came a tapping,
@ -50,8 +49,8 @@ Soon again I heard a tapping somewhat louder than before.
Let my heart be still a moment and this mystery explore;
Tis the wind and nothing more!
'
lines = text.split('\n')
)
const lines = text.split('\n')
struct AppState {
mut:
@ -114,9 +113,7 @@ fn frame(mut state AppState) {
gfx.commit()
}
const (
black = sfons.rgba(0, 0, 0, 255)
)
const black = sfons.rgba(0, 0, 0, 255)
fn (mut state AppState) render_font() {
lh := 30

View file

@ -5,10 +5,8 @@ module particle
import math.vec
import sokol.sgl
const (
default_life_time = 1000
default_v_color = Color{93, 136, 193, 255}
)
const default_life_time = 1000
const default_v_color = Color{93, 136, 193, 255}
// * Module public
pub fn new(location vec.Vec2[f64]) &Particle {

View file

@ -9,9 +9,7 @@ import sokol.gfx
import sokol.sgl
import particle
const (
used_import = sokol.used_import
)
const used_import = sokol.used_import
fn main() {
mut app := &App{

View file

@ -2,10 +2,8 @@ import time
import math
import sokol.audio
const (
sw = time.new_stopwatch()
sw_start_ms = sw.elapsed().milliseconds()
)
const sw = time.new_stopwatch()
const sw_start_ms = sw.elapsed().milliseconds()
@[inline]
fn sintone(periods int, frame int, num_frames int) f32 {