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

Method Service_Promotion_Loop

Source/Fodder.cpp:9872–9923  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9870}
9871
9872void cFodder::Service_Promotion_Loop() {
9873 Mouse_Setup();
9874 mService_Promotion_Exit_Loop = 0;
9875
9876 if (Service_Promotion_Prepare_Draw() < 0)
9877 goto loc_18001;
9878
9879 mSurface->clearBuffer();
9880 if (mVersionCurrent->isPC()) {
9881 GUI_Draw_Frame_8(6, 0, 0x34, 0);
9882 GUI_Draw_Frame_16(8, 0, 0, 0x31);
9883 GUI_Draw_Frame_16(8, 0, 0xF0, 0x31);
9884 }
9885 else {
9886 GetGraphics<cGraphics_Amiga>()->Service_Draw(9, 0x30, 0); // Heroes in Victory
9887 GetGraphics<cGraphics_Amiga>()->Service_Draw(3, 0, 0x40); // Left Symbol
9888 GetGraphics<cGraphics_Amiga>()->Service_Draw(7, 0xF0, 0x40); // Right Symbol
9889 }
9890
9891 mService_ExitLoop = 0;
9892 mMouse_Exit_Loop = false;
9893 mGraphics->PaletteSet();
9894 mSurface->Save();
9895
9896 mInterruptCallback = [this]() {
9897 Service_Draw_List();
9898 if (mInterruptTick % 2 == 0)
9899 Service_ScrollUp_DrawList();
9900 Service_Promotion_Check();
9901 };
9902 do {
9903 Video_Sleep();
9904 Video_Sleep();
9905 if (mService_Promotion_Exit_Loop == -1 || mMouse_Exit_Loop) {
9906 mMouse_Exit_Loop = false;
9907 mSurface->paletteNew_SetToBlack();
9908 mService_ExitLoop = 1;
9909 }
9910
9911 if (mSurface->isPaletteAdjusting())
9912 mSurface->palette_FadeTowardNew();
9913
9914 } while (mSurface->isPaletteAdjusting() || mService_ExitLoop == 0);
9915
9916 mInterruptCallback = nullptr;
9917
9918loc_18001:;
9919
9920 for (auto& Troop : mGame_Data.mSoldiers_Allocated) {
9921 Troop.Promote();
9922 }
9923}
9924
9925int16 cFodder::Service_KIA_Troop_Prepare() {
9926 mService_Draw_List.clear();

Callers

nothing calls this directly

Calls 9

clearBufferMethod · 0.80
isPCMethod · 0.80
Service_DrawMethod · 0.80
SaveMethod · 0.80
paletteNew_SetToBlackMethod · 0.80
isPaletteAdjustingMethod · 0.80
palette_FadeTowardNewMethod · 0.80
PromoteMethod · 0.80
PaletteSetMethod · 0.45

Tested by

no test coverage detected