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

Function zNPCGlyph_Timestep

src/SB/Game/zNPCGlyph.cpp:125–165  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

123}
124
125void zNPCGlyph_Timestep(F32 dt)
126{
127 NPCGlyph* glist = NULL;
128 S32* counts = &g_cnt_activeGlyphs[NPC_GLYPH_SHINYONE];
129 S32 i;
130
131 for (en_npcglyph gtyp = NPC_GLYPH_SHINYONE; gtyp < NPC_GLYPH_NOMORE;
132 gtyp = (en_npcglyph)(gtyp + 1), counts++)
133 {
134 S32 cnt = zNPCGlyph_TypeToList(gtyp, &glist);
135 if (glist == NULL || cnt < 1 || *counts < 1)
136 {
137 continue;
138 }
139 for (i = 0; i < cnt; i++)
140 {
141 NPCGlyph* glyph = &glist[i];
142 if (!(glyph->flg_glyph & (1 << 0)))
143 {
144 continue;
145 }
146
147 if (glyph->flg_glyph & (1 << 4) && glyph->tmr_glyph < 0.0f)
148 {
149 glyph->Discard();
150 continue;
151 }
152
153 glyph->tmr_glyph = MAX(-1.0f, glyph->tmr_glyph - dt);
154
155 if (glyph->mdl_glyph != NULL && glyph->flg_glyph & (1 << 5))
156 {
157 glyph->RotAddDelta(NULL);
158 }
159 if (glyph->flg_glyph & ((1 << 3) | (1 << 2)))
160 {
161 glyph->Timestep(dt);
162 }
163 }
164 }
165}
166
167S32 zNPCGlyph_TypeToList(en_npcglyph gtyp, NPCGlyph** glist)
168{

Callers 1

NPCSupport_TimestepFunction · 0.70

Calls 4

RotAddDeltaMethod · 0.80
zNPCGlyph_TypeToListFunction · 0.70
DiscardMethod · 0.45
TimestepMethod · 0.45

Tested by

no test coverage detected