]> git.xonotic.org Git - xonotic/netradiant.git/blobdiff - tools/quake3/q3map2/bspfile_abstract.c
Merge commit '9fed37bae007bd5e53963ec67e925381609a2980' into garux-merge
[xonotic/netradiant.git] / tools / quake3 / q3map2 / bspfile_abstract.c
index 1b4b9bc6d29a97bb997f8d32bb256acaa5c35b62..420fca2e3b493c68c001e9a7f330eb7bff843162 100644 (file)
@@ -169,7 +169,7 @@ void SwapBlock( int *block, int size ){
 
 void SwapBSPFile( void ){
        int i, j;
-
+       shaderInfo_t    *si;
 
        /* models */
        SwapBlock( (int*) bspModels, numBSPModels * sizeof( bspModels[ 0 ] ) );
@@ -177,6 +177,11 @@ void SwapBSPFile( void ){
        /* shaders (don't swap the name) */
        for ( i = 0; i < numBSPShaders ; i++ )
        {
+               si = ShaderInfoForShader( bspShaders[ i ].shader );
+               if ( si->remapShader && si->remapShader[ 0 ] ) {
+                       strcpy( bspShaders[ i ].shader, si->remapShader );
+               }
+
                bspShaders[ i ].contentFlags = LittleLong( bspShaders[ i ].contentFlags );
                bspShaders[ i ].surfaceFlags = LittleLong( bspShaders[ i ].surfaceFlags );
        }
@@ -268,7 +273,7 @@ int GetLumpElements( bspHeader_t *header, int lump, int size ){
        /* check for odd size */
        if ( header->lumps[ lump ].length % size ) {
                if ( force ) {
-                       Sys_Printf( "WARNING: GetLumpElements: odd lump size (%d) in lump %d\n", header->lumps[ lump ].length, lump );
+                       Sys_FPrintf( SYS_WRN, "WARNING: GetLumpElements: odd lump size (%d) in lump %d\n", header->lumps[ lump ].length, lump );
                        return 0;
                }
                else{
@@ -312,7 +317,7 @@ int CopyLump( bspHeader_t *header, int lump, void *dest, int size ){
        }
        if ( length % size ) {
                if ( force ) {
-                       Sys_Printf( "WARNING: CopyLump: odd lump size (%d) in lump %d\n", length, lump );
+                       Sys_FPrintf( SYS_WRN, "WARNING: CopyLump: odd lump size (%d) in lump %d\n", length, lump );
                        return 0;
                }
                else{
@@ -581,6 +586,8 @@ void ParseEntities( void ){
        numBSPEntities = numEntities;
 }
 
+
+
 /*
  * must be called before UnparseEntities
  */
@@ -592,6 +599,10 @@ void InjectCommandLine( char **argv, int beginArgs, int endArgs ){
        char *sentinel = newCommandLine + sizeof( newCommandLine ) - 1;
        int i;
 
+if (nocmdline)
+{
+       return;
+}
        previousCommandLine = ValueForKey( &entities[0], "_q3map2_cmdline" );
        if ( previousCommandLine && *previousCommandLine ) {
                inpos = previousCommandLine;
@@ -622,6 +633,8 @@ void InjectCommandLine( char **argv, int beginArgs, int endArgs ){
        SetKeyValue( &entities[0], "_q3map2_version", Q3MAP_VERSION );
 }
 
+
+
 /*
    UnparseEntities()
    generates the dentdata string from all the entities.
@@ -748,6 +761,8 @@ void SetKeyValue( entity_t *ent, const char *key, const char *value ){
        ep->value = copystring( value );
 }
 
+
+
 /*
    KeyExists()
    returns true if entity has this key
@@ -768,6 +783,8 @@ qboolean KeyExists( const entity_t *ent, const char *key ){
        return qfalse;
 }
 
+
+
 /*
    ValueForKey()
    gets the value for an entity key