From 0210c0292f4e78ed55335d621be0885d41c84145 Mon Sep 17 00:00:00 2001 From: yvt Date: Sun, 1 Sep 2013 23:15:37 +0900 Subject: [PATCH] Added GL_MAX_TEXTURE_SIZE/GL_MAX_3D_TEXTURE_SIZE check --- Sources/Gui/MainWindowHandler.cpp | 41 ++++++++++++++++++++++++++++--- 1 file changed, 37 insertions(+), 4 deletions(-) diff --git a/Sources/Gui/MainWindowHandler.cpp b/Sources/Gui/MainWindowHandler.cpp index 6c58c1be..c5ea3012 100644 --- a/Sources/Gui/MainWindowHandler.cpp +++ b/Sources/Gui/MainWindowHandler.cpp @@ -63,6 +63,7 @@ SPADES_SETTING(r_fogShadow, "0"); SPADES_SETTING(r_lensFlare, "1"); SPADES_SETTING(r_blitFramebuffer, "1"); SPADES_SETTING(r_srgb, "1"); +SPADES_SETTING(r_shadowMapSize, "2048"); SPADES_SETTING(s_maxPolyphonics, "96"); SPADES_SETTING(s_eax, "1"); @@ -389,7 +390,7 @@ void MainWindow::CheckGLCapability() { msg += "
"; } - msg += "

"; + msg += "
 
"; msg += "Other Extensions:
"; // non-requred extensions @@ -425,15 +426,47 @@ void MainWindow::CheckGLCapability() { msg += "
"; } + msg += "
 
"; + msg += "Miscellaneous:
"; + char buf[256]; + sprintf(buf, "Max Texture Size: %d
", (int)maxTextureSize); + msg += buf; + if(maxTextureSize < 1024) { + capable = false; + msg += ""; + msg += "  TOO SMALL (1024 required)"; + msg += "
"; + } + if((int)r_shadowMapSize > maxTextureSize) { + SPLog("Changed r_shadowMapSize from %d to %d: too small GL_MAX_TEXTURE_SIZE", (int)r_shadowMapSize, maxTextureSize); + + r_shadowMapSize = maxTextureSize; + } + + sprintf(buf, "Max 3D Texture Size: %d
", (int)max3DTextureSize); + msg += buf; + if(max3DTextureSize < 512) { + msg += " Global Illumation is disabled (512 required)
"; + + if(r_radiosity) { + r_radiosity = 0; + SPLog("Disabling r_radiosity: too small GL_MAX_3D_TEXTURE_SIZE"); + + radiosityCheck->deactivate(); + } + } + if(capable){ msg = "Your video card supports all " - "required OpenGL extensions.
" + msg; + "required OpenGL extensions/features.
 
" + msg; }else{ msg = "Your video card/driver doesn't support " - "at least one of required OpenGL extensions." - " You cannot play OpenSpades.
" + msg; + "at least one of required OpenGL extensions/features." + " You cannot play OpenSpades.
 
" + msg; } + + } msg = "" + msg + "";