Fix: Do not ignore game descriptor value for maxLMSurfaceVerts and keepLights

Use unsigned int for maxLMSurfaceVerts, maxSurfaceVerts and maxSurfaceIndexes
Fix: Out of bounds value at qfusion.h
This commit is contained in:
germangar 2021-06-02 12:16:44 +02:00
parent 6c00419653
commit 451f88efd7
3 changed files with 9 additions and 7 deletions

View File

@ -698,11 +698,13 @@ int BSPMain( int argc, char **argv ){
strClear( tempSource );
/* set standard game flags */
maxLMSurfaceVerts = game->maxLMSurfaceVerts;
maxSurfaceVerts = game->maxSurfaceVerts;
maxSurfaceIndexes = game->maxSurfaceIndexes;
emitFlares = game->emitFlares;
texturesRGB = game->texturesRGB;
colorsRGB = game->colorsRGB;
keepLights = game->keepLights;
/* process arguments */
for ( i = 1; i < ( argc - 1 ); i++ )

View File

@ -110,7 +110,7 @@
"scripts", /* shader directory */
65535, /* max lightmapped surface verts */
65535, /* max surface verts */
393210, /* max surface indexes */
65535, /* max surface indexes */
false, /* flares */
"flareshader", /* default flare shader */
false, /* wolf lighting model? */

View File

@ -454,9 +454,9 @@ struct game_t
const char *homeBasePath; /* home sub-dir on unix */
const char *magic; /* magic word for figuring out base path */
const char *shaderPath; /* shader directory */
int maxLMSurfaceVerts; /* default maximum meta surface verts */
int maxSurfaceVerts; /* default maximum surface verts */
int maxSurfaceIndexes; /* default maximum surface indexes (tris * 3) */
unsigned int maxLMSurfaceVerts; /* default maximum meta surface verts */
unsigned int maxSurfaceVerts; /* default maximum surface verts */
unsigned int maxSurfaceIndexes; /* default maximum surface indexes (tris * 3) */
bool emitFlares; /* when true, emit flare surfaces */
const char *flareShader; /* default flare shader (MUST BE SET) */
bool wolfLight; /* when true, lights work like wolf q3map */
@ -2030,9 +2030,9 @@ Q_EXTERN bool nocmdline Q_ASSIGN( false );
Q_EXTERN int patchSubdivisions Q_ASSIGN( 8 ); /* ydnar: -patchmeta subdivisions */
Q_EXTERN int maxLMSurfaceVerts Q_ASSIGN( 64 ); /* ydnar */
Q_EXTERN int maxSurfaceVerts Q_ASSIGN( 999 ); /* ydnar */
Q_EXTERN int maxSurfaceIndexes Q_ASSIGN( 6000 ); /* ydnar */
Q_EXTERN unsigned int maxLMSurfaceVerts Q_ASSIGN( 64 ); /* ydnar */
Q_EXTERN unsigned int maxSurfaceVerts Q_ASSIGN( 999 ); /* ydnar */
Q_EXTERN unsigned int maxSurfaceIndexes Q_ASSIGN( 6000 ); /* ydnar */
Q_EXTERN float npDegrees Q_ASSIGN( 0.0f ); /* ydnar: nonplanar degrees */
Q_EXTERN int bevelSnap Q_ASSIGN( 0 ); /* ydnar: bevel plane snap */
Q_EXTERN int texRange Q_ASSIGN( 0 );