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

Method ShowImage_ForDuration

Source/Fodder.cpp:16845–16884  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16843}
16844
16845int16 cFodder::ShowImage_ForDuration(const std::string& pFilename, uint16 pDuration, size_t pBackColor, bool pCanAbort) {
16846 bool DoBreak = false;
16847
16848 mGraphics->Load_And_Draw_Image(pFilename, 0x100, pBackColor);
16849 mGraphics->PaletteSet();
16850 mSurface->Save();
16851
16852 while (mSurface->isPaletteAdjusting() || DoBreak == false) {
16853 --pDuration;
16854
16855 if (pDuration) {
16856 if (mSurface->isPaletteAdjusting()) {
16857 mSurface->palette_FadeTowardNew();
16858 if (!DoBreak) {
16859 Video_Sleep();
16860 Video_Sleep();
16861 Video_Sleep();
16862 continue;
16863 }
16864 }
16865
16866 if (pCanAbort && (mMouseButtonStatus || mPhase_Aborted)) {
16867 mPhase_Aborted = false;
16868 mImage_Aborted = -1;
16869 mSurface->paletteNew_SetToBlack();
16870 DoBreak = true;
16871 }
16872 }
16873 else {
16874 if (DoBreak == false) {
16875 mSurface->paletteNew_SetToBlack();
16876 DoBreak = true;
16877 }
16878 }
16879
16880 Video_Sleep();
16881 }
16882
16883 return mImage_Aborted;
16884}
16885
16886void cFodder::Video_SurfaceRender(const bool pRestoreSurface, const bool pShrink, cSurface* pSurface, const bool pSkip) {
16887

Callers

nothing calls this directly

Calls 6

SaveMethod · 0.80
isPaletteAdjustingMethod · 0.80
palette_FadeTowardNewMethod · 0.80
paletteNew_SetToBlackMethod · 0.80
Load_And_Draw_ImageMethod · 0.45
PaletteSetMethod · 0.45

Tested by

no test coverage detected