Commit 3927367b authored by Richard Gobeille's avatar Richard Gobeille
Browse files

engine: add parameter to videoSet2dMode() to control fullscreen, like videoSetGameMode() uses

This allows fullscreen to be toggled in the editor without having to change to 3d mode first.
parent d11731fa
......@@ -1519,7 +1519,7 @@ int32_t wallvisible(int32_t const x, int32_t const y, int16_t const wallnum);
//void qsetmode640350(void);
//void qsetmode640480(void);
void videoSet2dMode(int32_t daupscaledxdim, int32_t daupscaledydim, int32_t daupscalefactor = 1);
void videoSet2dMode(char davidoption, int32_t daupscaledxdim, int32_t daupscaledydim, int32_t daupscalefactor = 1);
void clear2dscreen(void);
void editorDraw2dGrid(int32_t posxe, int32_t posye, int32_t posze, int16_t cursectnum,
int16_t ange, int32_t zoome, int16_t gride);
......
......@@ -303,7 +303,7 @@ static int osdcmd_vidmode(osdcmdptr_t parm)
if (!in3dmode())
{
videoSet2dMode(newx, newy, upscalefactor);
videoSet2dMode(newfullscreen, newx, newy, upscalefactor);
videoBeginDrawing(); //{{{
CLEARLINES2D(0, ydim16, 0);
......@@ -3809,7 +3809,7 @@ void overheadeditor(void)
ovh.splitsect = -1;
ovh.splitstartwall = -1;
videoSet2dMode(xres, yres, upscalefactor);
videoSet2dMode(fullscreen, xres, yres, upscalefactor);
osearchx = searchx;
osearchy = searchy;
......
......@@ -13986,7 +13986,7 @@ void setfirstwall(int16_t sectnum, int16_t newfirstwall)
//
// qsetmodeany
//
void videoSet2dMode(int32_t daupscaledxdim, int32_t daupscaledydim, int32_t daupscalefactor)
void videoSet2dMode(char davidoption, int32_t daupscaledxdim, int32_t daupscaledydim, int32_t daupscalefactor)
{
daupscaledxdim = max(640, min(daupscaledxdim, max(640, daupscaledxdim/daupscalefactor) * daupscalefactor));
daupscaledydim = max(480, min(daupscaledydim, max(480, daupscaledydim/daupscalefactor) * daupscalefactor));
......@@ -13997,7 +13997,7 @@ void videoSet2dMode(int32_t daupscaledxdim, int32_t daupscaledydim, int32_t daup
#endif
g_lastpalettesum = 0;
if (videoSetMode(daupscaledxdim,daupscaledydim,8,fullscreen) < 0) return;
if (videoSetMode(daupscaledxdim,daupscaledydim,8,davidoption) < 0) return;
upscalefactor = daupscalefactor;
......
......@@ -2825,9 +2825,9 @@ int32_t handleevents(void)
if (!frameplace && sdl_resize.x)
{
if (in3dmode())
videoSetGameMode(fullscreen, sdl_resize.x & ~1, sdl_resize.y & ~1, bpp, upscalefactor);
videoSetGameMode(fullscreen, sdl_resize.x, sdl_resize.y, bpp, upscalefactor);
else
videoSet2dMode(sdl_resize.x & ~1, sdl_resize.y & ~1, upscalefactor);
videoSet2dMode(fullscreen, sdl_resize.x, sdl_resize.y, upscalefactor);
sdl_resize = {};
}
......
......@@ -8616,7 +8616,7 @@ static int osdcmd_upscalefactor(osdcmdptr_t parm)
if (!in3dmode())
{
videoSet2dMode(xres, yres, upscalefactor);
videoSet2dMode(fullscreen, xres, yres, upscalefactor);
return OSDCMD_OK;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment