diff --git a/source/build/src/engine.cpp b/source/build/src/engine.cpp index 3b32bbaba..b83e89867 100644 --- a/source/build/src/engine.cpp +++ b/source/build/src/engine.cpp @@ -178,7 +178,6 @@ int32_t cosviewingrangeglobalang, sinviewingrangeglobalang; int32_t xyaspect; int32_t viewingrangerecip; -static char globalxshift, globalyshift; static int32_t globalxpanning, globalypanning; int32_t globalshade, globalorientation; int16_t globalpicnum; @@ -301,19 +300,6 @@ int32_t animateoffs(int const tilenum, int fakevar) return offs; } - -// globalpicnum --> globalxshift, globalyshift -static void calc_globalshifts(void) -{ - globalxshift = (8-widthBits(globalpicnum)); - globalyshift = (8-heightBits(globalpicnum)); - if (globalorientation&8) { globalxshift++; globalyshift++; } - // PK: the following can happen for large (>= 512) tile sizes. - // NOTE that global[xy]shift are unsigned chars. - if (globalxshift > 31) globalxshift=0; - if (globalyshift > 31) globalyshift=0; -} - static void renderDrawSprite(int32_t snum) { polymost_drawsprite(snum); @@ -1705,7 +1691,12 @@ void renderDrawMapView(int32_t dax, int32_t day, int32_t zoome, int16_t ang) globaly2 = mulscale12(globaly2,i); } - calc_globalshifts(); + int globalxshift = (8 - widthBits(globalpicnum)); + int globalyshift = (8 - heightBits(globalpicnum)); + if (globalorientation & 8) { globalxshift++; globalyshift++; } + // PK: the following can happen for large (>= 512) tile sizes. + if (globalxshift < 0) globalxshift = 0; + if (globalyshift < 0) globalyshift = 0; if ((globalorientation&0x4) > 0) { diff --git a/source/sw/src/game.cpp b/source/sw/src/game.cpp index ea327304b..cfb523677 100644 --- a/source/sw/src/game.cpp +++ b/source/sw/src/game.cpp @@ -599,12 +599,12 @@ void GameInterface::LevelCompleted(MapRecord *map, int skill) COVER_SetReverb(0); // Reset reverb Player[myconnectindex].Reverb = 0; StopSound(); + STAT_Update(map == nullptr); StatScreen(FinishAnim, [=](bool) { - if (map == nullptr) + if (map == nullptr) { - STAT_Update(true); FinishAnim = false; PlaySong(nullptr, ThemeSongs[0], ThemeTrack[0]); if (SW_SHAREWARE)