mirror of
https://github.com/vlang/v.git
synced 2025-09-13 14:32:26 +03:00
all: unwrap const() blocks
This commit is contained in:
parent
399af6768d
commit
f09826e928
436 changed files with 10448 additions and 11207 deletions
|
@ -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:
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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{
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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{
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue