From: Thomas Debesse Date: Mon, 11 Feb 2019 09:00:31 +0000 (+0100) Subject: Merge commit '66d12fc2373b05233aa29ee097efe820f05a8520' into garux-merge X-Git-Url: http://git.xonotic.org/?p=xonotic%2Fnetradiant.git;a=commitdiff_plain;h=e28939e7b819e0cb0c3050037ec0e57160f7dba1 Merge commit '66d12fc2373b05233aa29ee097efe820f05a8520' into garux-merge --- e28939e7b819e0cb0c3050037ec0e57160f7dba1 diff --cc tools/quake3/common/vfs.c index ed4c1f61,2e744588..474cb8e6 --- a/tools/quake3/common/vfs.c +++ b/tools/quake3/common/vfs.c @@@ -287,9 -275,9 +287,9 @@@ void vfsListShaderFiles( char* list, in } for ( k = 0; k < *num; k++ ){ - if ( !Q_stricmp( list[k], dirlist ) ) goto shISdouplicate; - if ( !stricmp( list + k*65, dirlist ) ) goto shISdouplicate; ++ if ( !Q_stricmp( list + k*65, dirlist ) ) goto shISdouplicate; } - strcpy( list[*num], dirlist ); + strcpy( list + (*num)*65, dirlist ); (*num)++; shISdouplicate: g_free( dirlist ); @@@ -314,9 -302,9 +314,9 @@@ ext++; for ( k = 0; k < *num; k++ ){ - if ( !Q_stricmp( list[k], ext ) ) goto shISdouplicate2; - if ( !stricmp( list + k*65, ext ) ) goto shISdouplicate2; ++ if ( !Q_stricmp( list + k*65, ext ) ) goto shISdouplicate2; } - strcpy( list[*num], ext ); + strcpy( list + (*num)*65, ext ); (*num)++; shISdouplicate2: continue; diff --cc tools/quake3/q3map2/main.c index ee3f63e7,0ee9be82..67798e1c --- a/tools/quake3/q3map2/main.c +++ b/tools/quake3/q3map2/main.c @@@ -292,12 -1668,12 +292,12 @@@ void tex2list( char* texlist, int *texn StripExtension( token ); FixDOSName( token ); for ( i = 0; i < *texnum; i++ ){ - if ( !stricmp( texlist + i*65, token ) ) return; + if ( !Q_stricmp( texlist[i], token ) ) return; } for ( i = 0; i < *EXtexnum; i++ ){ - if ( !stricmp( EXtex + i*65, token ) ) return; + if ( !Q_stricmp( EXtex[i], token ) ) return; } - strcpy ( texlist[*texnum], token ); + strcpy ( texlist + (*texnum)*65, token ); (*texnum)++; return; } @@@ -306,11 -1682,11 +306,11 @@@ /* Check if newcoming res is unique */ - void res2list( char data[512][MAX_QPATH], int *num ){ + void res2list( char* data, int *num ){ int i; - if ( data[*num][0] == '\0') return; + if ( *( data + (*num)*65 ) == '\0') return; for ( i = 0; i < *num; i++ ){ - if ( !stricmp( data + i*65, data + (*num)*65 ) ) return; + if ( !Q_stricmp( data[i], data[*num] ) ) return; } (*num)++; return; @@@ -423,8 -1799,8 +423,8 @@@ int pk3BSPMain( int argc, char **argv ) epair_t *ep; for ( ep = entities[0].epairs; ep != NULL; ep = ep->next ) { - if ( !strnicmp( ep->key, "vertexremapshader", 17 ) ) { + if ( !Q_strncasecmp( ep->key, "vertexremapshader", 17 ) ) { - sscanf( ep->value, "%*[^;] %*[;] %s", pk3Shaders[pk3ShadersN] ); + sscanf( ep->value, "%*[^;] %*[;] %s", pk3Shaders + pk3ShadersN*65 ); res2list( pk3Shaders, &pk3ShadersN ); } } @@@ -433,18 -1813,22 +437,22 @@@ for ( i = 0; i < numBSPEntities && i < numEntities; i++ ) { - strcpy( pk3Sounds[pk3SoundsN], ValueForKey( &entities[i], "noise" ) ); - if ( pk3Sounds[pk3SoundsN][0] != '*' ) res2list( pk3Sounds, &pk3SoundsN ); + strcpy( pk3Sounds + pk3SoundsN*65, ValueForKey( &entities[i], "noise" ) ); + if ( *( pk3Sounds + pk3SoundsN*65 ) != '\0' && *( pk3Sounds + pk3SoundsN*65 ) != '*' ){ + FixDOSName( pk3Sounds + pk3SoundsN*65 ); + DefaultExtension( pk3Sounds + pk3SoundsN*65, ".wav" ); + res2list( pk3Sounds, &pk3SoundsN ); + } - if ( !stricmp( ValueForKey( &entities[i], "classname" ), "func_plat" ) ){ + if ( !Q_stricmp( ValueForKey( &entities[i], "classname" ), "func_plat" ) ){ - strcpy( pk3Sounds[pk3SoundsN], "sound/movers/plats/pt1_strt.wav"); + strcpy( pk3Sounds + pk3SoundsN*65, "sound/movers/plats/pt1_strt.wav"); res2list( pk3Sounds, &pk3SoundsN ); - strcpy( pk3Sounds[pk3SoundsN], "sound/movers/plats/pt1_end.wav"); + strcpy( pk3Sounds + pk3SoundsN*65, "sound/movers/plats/pt1_end.wav"); res2list( pk3Sounds, &pk3SoundsN ); } - if ( !stricmp( ValueForKey( &entities[i], "classname" ), "target_push" ) ){ + if ( !Q_stricmp( ValueForKey( &entities[i], "classname" ), "target_push" ) ){ if ( !(IntForKey( &entities[i], "spawnflags") & 1) ){ - strcpy( pk3Sounds[pk3SoundsN], "sound/misc/windfly.wav"); + strcpy( pk3Sounds + pk3SoundsN*65, "sound/misc/windfly.wav"); res2list( pk3Sounds, &pk3SoundsN ); } } @@@ -596,9 -1975,9 +599,9 @@@ skipEXfile /* do wanna le shader? */ wantShader = qfalse; for ( j = 0; j < pk3ShadersN; j++ ){ - if ( !Q_stricmp( pk3Shaders[j], token) ){ - strcpy ( shadername, pk3Shaders[j] ); - pk3Shaders[j][0] = '\0'; - if ( !stricmp( pk3Shaders + j*65, token) ){ ++ if ( !Q_stricmp( pk3Shaders + j*65, token) ){ + strcpy ( shadername, pk3Shaders + j*65 ); + *(pk3Shaders + j*65) = '\0'; wantShader = qtrue; break; } @@@ -666,12 -2046,12 +670,12 @@@ strcpy( token, temp ); } for ( j = 0; j < pk3VideosN; j++ ){ - if ( !Q_stricmp( pk3Videos[j], token ) ){ - if ( !stricmp( pk3Videos + j*65, token ) ){ ++ if ( !Q_stricmp( pk3Videos + j*65, token ) ){ goto away; } } for ( j = 0; j < EXpk3VideosN; j++ ){ - if ( !Q_stricmp( EXpk3Videos[j], token ) ){ - if ( !stricmp( EXpk3Videos + j*65, token ) ){ ++ if ( !Q_stricmp( EXpk3Videos + j*65, token ) ){ goto away; } } @@@ -726,7 -2106,7 +730,7 @@@ //exclude shader if ( wantShader ){ for ( j = 0; j < EXpk3ShadersN; j++ ){ - if ( !Q_stricmp( EXpk3Shaders[j], shadername ) ){ - if ( !stricmp( EXpk3Shaders + j*65, shadername ) ){ ++ if ( !Q_stricmp( EXpk3Shaders + j*65, shadername ) ){ wantShader = qfalse; break; } @@@ -734,7 -2114,7 +738,7 @@@ /* shouldnt make shaders for shipped with the game textures aswell */ if ( wantShader ){ for ( j = 0; j < EXpk3TexturesN; j++ ){ - if ( !Q_stricmp( EXpk3Textures[j], shadername ) ){ - if ( !stricmp( EXpk3Textures + j*65, shadername ) ){ ++ if ( !Q_stricmp( EXpk3Textures + j*65, shadername ) ){ wantShader = qfalse; break; } @@@ -749,9 -2129,9 +753,9 @@@ //exclude shader file if ( wantShaderFile ){ for ( j = 0; j < EXpk3ShaderfilesN; j++ ){ - if ( !Q_stricmp( EXpk3Shaderfiles[j], pk3Shaderfiles[ i ] ) ){ - Sys_Printf( "WARNING: excluded shader %s, since it was located in restricted shader file: %s\n", lastwantedShader, pk3Shaderfiles[i] ); - pk3Shaderfiles[ i ][0] = '\0'; - if ( !stricmp( EXpk3Shaderfiles + j*65, pk3Shaderfiles + i*65 ) ){ ++ if ( !Q_stricmp( EXpk3Shaderfiles + j*65, pk3Shaderfiles + i*65 ) ){ + Sys_Printf( "WARNING: excluded shader %s, since it was located in restricted shader file: %s\n", lastwantedShader, pk3Shaderfiles + i*65 ); + *( pk3Shaderfiles + i*65 ) = '\0'; break; } } @@@ -767,18 -2147,18 +771,18 @@@ /* exclude stuff */ //pure textures (shader ones are done) for ( i = 0; i < pk3ShadersN; i++ ){ - if ( pk3Shaders[i][0] != '\0' ){ - FixDOSName( pk3Shaders[i] ); + if ( *( pk3Shaders + i*65 ) != '\0' ){ + FixDOSName( pk3Shaders + i*65 ); for ( j = 0; j < pk3TexturesN; j++ ){ - if ( !Q_stricmp( pk3Shaders[i], pk3Textures[j] ) ){ - pk3Shaders[i][0] = '\0'; - if ( !stricmp( pk3Shaders + i*65, pk3Textures + j*65 ) ){ ++ if ( !Q_stricmp( pk3Shaders + i*65, pk3Textures + j*65 ) ){ + *( pk3Shaders + i*65 ) = '\0'; break; } } - if ( pk3Shaders[i][0] == '\0' ) continue; + if ( *( pk3Shaders + i*65 ) == '\0' ) continue; for ( j = 0; j < EXpk3TexturesN; j++ ){ - if ( !Q_stricmp( pk3Shaders[i], EXpk3Textures[j] ) ){ - pk3Shaders[i][0] = '\0'; - if ( !stricmp( pk3Shaders + i*65, EXpk3Textures + j*65 ) ){ ++ if ( !Q_stricmp( pk3Shaders + i*65, EXpk3Textures + j*65 ) ){ + *( pk3Shaders + i*65 ) = '\0'; break; } } @@@ -787,10 -2167,9 +791,9 @@@ //snds for ( i = 0; i < pk3SoundsN; i++ ){ - FixDOSName( pk3Sounds[i] ); for ( j = 0; j < EXpk3SoundsN; j++ ){ - if ( !Q_stricmp( pk3Sounds[i], EXpk3Sounds[j] ) ){ - pk3Sounds[i][0] = '\0'; - if ( !stricmp( pk3Sounds + i*65, EXpk3Sounds + j*65 ) ){ ++ if ( !Q_stricmp( pk3Sounds + i*65, EXpk3Sounds + j*65 ) ){ + *( pk3Sounds + i*65 ) = '\0'; break; } }