- fixed: Added currentrenderer checks to SDL and COCOA implementations of 'swtruecolor'

This commit is contained in:
Rachael Alexanderson 2017-04-30 16:35:16 -04:00
parent dfa5a3cd07
commit 65399bf075
2 changed files with 17 additions and 11 deletions

View file

@ -116,6 +116,8 @@
DFrameBuffer *CreateGLSWFrameBuffer(int width, int height, bool bgra, bool fullscreen); DFrameBuffer *CreateGLSWFrameBuffer(int width, int height, bool bgra, bool fullscreen);
int currentrenderer;
CUSTOM_CVAR(Bool, vid_glswfb, true, CVAR_NOINITCALL | CVAR_GLOBALCONFIG | CVAR_NOINITCALL) CUSTOM_CVAR(Bool, vid_glswfb, true, CVAR_NOINITCALL | CVAR_GLOBALCONFIG | CVAR_NOINITCALL)
{ {
Printf("This won't take effect until " GAMENAME " is restarted.\n"); Printf("This won't take effect until " GAMENAME " is restarted.\n");
@ -135,12 +137,15 @@ CUSTOM_CVAR(Bool, swtruecolor, TRUECOLOR_DEFAULT, CVAR_ARCHIVE | CVAR_GLOBALCONF
{ {
// Strictly speaking this doesn't require a mode switch, but it is the easiest // Strictly speaking this doesn't require a mode switch, but it is the easiest
// way to force a CreateFramebuffer call without a lot of refactoring. // way to force a CreateFramebuffer call without a lot of refactoring.
if (currentrenderer == 0)
{
extern int NewWidth, NewHeight, NewBits, DisplayBits; extern int NewWidth, NewHeight, NewBits, DisplayBits;
NewWidth = screen->GetWidth(); NewWidth = screen->GetWidth();
NewHeight = screen->GetHeight(); NewHeight = screen->GetHeight();
NewBits = DisplayBits; NewBits = DisplayBits;
setmodeneeded = true; setmodeneeded = true;
} }
}
CUSTOM_CVAR(Bool, fullscreen, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG) CUSTOM_CVAR(Bool, fullscreen, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
{ {
@ -157,8 +162,6 @@ CUSTOM_CVAR(Bool, vid_autoswitch, true, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_
Printf("You must restart " GAMENAME " to apply graphics switching mode\n"); Printf("You must restart " GAMENAME " to apply graphics switching mode\n");
} }
int currentrenderer;
CUSTOM_CVAR(Int, vid_renderer, 1, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOINITCALL) CUSTOM_CVAR(Int, vid_renderer, 1, CVAR_ARCHIVE | CVAR_GLOBALCONFIG | CVAR_NOINITCALL)
{ {
// 0: Software renderer // 0: Software renderer

View file

@ -323,11 +323,14 @@ CUSTOM_CVAR(Bool, swtruecolor, true, CVAR_ARCHIVE|CVAR_GLOBALCONFIG|CVAR_NOINITC
{ {
// Strictly speaking this doesn't require a mode switch, but it is the easiest // Strictly speaking this doesn't require a mode switch, but it is the easiest
// way to force a CreateFramebuffer call without a lot of refactoring. // way to force a CreateFramebuffer call without a lot of refactoring.
if (currentrenderer == 0)
{
NewWidth = screen->GetWidth(); NewWidth = screen->GetWidth();
NewHeight = screen->GetHeight(); NewHeight = screen->GetHeight();
NewBits = DisplayBits; NewBits = DisplayBits;
setmodeneeded = true; setmodeneeded = true;
} }
}
CUSTOM_CVAR (Bool, fullscreen, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG) CUSTOM_CVAR (Bool, fullscreen, false, CVAR_ARCHIVE|CVAR_GLOBALCONFIG)
{ {