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

Method update

src/SB/Game/zHud.cpp:183–277  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

181 }
182
183 void zhud::update(F32 dt)
184 {
185 S32 i = 0;
186
187 if (globals.cmgr != NULL && globals.cmgr->csn->Ready != 0)
188 {
189 zhud::hide();
190 }
191
192 if (gGameMode == eGameMode_Stall)
193 {
194 zhud::hide();
195 }
196
197 if (!globals.player.ControlOff && globals.pad0->pressed & 0x100000 && !zGameIsPaused() &&
198 globals.sceneCur->sceneID != 'PG12')
199 {
200 zhud::show();
201 }
202
203 if (!last_paused && zGameIsPaused())
204 {
205 on_pause();
206 last_paused = true;
207 }
208 else if (last_paused && !zGameIsPaused())
209 {
210 on_unpause();
211 last_paused = false;
212 }
213
214 for (i = 0; i < 5; i++)
215 {
216 U32 updated_value = 1;
217 if (value[i] == old_value[i])
218 {
219 updated_value = 0;
220 }
221
222 U32 another_updated_value = 0;
223 if (updated_value & 0xFF || (max_value[i] != 0 && old_max_value[i] != max_value[i]))
224 {
225 another_updated_value = 1;
226 }
227
228 if (another_updated_value & 0xFF)
229 {
230 S32 meter_idx = meter_widget_index[i];
231 if (widgets[meter_idx] != NULL)
232 {
233 xhud::meter_widget* meter = (xhud::meter_widget*)get_meter_widget(meter_idx);
234 if (max_value[i] != 0)
235 {
236 old_max_value[i] = max_value[i];
237 meter->max_value = (F32)max_value[i];
238 }
239
240 old_value[i] = value[i];

Callers 14

__init__Method · 0.45
add_unitFunction · 0.45
update_cameraMethod · 0.45
UpdateSandyBossCamFunction · 0.45
ProcessMethod · 0.45
zParPTankUpdateFunction · 0.45
zSceneUpdateFunction · 0.45
zShrapnel_UpdateFunction · 0.45
UpdatePatrickBossCamFunction · 0.45
UpdateMethod · 0.45

Calls 12

zGameIsPausedFunction · 0.85
on_pauseFunction · 0.85
on_unpauseFunction · 0.85
get_meter_widgetFunction · 0.85
ping_widgetFunction · 0.85
get_model_widgetFunction · 0.85
delay_hide_widgetFunction · 0.85
set_valueMethod · 0.80
changingMethod · 0.80
hideFunction · 0.50
showFunction · 0.50
updateFunction · 0.50

Tested by

no test coverage detected