migrate to the new for-loop syntax
Drop the ':' before captures (for xs (x) / for 0..n (i)); the index capture becomes the trailing open range (for xs, 0.. (x, i)). 136 headers across 26 files, mechanical. Five headless tests (banner_layout, hit_test, swipe_commit, swipe_intent, swipe_reshuffle) also gain a direct #import "modules/ui/types.sx" — they named Point/Frame through a transitive import, which bare visibility no longer permits. Gates: sx build --target ios-sim main.sx links; tools/run_tests.sh 23/23.
This commit is contained in:
10
board_fx.sx
10
board_fx.sx
@@ -123,7 +123,7 @@ BoardFxAssets :: struct {
|
||||
loaded: bool;
|
||||
|
||||
init :: (self: *BoardFxAssets) {
|
||||
for 0..GEM_COUNT: (t) { self.tex[t] = 0; }
|
||||
for 0..GEM_COUNT (t) { self.tex[t] = 0; }
|
||||
self.loaded = false;
|
||||
}
|
||||
|
||||
@@ -144,7 +144,7 @@ BoardFxAssets :: struct {
|
||||
// (sx codegen), so the per-pixel tint loop only ASSIGNS pre-declared vars.
|
||||
i : s64 = 0;
|
||||
o : s64 = 0;
|
||||
for 0..GEM_COUNT: (t) {
|
||||
for 0..GEM_COUNT (t) {
|
||||
col := fx_tint(t);
|
||||
i = 0;
|
||||
while i < n {
|
||||
@@ -219,7 +219,7 @@ BoardFx :: struct {
|
||||
// Whole-move depth boost: a deeper cascade makes every burst bigger from
|
||||
// its first round, escalating in lockstep with the cascade SFX cue.
|
||||
depth_boost := FX_BURST_DEPTH * cast(f32) fx_combo_level(mv.rounds.len);
|
||||
for 0..mv.rounds.len: (k) {
|
||||
for 0..mv.rounds.len (k) {
|
||||
rd := @mv.rounds.items[k];
|
||||
t0 := SWAP_ANIM_DUR + cast(f32) k * (CLEAR_ANIM_DUR + FALL_ANIM_DUR);
|
||||
extra := depth_boost + FX_BURST_COMBO * cast(f32) min(k, 2);
|
||||
@@ -227,7 +227,7 @@ BoardFx :: struct {
|
||||
// bursts ripple in lockstep with the staggered pops (P18.2) instead of
|
||||
// one simultaneous flash. The round's audio cue still fires once at t0.
|
||||
span := clear_diag_span(@rd.matched);
|
||||
for 0..BOARD_CELLS: (idx) {
|
||||
for 0..BOARD_CELLS (idx) {
|
||||
if rd.matched.cells[idx] {
|
||||
g := rd.before[idx];
|
||||
if g != .empty {
|
||||
@@ -253,7 +253,7 @@ BoardFx :: struct {
|
||||
sc : s64 = 0;
|
||||
sr : s64 = 0;
|
||||
cnt : s64 = 0;
|
||||
for 0..BOARD_CELLS: (idx) {
|
||||
for 0..BOARD_CELLS (idx) {
|
||||
if rd0.matched.cells[idx] {
|
||||
sc += idx % BOARD_COLS;
|
||||
sr += idx / BOARD_COLS;
|
||||
|
||||
Reference in New Issue
Block a user