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

Function zSaveLoad_Tick

src/SB/Game/zSaveLoad.cpp:154–220  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

152}
153
154void zSaveLoad_Tick()
155{
156 time_current = (1.0f / (GET_BUS_FREQUENCY() / 4)) * (float)iTimeGet();
157
158 time_elapsed = time_current - time_last;
159 if (time_elapsed < 0.0f)
160 {
161 time_elapsed = 1.0f / 60.f;
162 }
163 else if (time_elapsed > 0.1f)
164 {
165 time_elapsed = 1.0f / 60.f;
166 }
167
168 dontPoll = dontPoll - time_elapsed;
169 t0 = t1;
170 time_last = time_current;
171 t1 = iTimeGet();
172 sTimeCurrent = iTimeGet();
173 sTimeElapsed = iTimeDiffSec(sTimeLast, sTimeCurrent);
174 sTimeLast = sTimeCurrent;
175 xPadUpdate(globals.currentActivePad, time_elapsed);
176 iTRCDisk::CheckDVDAndResetState();
177 xDrawBegin();
178 xParMgrUpdate(time_elapsed);
179 zSceneUpdate(time_elapsed);
180
181 xMat4x3 playerMat;
182 xMat4x3* ma = xEntGetFrame(&(xEnt)globals.player.ent);
183 // This feels like a normal assignment but that calls the assignment operator function.
184 *(U32*)&playerMat.right.x = *(U32*)&ma->right.x;
185 *(U32*)&playerMat.right.y = *(U32*)&ma->right.y;
186 *(U32*)&playerMat.right.z = *(U32*)&ma->right.z;
187 *(U32*)&playerMat.flags = *(U32*)&ma->flags;
188 *(U32*)&playerMat.up.x = *(U32*)&ma->up.x;
189 *(U32*)&playerMat.up.y = *(U32*)&ma->up.y;
190 *(U32*)&playerMat.up.z = *(U32*)&ma->up.z;
191 *(U32*)&playerMat.pad1 = *(U32*)&ma->pad1;
192 *(U32*)&playerMat.at.x = *(U32*)&ma->at.x;
193 *(U32*)&playerMat.at.y = *(U32*)&ma->at.y;
194 *(U32*)&playerMat.at.z = *(U32*)&ma->at.z;
195 *(U32*)&playerMat.pad2 = *(U32*)&ma->pad2;
196 *(U32*)&playerMat.pos.x = *(U32*)&ma->pos.x;
197 *(U32*)&playerMat.pos.z = *(U32*)&ma->pos.z;
198 *(U32*)&playerMat.pad3 = *(U32*)&ma->pad3;
199 *(U32*)&playerMat.pos.y = *(U32*)&ma->pos.y;
200 playerMat.pos.y += 0.6f;
201
202 xSndSetListenerData(SND_LISTENER_CAMERA, &globals.camera.mat);
203 xSndSetListenerData(SND_LISTENER_PLAYER, &playerMat);
204 xSndUpdate();
205 if (gGameMode == 6 && gGameState != 0)
206 {
207 zhud::update(sTimeElapsed);
208 }
209
210 zCameraUpdate(&globals.camera, time_elapsed);
211 xCameraBegin(&globals.camera, 1);

Calls 15

iTimeDiffSecFunction · 0.85
xDrawBeginFunction · 0.85
xParMgrUpdateFunction · 0.85
xEntGetFrameFunction · 0.85
xSndSetListenerDataFunction · 0.85
xSndUpdateFunction · 0.85
xCameraBeginFunction · 0.85
zSceneRenderFunction · 0.85
xDebugUpdateFunction · 0.85
xDrawEndFunction · 0.85
xCameraEndFunction · 0.85
iEnvEndRenderFXFunction · 0.85

Tested by

no test coverage detected