mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-22 20:21:26 +00:00
Fix video mode selection bug
This commit is contained in:
parent
cb17e109f1
commit
48f491cfd1
3 changed files with 20 additions and 12 deletions
|
@ -95,7 +95,7 @@ CUSTOM_CVAR (Int, menu_screenratios, -1, CVAR_ARCHIVE)
|
|||
}
|
||||
else
|
||||
{
|
||||
BuildModesList (SCREENWIDTH, SCREENHEIGHT, DisplayBits);
|
||||
BuildModesList (screen->VideoWidth, screen->VideoHeight, DisplayBits);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -139,7 +139,7 @@ public:
|
|||
|
||||
DVideoModeMenu()
|
||||
{
|
||||
SetModesMenu (SCREENWIDTH, SCREENHEIGHT, DisplayBits);
|
||||
SetModesMenu (screen->VideoWidth, screen->VideoHeight, DisplayBits);
|
||||
}
|
||||
|
||||
bool MenuEvent(int mkey, bool fromcontroller)
|
||||
|
@ -163,13 +163,13 @@ public:
|
|||
{
|
||||
if (!GetSelectedSize (&NewWidth, &NewHeight))
|
||||
{
|
||||
NewWidth = SCREENWIDTH;
|
||||
NewHeight = SCREENHEIGHT;
|
||||
NewWidth = screen->VideoWidth;
|
||||
NewHeight = screen->VideoHeight;
|
||||
}
|
||||
else
|
||||
{
|
||||
OldWidth = SCREENWIDTH;
|
||||
OldHeight = SCREENHEIGHT;
|
||||
OldWidth = screen->VideoWidth;
|
||||
OldHeight = screen->VideoHeight;
|
||||
OldBits = DisplayBits;
|
||||
NewBits = BitTranslate[DummyDepthCvar];
|
||||
setmodeneeded = true;
|
||||
|
@ -297,11 +297,11 @@ void M_RestoreMode ()
|
|||
void M_SetDefaultMode ()
|
||||
{
|
||||
// Make current resolution the default
|
||||
vid_defwidth = SCREENWIDTH;
|
||||
vid_defheight = SCREENHEIGHT;
|
||||
vid_defwidth = screen->VideoWidth;
|
||||
vid_defheight = screen->VideoHeight;
|
||||
vid_defbits = DisplayBits;
|
||||
testingmode = 0;
|
||||
SetModesMenu (SCREENWIDTH, SCREENHEIGHT, DisplayBits);
|
||||
SetModesMenu (screen->VideoWidth, screen->VideoHeight, DisplayBits);
|
||||
}
|
||||
|
||||
|
||||
|
@ -314,7 +314,7 @@ void M_SetDefaultMode ()
|
|||
|
||||
void M_RefreshModesList ()
|
||||
{
|
||||
BuildModesList (SCREENWIDTH, SCREENHEIGHT, DisplayBits);
|
||||
BuildModesList (screen->VideoWidth, screen->VideoHeight, DisplayBits);
|
||||
}
|
||||
|
||||
void M_InitVideoModesMenu ()
|
||||
|
@ -385,8 +385,8 @@ void M_SetVideoMode()
|
|||
{
|
||||
if (!GetSelectedSize (&NewWidth, &NewHeight))
|
||||
{
|
||||
NewWidth = SCREENWIDTH;
|
||||
NewHeight = SCREENHEIGHT;
|
||||
NewWidth = screen->VideoWidth;
|
||||
NewHeight = screen->VideoHeight;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -850,6 +850,9 @@ DFrameBuffer::DFrameBuffer (int width, int height)
|
|||
{
|
||||
LastMS = LastSec = FrameCount = LastCount = LastTic = 0;
|
||||
Accel2D = false;
|
||||
|
||||
VideoWidth = width;
|
||||
VideoHeight = height;
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
@ -1352,6 +1355,7 @@ void V_OutputResized (int width, int height)
|
|||
{
|
||||
StatusBar->ScreenSizeChanged();
|
||||
}
|
||||
C_NewModeAdjust();
|
||||
}
|
||||
|
||||
void V_CalcCleanFacs (int designwidth, int designheight, int realwidth, int realheight, int *cleanx, int *cleany, int *_cx1, int *_cx2)
|
||||
|
|
|
@ -422,6 +422,10 @@ public:
|
|||
virtual bool Is8BitMode() = 0;
|
||||
#endif
|
||||
|
||||
// The original size of the framebuffer as selected in the video menu.
|
||||
int VideoWidth = 0;
|
||||
int VideoHeight = 0;
|
||||
|
||||
protected:
|
||||
void DrawRateStuff ();
|
||||
void CopyFromBuff (BYTE *src, int srcPitch, int width, int height, BYTE *dest);
|
||||
|
|
Loading…
Reference in a new issue