MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / hack_flag_shadows

Function hack_flag_shadows

src/SB/Game/zGrid.cpp:16–72  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

14static S32 zGridInitted;
15
16static void hack_flag_shadows(zScene* s)
17{
18 static U32 special_models[25] = {
19 xStrHash("bb_arrow"),
20 xStrHash("metal_sheets"),
21 xStrHash("clam_poop"),
22 xStrHash("beach_chair_yellow"),
23 xStrHash("debris_pile_rb_smll"),
24 xStrHash("debris_pile_rb"),
25 xStrHash("floor_panel"),
26 xStrHash("gy_woodpieceA"),
27 xStrHash("quarter_note_on"),
28 xStrHash("eighth_note_on"),
29 xStrHash("db03_path_a"),
30 xStrHash("db03_path_b"),
31 xStrHash("db03_path_c"),
32 xStrHash("db03_path_d"),
33 xStrHash("db03_path_e"),
34 xStrHash("db03_path_f"),
35 xStrHash("db03_path_g"),
36 xStrHash("db03_path_h"),
37 xStrHash("db03_path_i"),
38 xStrHash("db03_path_j"),
39 xStrHash("db03_path_k"),
40 xStrHash("db03_path_l"),
41 xStrHash("db03_path_m"),
42 xStrHash("db03_path_o"),
43 xStrHash("db03_path_p"),
44 }; // non-matching: stb happens too early?
45
46 zEnt** it = s->ents;
47 zEnt** end = s->ents + s->num_ents;
48
49 while (it != end)
50 {
51 // non-matching: extra `mr` instruction?
52 xEnt* ent = *it;
53 if (ent && (ent->baseFlags & 0x20) && ent->asset)
54 {
55 U32* id = special_models;
56 U32* end_special_models = id + 25;
57
58 while (id != end_special_models)
59 {
60 if (ent->asset->modelInfoID == *id)
61 {
62 ent->chkby |= 0x80;
63 ent->baseFlags |= 0x10;
64 ent->asset->baseFlags |= 0x10;
65 break;
66 }
67 id++;
68 }
69 }
70 it++;
71 }
72}
73

Callers 1

zGridResetFunction · 0.70

Calls 1

xStrHashFunction · 0.50

Tested by

no test coverage detected