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

Method Video_Sleep

Source/Fodder.cpp:544–574  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

542}
543
544void cFodder::Video_Sleep(cSurface* pSurface, const bool pShrink, const bool pVsync) {
545 mVideo_Ticked = false;
546 mVideo_Done = true;
547 if (!pSurface) {
548 pSurface = mSurface;
549 }
550
551 {
552 std::lock_guard<std::mutex> lock(mSurfaceMtx);
553
554 if (!mStartParams->mDisableVideo) {
555 if (!pShrink) {
556 Video_SurfaceRender(false, false, pSurface);
557 }
558 else {
559 Video_SurfaceRender(false, true, pSurface, false);
560 }
561 mSurface->Restore();
562 }
563 }
564
565 // If not in vsync mode, then wait for the Amiga 50Hz Interrupt
566 if (!pVsync) {
567 while (!mVideo_Ticked) {
568 SDL_Delay(1);
569 }
570 }
571
572 mWindow->Cycle();
573 eventsProcess();
574}
575
576/**
577 * Interrupt screen redraw

Callers 4

CycleMethod · 0.80
guiPrintStringMethod · 0.80
Mission_Intro_PlayMethod · 0.80
Mission_Intro_PlayMethod · 0.80

Calls 2

RestoreMethod · 0.80
CycleMethod · 0.45

Tested by

no test coverage detected