[quake3-commits] r2335 - in trunk/code: rend2 renderer
DONOTREPLY at icculus.org
DONOTREPLY at icculus.org
Fri Oct 26 03:23:52 EDT 2012
Author: ztm
Date: 2012-10-26 03:23:49 -0400 (Fri, 26 Oct 2012)
New Revision: 2335
Modified:
trunk/code/rend2/tr_init.c
trunk/code/renderer/tr_init.c
Log:
Split Rend2's printing OpenGL extensions string (> 1024 characters) into separate function and merged into opengl1 renderer. (Fixes bug #5559.)
Modified: trunk/code/rend2/tr_init.c
===================================================================
--- trunk/code/rend2/tr_init.c 2012-10-26 04:16:25 UTC (rev 2334)
+++ trunk/code/rend2/tr_init.c 2012-10-26 07:23:49 UTC (rev 2335)
@@ -944,7 +944,28 @@
qglDisable( GL_BLEND );
}
+/*
+================
+R_PrintLongString
+Workaround for ri.Printf's 1024 characters buffer limit.
+================
+*/
+void R_PrintLongString(const char *string) {
+ char buffer[1024];
+ const char *p;
+ int size = strlen(string);
+
+ p = string;
+ while(size > 0)
+ {
+ Q_strncpyz(buffer, p, sizeof (buffer) );
+ ri.Printf( PRINT_ALL, "%s", buffer );
+ p += 1023;
+ size -= 1023;
+ }
+}
+
/*
================
GfxInfo_f
@@ -966,28 +987,9 @@
ri.Printf( PRINT_ALL, "\nGL_VENDOR: %s\n", glConfig.vendor_string );
ri.Printf( PRINT_ALL, "GL_RENDERER: %s\n", glConfig.renderer_string );
ri.Printf( PRINT_ALL, "GL_VERSION: %s\n", glConfig.version_string );
- // this was really bugging me
- if (strlen(glConfig.extensions_string) > 1008)
- {
- char buffer[1024];
- char *p;
- int size = strlen(glConfig.extensions_string);
- ri.Printf( PRINT_ALL, "GL_EXTENSIONS: ");
-
- p = glConfig.extensions_string;
- while(size > 0)
- {
- Q_strncpyz(buffer, p, 1024);
- ri.Printf( PRINT_ALL, "%s", buffer );
- p += 1023;
- size -= 1023;
- }
- ri.Printf( PRINT_ALL, "\n" );
- }
- else
- {
- ri.Printf( PRINT_ALL, "GL_EXTENSIONS: %s\n", glConfig.extensions_string );
- }
+ ri.Printf( PRINT_ALL, "GL_EXTENSIONS: " );
+ R_PrintLongString( glConfig.extensions_string );
+ ri.Printf( PRINT_ALL, "\n" );
ri.Printf( PRINT_ALL, "GL_MAX_TEXTURE_SIZE: %d\n", glConfig.maxTextureSize );
ri.Printf( PRINT_ALL, "GL_MAX_TEXTURE_UNITS_ARB: %d\n", glConfig.numTextureUnits );
ri.Printf( PRINT_ALL, "\nPIXELFORMAT: color(%d-bits) Z(%d-bit) stencil(%d-bits)\n", glConfig.colorBits, glConfig.depthBits, glConfig.stencilBits );
Modified: trunk/code/renderer/tr_init.c
===================================================================
--- trunk/code/renderer/tr_init.c 2012-10-26 04:16:25 UTC (rev 2334)
+++ trunk/code/renderer/tr_init.c 2012-10-26 07:23:49 UTC (rev 2335)
@@ -879,7 +879,28 @@
qglDisable( GL_BLEND );
}
+/*
+================
+R_PrintLongString
+Workaround for ri.Printf's 1024 characters buffer limit.
+================
+*/
+void R_PrintLongString(const char *string) {
+ char buffer[1024];
+ const char *p;
+ int size = strlen(string);
+
+ p = string;
+ while(size > 0)
+ {
+ Q_strncpyz(buffer, p, sizeof (buffer) );
+ ri.Printf( PRINT_ALL, "%s", buffer );
+ p += 1023;
+ size -= 1023;
+ }
+}
+
/*
================
GfxInfo_f
@@ -901,7 +922,9 @@
ri.Printf( PRINT_ALL, "\nGL_VENDOR: %s\n", glConfig.vendor_string );
ri.Printf( PRINT_ALL, "GL_RENDERER: %s\n", glConfig.renderer_string );
ri.Printf( PRINT_ALL, "GL_VERSION: %s\n", glConfig.version_string );
- ri.Printf( PRINT_ALL, "GL_EXTENSIONS: %s\n", glConfig.extensions_string );
+ ri.Printf( PRINT_ALL, "GL_EXTENSIONS: " );
+ R_PrintLongString( glConfig.extensions_string );
+ ri.Printf( PRINT_ALL, "\n" );
ri.Printf( PRINT_ALL, "GL_MAX_TEXTURE_SIZE: %d\n", glConfig.maxTextureSize );
ri.Printf( PRINT_ALL, "GL_MAX_TEXTURE_UNITS_ARB: %d\n", glConfig.numTextureUnits );
ri.Printf( PRINT_ALL, "\nPIXELFORMAT: color(%d-bits) Z(%d-bit) stencil(%d-bits)\n", glConfig.colorBits, glConfig.depthBits, glConfig.stencilBits );
More information about the quake3-commits
mailing list