]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
Merge commit '66d12fc2373b05233aa29ee097efe820f05a8520' into garux-merge
authorThomas Debesse <dev@illwieckz.net>
Mon, 11 Feb 2019 09:00:31 +0000 (10:00 +0100)
committerThomas Debesse <dev@illwieckz.net>
Mon, 11 Feb 2019 09:00:31 +0000 (10:00 +0100)
1  2 
tools/quake3/common/vfs.c
tools/quake3/common/vfs.h
tools/quake3/q3map2/main.c

index ed4c1f6129a45fc71eacd3125b46b35bec615de5,2e7445882cc8427190bb7cf2849836a9cdaa0dc0..474cb8e6033b6ce7e55557612c02492db88a2b24
@@@ -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 );
                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;
Simple merge
index ee3f63e78999479f750cc79ccc32c1964ebdd4ea,0ee9be82a801d2503635b6a0aff6aecd8cccbf26..67798e1cb0648c794d56e5e4ee29b75c4d01829c
@@@ -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;
  }
  /*
        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 );
                }
        }
  
        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;
                                }
                                                                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;
                                                                }
                                                        }
                        //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;
                                        }
                                /* 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;
                                                }
                //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;
                                }
                        }
  /* 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;
                                }
                        }
  
  //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;
                        }
                }