diff --git a/src/engine/renderer/tr_init.cpp b/src/engine/renderer/tr_init.cpp index 984e2961e1..0b1c41615e 100644 --- a/src/engine/renderer/tr_init.cpp +++ b/src/engine/renderer/tr_init.cpp @@ -30,8 +30,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA glstate_t glState; - float displayAspect = 0.0f; - static void GfxInfo_f(); cvar_t *r_glMajorVersion; @@ -922,24 +920,10 @@ ScreenshotCmd screenshotPNGRegistration("screenshotPNG", ssFormat_t::SSF_PNG, "p Log::Notice("PIXELFORMAT: color(%d-bits)", glConfig.colorBits ); - { - std::string out; - if ( glConfig.displayFrequency ) - { - out = Str::Format("%d", glConfig.displayFrequency ); - } - else - { - out = "N/A"; - } - - Log::Notice("MODE: %d, %d x %d %s hz: %s", - r_mode->integer, - glConfig.vidWidth, glConfig.vidHeight, - fsstrings[ +r_fullscreen.Get() ], - out - ); - } + Log::Notice("MODE: %d, %d x %d %s", + r_mode->integer, + glConfig.vidWidth, glConfig.vidHeight, + fsstrings[ +r_fullscreen.Get() ] ); if ( !!r_glExtendedValidation->integer ) { diff --git a/src/engine/renderer/tr_local.h b/src/engine/renderer/tr_local.h index d69287dc05..a706f8b46a 100644 --- a/src/engine/renderer/tr_local.h +++ b/src/engine/renderer/tr_local.h @@ -2796,8 +2796,6 @@ enum class realtimeLightingRenderer_t { LEGACY, TILED }; extern glstate_t glState; // outside of TR since it shouldn't be cleared during ref re-init - extern float displayAspect; // FIXME - // // cvars // diff --git a/src/engine/renderer/tr_types.h b/src/engine/renderer/tr_types.h index 62a28fab68..6d6e9f05a6 100644 --- a/src/engine/renderer/tr_types.h +++ b/src/engine/renderer/tr_types.h @@ -351,13 +351,11 @@ struct glconfig_t glHardwareType_t hardwareType; textureCompression_t textureCompression; - bool8_t textureEnvAddAvailable; - bool8_t anisotropicAvailable; //----(SA) added - float maxAnisotropy; //----(SA) added - int vidWidth, vidHeight; - - int displayFrequency; + int displayIndex; + float displayAspect; + int displayWidth, displayHeight; // the entire monitor (the one indicated by displayIndex) + int vidWidth, vidHeight; // what the game is using bool8_t smpActive; // dual processor }; diff --git a/src/engine/sys/sdl_glimp.cpp b/src/engine/sys/sdl_glimp.cpp index 5428b1a3b1..3b81fe018c 100644 --- a/src/engine/sys/sdl_glimp.cpp +++ b/src/engine/sys/sdl_glimp.cpp @@ -567,8 +567,8 @@ static int GLimp_CompareModes( const void *a, const void *b ) float aspectB = ( float ) modeB->w / ( float ) modeB->h; int areaA = modeA->w * modeA->h; int areaB = modeB->w * modeB->h; - float aspectDiffA = fabsf( aspectA - displayAspect ); - float aspectDiffB = fabsf( aspectB - displayAspect ); + float aspectDiffA = fabsf( aspectA - glConfig.displayAspect ); + float aspectDiffB = fabsf( aspectB - glConfig.displayAspect ); float aspectDiffsDiff = aspectDiffA - aspectDiffB; if ( aspectDiffsDiff > ASPECT_EPSILON ) @@ -960,16 +960,18 @@ static rserr_t GLimp_SetModeAndResolution( const int mode ) if ( SDL_GetDesktopDisplayMode( r_displayIndex->integer, &desktopMode ) == 0 ) { - displayAspect = ( float ) desktopMode.w / ( float ) desktopMode.h; + glConfig.displayAspect = ( float ) desktopMode.w / ( float ) desktopMode.h; + logger.Notice( "Display aspect: %.3f", glConfig.displayAspect ); } else { memset( &desktopMode, 0, sizeof( SDL_DisplayMode ) ); - displayAspect = 1.333f; - logger.Warn("Cannot determine display aspect, assuming %.3f: %s", displayAspect, SDL_GetError() ); + glConfig.displayAspect = 1.333f; + logger.Warn("Cannot determine display aspect, assuming %.3f: %s", glConfig.displayAspect, SDL_GetError() ); } - logger.Notice("Display aspect: %.3f", displayAspect ); + glConfig.displayWidth = desktopMode.w; + glConfig.displayHeight = desktopMode.h; if ( mode == -2 ) { @@ -1616,6 +1618,7 @@ static bool GLimp_StartDriverAndSetMode( int mode, bool fullscreen, bool bordere #endif AssertCvarRange( r_displayIndex, 0, numDisplays - 1, true ); + glConfig.displayIndex = r_displayIndex->integer; rserr_t err = GLimp_SetMode(mode, fullscreen, bordered);