- cleanup

This commit is contained in:
Christoph Oelckers 2020-07-03 20:17:24 +02:00
parent 1e24c4a22c
commit a3a8286857
4 changed files with 14 additions and 14 deletions

View file

@ -565,13 +565,14 @@ void drawoverheadmap(int cposx, int cposy, int czoom, int cang)
// calculate size of 3D viewport.
// Fixme: this needs to be adjusted to the new status bar code,
// once the status bar is a persistent queriable object
// (it should also be moved out of the game code then.
//
//---------------------------------------------------------------------------
void updateviewport(void)
{
ud.screen_size = clamp(ud.screen_size, 0, 64);
const int32_t ss = std::max(ud.screen_size - 8, 0);
int ss = std::max(ud.screen_size - 8, 0);
int x1 = scale(ss, xdim, 160);
int x2 = xdim - x1;

View file

@ -34,7 +34,7 @@ int G_FindLevelByFile(const char *fileName);
void G_CacheMapData(void);
void G_NewGame(int volumeNum, int levelNum, int skillNum);
void G_ResetTimers(uint8_t keepgtics);
void G_UpdateScreenArea(void);
void updateviewport(void);
void pickrandomspot(int playerNum);
void resetinventory(int playerNum);
void P_ResetPlayer(int playerNum);
@ -43,7 +43,6 @@ void resetweapons(int playerNum);
void resetprestat(int snum, int g);
void G_ClearFIFO(void);
void G_ResetInterpolations(void);
extern int32_t fragbarheight(void);
void setmapfog(int fogtype);
void G_InitRRRASkies(void);
void prelevel_common(int g);

View file

@ -1219,14 +1219,14 @@ void GameInterface::set_hud_layout(int layout)
ud.screen_size = RR? screen_size_vals_rr[layout] : screen_size_vals[layout];
ud.statusbarmode = layout >= 8;
ud.althud = layout >= 10;
G_UpdateScreenArea();
updateviewport();
}
}
void GameInterface::set_hud_scale(int scale)
{
ud.statusbarscale = clamp(scale, 36, 100);
G_UpdateScreenArea();
updateviewport();
}
void G_HandleLocalKeys(void)
@ -1257,7 +1257,7 @@ void G_HandleLocalKeys(void)
hud_scale = hud_scale + 4;
}
G_UpdateScreenArea();
updateviewport();
}
if (buttonMap.ButtonDown(gamefunc_Shrink_Screen))
@ -1276,7 +1276,7 @@ void G_HandleLocalKeys(void)
hud_scale = hud_scale - 4;
}
G_UpdateScreenArea();
updateviewport();
}
}
@ -1394,7 +1394,7 @@ void G_HandleLocalKeys(void)
ud.last_overhead = ud.overhead_on;
ud.overhead_on = 0;
ud.scrollmode = 0;
G_UpdateScreenArea();
updateviewport();
}
#endif
@ -1414,7 +1414,7 @@ void G_HandleLocalKeys(void)
}
restorepalette = 1;
G_UpdateScreenArea();
updateviewport();
}
}
@ -1631,7 +1631,7 @@ static int G_EndOfLevel(void)
{
int32_t i = ud.screen_size;
ud.screen_size = 0;
G_UpdateScreenArea();
updateviewport();
ud.screen_size = i;
G_BonusScreen(0);
@ -1968,7 +1968,7 @@ MAIN_LOOP_RESTART:
goto MAIN_LOOP_RESTART;
}
}
else G_UpdateScreenArea();
else updateviewport();
// G_GameExit(" "); ///
@ -2217,7 +2217,7 @@ void GameInterface::FreeGameData()
void GameInterface::UpdateScreenSize()
{
G_UpdateScreenArea();
updateviewport();
}
::GameInterface* CreateInterface()

View file

@ -384,8 +384,8 @@ int G_EnterLevel(int gameMode)
/*
G_DoLoadScreen(msg, -1);
G_UpdateScreenArea();
*/
updateviewport();
int res = LoadTheMap(mi, pPlayer, gameMode);
if (res != 0) return res;
@ -482,7 +482,7 @@ int G_EnterLevel(int gameMode)
restorepalette = -1;
G_UpdateScreenArea();
updateviewport();
videoClearViewableArea(0L);
drawbackground();
G_DrawRooms(myconnectindex,65536);