From 901a845e39769be67c41fdd4d230a4187c63a94c Mon Sep 17 00:00:00 2001 From: brendon Date: Sun, 14 Jun 2020 09:59:25 -0700 Subject: [PATCH] Fixed crash in video menu. Fixed compiler setting. --- quake2.vcxproj | 3 +-- renderer/r_main.c | 4 ++-- ui/ui_backend.c | 8 +++++++- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/quake2.vcxproj b/quake2.vcxproj index d4e67c4..26c4be1 100644 --- a/quake2.vcxproj +++ b/quake2.vcxproj @@ -203,8 +203,7 @@ MachineX86 - - + LIBCMTD.lib diff --git a/renderer/r_main.c b/renderer/r_main.c index 1783ccb..7f15dbd 100644 --- a/renderer/r_main.c +++ b/renderer/r_main.c @@ -1131,7 +1131,7 @@ qboolean R_Init ( void *hinstance, void *hWnd, char *reason ) VID_Printf (PRINT_ALL, "GL_MAX_TEXTURE_SIZE: %i\n", gl_config.max_texsize ); gl_config.extensions_string = qglGetString (GL_EXTENSIONS); - VID_Printf (PRINT_ALL, "GL_EXTENSIONS: %s\n", gl_config.extensions_string ); + //VID_Printf (PRINT_ALL, "GL_EXTENSIONS: %s\n", gl_config.extensions_string ); //BC 6-14-2020 don't print this, because it sometimes makes things crash. strcpy( renderer_buffer, gl_config.renderer_string ); strlwr( renderer_buffer ); @@ -1532,7 +1532,7 @@ void GL_Strings_f (void) VID_Printf (PRINT_ALL, "GL_RENDERER: %s\n", gl_config.renderer_string ); VID_Printf (PRINT_ALL, "GL_VERSION: %s\n", gl_config.version_string ); VID_Printf (PRINT_ALL, "GL_MAX_TEXTURE_SIZE: %i\n", gl_config.max_texsize ); - VID_Printf (PRINT_ALL, "GL_EXTENSIONS: %s\n", gl_config.extensions_string ); + //VID_Printf (PRINT_ALL, "GL_EXTENSIONS: %s\n", gl_config.extensions_string ); //BC 6-14-2020 don't print this, because it sometimes makes things crash. } diff --git a/ui/ui_backend.c b/ui/ui_backend.c index 394907e..b547d6b 100644 --- a/ui/ui_backend.c +++ b/ui/ui_backend.c @@ -826,7 +826,13 @@ void Menu_Draw (menuframework_s *menu) min[0] -= SCR_ScaledVideo(len*MENU_FONT_SIZE - LCOLUMN_OFFSET*2); } - len = strlen(spin->itemnames[spin->curvalue]); + //len = strlen(spin->itemnames[spin->curvalue]); + + if (spin->curvalue >= 0) //BC 6-14-2020 crash fix if curvalue is < 0 + len = strlen(spin->itemnames[spin->curvalue]); + else + len = 3; + max[0] += SCR_ScaledVideo(len*MENU_FONT_SIZE); type = MENUITEM_ROTATE;