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

Method Phase_Loop

Source/Fodder.cpp:509–542  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

507}
508
509int16 cFodder::Phase_Loop() {
510 int16 result = 1;
511
512 // -1 = Phase Try Again
513 // 0 = Phase Won
514 // 1 = Phase Running
515 for (result = 1; result == 1; result = Phase_Cycle()) {
516
517 // Demo playback mode
518 if (mStartParams->mDemoPlayback) {
519 if (mPhase_Aborted)
520 return -1;
521
522 {
523 std::lock_guard<std::mutex> lock(mSurfaceMtx);
524 mVideo_Ticked = false;
525 mVideo_Done = true;
526
527 //mStartParams->mDisableVideo = false;
528 Video_SurfaceRender(false, false);
529 mSurface->Restore();
530
531 mWindow->Cycle();
532 eventsProcess();
533 }
534
535 while (!mVideo_Ticked && !mExit) {
536 SDL_Delay(0);
537 }
538 }
539 }
540
541 return result;
542}
543
544void cFodder::Video_Sleep(cSurface* pSurface, const bool pShrink, const bool pVsync) {
545 mVideo_Ticked = false;

Callers

nothing calls this directly

Calls 2

RestoreMethod · 0.80
CycleMethod · 0.45

Tested by

no test coverage detected