MCPcopy Create free account
hub / github.com/OpenFodder/openfodder / Phase_Cycle

Method Phase_Cycle

Source/Fodder.cpp:268–394  ·  view source on GitHub ↗

* Execute one cycle of the current phase * * -1 = Phase Try Again * 0 = Phase Won * 1 = Phase Running */

Source from the content-addressed store, hash-verified

266 * 1 = Phase Running
267 */
268int16 cFodder::Phase_Cycle() {
269
270 // If demo playback is enabled, and a record resume cycle is set
271 if (mStartParams->mDemoPlayback && mStartParams->mDemoRecordResumeCycle) {
272 // See if we hit the tick count
273 if (mGame_Data.mDemoRecorded.mTick >= mStartParams->mDemoRecordResumeCycle) {
274 // Then resume recording
275 mStartParams->mDemoPlayback = false;
276 mStartParams->mDemoRecord = true;
277 mStartParams->mDemoRecordResumeCycle = 0;
278 mParams->mSleepDelta = 0;
279 mParams->mDemoRecord = mStartParams->mDemoRecord;
280 mParams->mDemoPlayback = mStartParams->mDemoPlayback;
281 mStartParams->mDisableVideo = false;
282 mStartParams->mDisableSound = false;
283 Mouse_Setup();
284 }
285 }
286
287 if (mStartParams->mDemoPlayback) {
288
289 if (!mGame_Data.mDemoRecorded.GetVideoTick(mGame_Data.mDemoRecorded.mTick)) {
290 return 1;
291 }
292
293 } else {
294
295 do {
296 Video_Sleep();
297
298 if (mPhase_Paused) {
299 Phase_Paused();
300 continue;
301 }
302
303 if (mExit) {
304 return -1;
305 }
306 } while (mPhase_InterruptTicks < 3);
307 }
308
309 ++mMission_EngineTicks;
310 mPhase_InterruptTicks = 0;
311
312 if (mStartParams->mDemoRecord && !mStartParams->mDemoRecordResumeCycle) {
313 mGame_Data.mDemoRecorded.AddVideoTick(mGame_Data.mDemoRecorded.mTick);
314 }
315
316 if (mCamera_Start_Adjust) {
317 Camera_SetTargetToStartPosition();
318 mCamera_Start_Adjust = false;
319 return 1;
320 }
321
322 //loc_1074E
323 if (mGUI_Sidebar_Setup >= 0 && !mPhase_TryAgain)
324 GUI_Sidebar_Setup();
325 else {

Callers 1

phase_loopFunction · 0.80

Calls 4

GetVideoTickMethod · 0.80
AddVideoTickMethod · 0.80
isPaletteAdjustingMethod · 0.80
palette_FadeTowardNewMethod · 0.80

Tested by

no test coverage detected