Skip to content

Commit ed16ba3

Browse files
committed
- Crash fix for older (<=2001) mods by trimming the string shared with ui module, so no overflow for them
- jettisoning old proposed mme particle system that was never ever hooked up properly. - other small warning cleanup
1 parent 28e8ff0 commit ed16ba3

File tree

9 files changed

+9
-4524
lines changed

9 files changed

+9
-4524
lines changed

code/client/fx_local.h

Lines changed: 0 additions & 476 deletions
This file was deleted.

code/client/fx_main.c

Lines changed: 0 additions & 1569 deletions
This file was deleted.

code/client/fx_parse.c

Lines changed: 0 additions & 2390 deletions
This file was deleted.

code/client/fx_public.h

Lines changed: 0 additions & 35 deletions
This file was deleted.

code/client/fx_types.h

Lines changed: 0 additions & 51 deletions
This file was deleted.

code/renderer_oa/tr_bsp.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,6 @@ static void R_ColorShiftLightingBytes( byte in[4], byte out[4] ) {
119119
if ( ( r | g | b ) > 255 ) {
120120

121121
int max;
122-
int gmr, gmg, gmb;
123122
max = r > g ? r : g;
124123
max = max > b ? max : b;
125124
r = r * 255 / max;
@@ -134,7 +133,6 @@ static void R_ColorShiftLightingBytes( byte in[4], byte out[4] ) {
134133
g += invader;
135134
b += invader;
136135

137-
138136
// Normalize... again!!!
139137

140138
max = r > g ? r : g;

code/renderer_oa/tr_extensions.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -126,6 +126,7 @@ typedef enum {
126126

127127
int softwaremode; // leilei - detect for software mode
128128
int voodootype; // leilei - detect for voodoo revision
129+
char extensions_string_full [BIG_INFO_STRING]; // leilei - gl extensions crash workaround
129130

130131
/** From renderer_opengl2 (v28) */
131132
static qboolean GLimp_HaveExtension(const char *ext)
@@ -331,6 +332,11 @@ void GLimp_InitExtraExtensions()
331332
Q_strncpyz( buf, glConfig.renderer_string, sizeof(buf) );
332333
Q_strlwr( buf );
333334

335+
// leilei - we are done with our extensions string, if it's too long we can just trim it so we won't hardlock old qvms with an overflow.
336+
Q_strncpyz( extensions_string_full, (char *) qglGetString (GL_EXTENSIONS), sizeof( glConfig.extensions_string ) ); // copy to a global for gfxinfo
337+
char butt[640];
338+
Q_strncpyz( glConfig.extensions_string, (char *) qglGetString (GL_EXTENSIONS), sizeof( butt ) );
339+
334340

335341
//
336342
// this is where hardware specific workarounds that should be

code/renderer_oa/tr_init.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1013,7 +1013,7 @@ void GfxInfo_f( void )
10131013
ri.Printf( PRINT_ALL, "GL_RENDERER: %s\n", glConfig.renderer_string );
10141014
ri.Printf( PRINT_ALL, "GL_VERSION: %s\n", glConfig.version_string );
10151015
ri.Printf( PRINT_ALL, "GL_EXTENSIONS: " );
1016-
R_PrintLongString( glConfig.extensions_string );
1016+
R_PrintLongString( extensions_string_full );//R_PrintLongString( glConfig.extensions_string ); // leilei - gl extensions crash workaround
10171017
ri.Printf( PRINT_ALL, "\n" );
10181018
ri.Printf( PRINT_ALL, "GL_MAX_TEXTURE_SIZE: %d\n", glConfig.maxTextureSize );
10191019
ri.Printf( PRINT_ALL, "GL_MAX_TEXTURE_UNITS_ARB: %d\n", glConfig.numTextureUnits );

code/renderer_oa/tr_local.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2337,5 +2337,7 @@ void R_LFX_Blood (const vec3_t org, const vec3_t dir, float pressure) ;
23372337
void LFX_ShaderInit(void);
23382338
void LFX_ParticleEffect (int effect, const vec3_t org, const vec3_t dir);
23392339

2340+
extern char extensions_string_full [BIG_INFO_STRING]; // leilei - gl extensions crash workaround
2341+
23402342
#endif //TR_LOCAL_H
23412343

0 commit comments

Comments
 (0)