]> git.rm.cloudns.org Git - xonotic/netradiant.git/commitdiff
make minimap parameters game dependent
authordivverent <divverent@61c419a2-8eb2-4b30-bcec-8cead039b335>
Mon, 27 Apr 2009 14:58:50 +0000 (14:58 +0000)
committerdivverent <divverent@61c419a2-8eb2-4b30-bcec-8cead039b335>
Mon, 27 Apr 2009 14:58:50 +0000 (14:58 +0000)
git-svn-id: svn://svn.icculus.org/netradiant/trunk@344 61c419a2-8eb2-4b30-bcec-8cead039b335

18 files changed:
tools/quake3/q3map2/game_darkplaces.h
tools/quake3/q3map2/game_dq.h
tools/quake3/q3map2/game_ef.h
tools/quake3/q3map2/game_etut.h
tools/quake3/q3map2/game_ja.h
tools/quake3/q3map2/game_jk2.h
tools/quake3/q3map2/game_nexuiz.h
tools/quake3/q3map2/game_prophecy.h
tools/quake3/q3map2/game_qfusion.h
tools/quake3/q3map2/game_quake3.h
tools/quake3/q3map2/game_quakelive.h
tools/quake3/q3map2/game_sof2.h
tools/quake3/q3map2/game_tenebrae.h
tools/quake3/q3map2/game_tremulous.h
tools/quake3/q3map2/game_wolf.h
tools/quake3/q3map2/game_wolfet.h
tools/quake3/q3map2/main.c
tools/quake3/q3map2/q3map2.h

index ad0334a150c732a281badb3aa04e312c7aebc9b0..026b0ba2819e265bccdd3f46f0ad3c42fde45000 100644 (file)
@@ -64,6 +64,10 @@ game_t struct
        qfalse,                         /* patch casting enabled */\r
        qfalse,                         /* compile deluxemaps */\r
        0,                                      /* deluxemaps default mode */\r
+       512,                /* minimap size */\r
+       1.0f,               /* minimap sharpener */\r
+       0.0f,               /* minimap border */\r
+       "%s.tga",           /* minimap name format */\r
        "IBSP",                         /* bsp file prefix */\r
        46,                                     /* bsp file version */\r
        qfalse,                         /* cod-style lump len/ofs order */\r
index f08fa2efe628967f7610e086f6c93a7b497acbce..86a1909c0f4d5672130683afa0c59ef663cf5280 100644 (file)
@@ -64,6 +64,10 @@ game_t struct
        qtrue,                          /* patch casting enabled */\r
        qtrue,                          /* compile deluxemaps */\r
        1,                                      /* deluxemaps default mode */\r
+       512,                /* minimap size */\r
+       1.0f,               /* minimap sharpener */\r
+       0.0f,               /* minimap border */\r
+       "%s.tga",           /* minimap name format */\r
        "IBSP",                         /* bsp file prefix */\r
        46,                                     /* bsp file version */\r
        qfalse,                         /* cod-style lump len/ofs order */\r
index 4d06e37b5c04c742c35a4bcfffad9ba0ff8a3873..9ee1e33d13e5a8d26a3befe0f72948b98977f3a3 100644 (file)
@@ -123,6 +123,10 @@ game_t struct
        qfalse,                         /* patch casting enabled */
        qfalse,                         /* compile deluxemaps */
        0,                                      /* deluxemaps default mode */
+       512,                /* minimap size */
+       1.0f,               /* minimap sharpener */
+       0.0f,               /* minimap border */
+       "%s.tga",           /* minimap name format */
        "IBSP",                         /* bsp file prefix */
        46,                                     /* bsp file version */
        qfalse,                         /* cod-style lump len/ofs order */
index 9b7d55cd45b363c8888962fa43b584063f7f9f79..b876894bd57e13a76615482b2965ddbb6852dac6 100644 (file)
@@ -158,6 +158,10 @@ game_t struct
        qfalse,                         /* patch casting enabled */
        qfalse,                         /* compile deluxemaps */
        0,                                      /* deluxemaps default mode */
+       512,                /* minimap size */
+       1.0f,               /* minimap sharpener */
+       0.0f,               /* minimap border */
+       "%s.tga",           /* minimap name format */
        "IBSP",                         /* bsp file prefix */
        46,                                     /* bsp file version */
        qfalse,                         /* cod-style lump len/ofs order */
index d81b7f1719d90747e8cde909ac7bccbffedbb918..4ff04520308b33524e3e5c8c439004cc465bcb0a 100644 (file)
@@ -77,6 +77,10 @@ game_t struct
        qfalse,                         /* patch casting enabled */
        qfalse,                         /* compile deluxemaps */
        0,                                      /* deluxemaps default mode */
+       512,                /* minimap size */
+       1.0f,               /* minimap sharpener */
+       0.0f,               /* minimap border */
+       "%s.tga",           /* minimap name format */
        "RBSP",                         /* bsp file prefix */
        1,                                      /* bsp file version */
        qfalse,                         /* cod-style lump len/ofs order */
index 5f5b81de32ade2d9e8e6e12d0b97b1c7b729d0a6..338c018c0566832515729d6aed746811288c4f88 100644 (file)
@@ -74,6 +74,10 @@ game_t struct
        qfalse,                         /* patch casting enabled */
        qfalse,                         /* compile deluxemaps */
        0,                                      /* deluxemaps default mode */
+       512,                /* minimap size */
+       1.0f,               /* minimap sharpener */
+       0.0f,               /* minimap border */
+       "%s.tga",           /* minimap name format */
        "RBSP",                         /* bsp file prefix */
        1,                                      /* bsp file version */
        qfalse,                         /* cod-style lump len/ofs order */
index 59a0bc9476094eb01fcb7e01a1fd3d0eeb03f034..633b2a526fdb45169325d51a64b2bd3d03337146 100644 (file)
@@ -73,6 +73,10 @@ game_t struct
        qfalse,                         /* patch casting enabled */
        qfalse,                         /* compile deluxemaps */
        0,                                      /* deluxemaps default mode */
+       512,                /* minimap size */
+       1.0f,               /* minimap sharpener */
+       1.0f/66.0f,         /* minimap border */
+       "../gfx/%s_mini.tga", /* minimap name format */
        "IBSP",                         /* bsp file prefix */
        46,                                     /* bsp file version */
        qfalse,                         /* cod-style lump len/ofs order */
index cd82649be0b19ff0b898c114cbd4a3ce09a41800..7fa4412c1ba70aa6329e9a035c5927cb7c781d22 100644 (file)
@@ -64,6 +64,10 @@ game_t struct
        qtrue,                          /* patch casting enabled */\r
        qtrue,                          /* compile deluxemaps */\r
        0,                                      /* deluxemaps default mode */\r
+       512,                /* minimap size */\r
+       1.0f,               /* minimap sharpener */\r
+       0.0f,               /* minimap border */\r
+       "%s.tga",           /* minimap name format */\r
        "IBSP",                         /* bsp file prefix */\r
        46,                                     /* bsp file version */\r
        qfalse,                         /* cod-style lump len/ofs order */\r
index 6930552514643080fc88711439f10efd178e3060..5fedd571ba7f6407f4cbac9754288247d706f4cb 100644 (file)
@@ -125,6 +125,10 @@ game_t struct
        qfalse,                         /* patch casting enabled */
        qfalse,                         /* compile deluxemaps */
        0,                                      /* deluxemaps default mode */
+       512,                /* minimap size */
+       1.0f,               /* minimap sharpener */
+       0.0f,               /* minimap border */
+       "%s.tga",           /* minimap name format */
        "FBSP",                         /* bsp file prefix */
        1,                                      /* bsp file version */
        qfalse,                         /* cod-style lump len/ofs order */
index 76db0f8bf5e329e22f3ec767df4a83dfb33d0147..4097a7e8ece777bb19a9bb4dbd806b814e557a26 100644 (file)
@@ -122,6 +122,10 @@ game_t struct
        qfalse,                         /* patch casting enabled */
        qfalse,                         /* compile deluxemaps */
        0,                                      /* deluxemaps default mode */
+       512,                /* minimap size */
+       1.0f,               /* minimap sharpener */
+       0.0f,               /* minimap border */
+       "%s.tga",           /* minimap name format */
        "IBSP",                         /* bsp file prefix */
        46,                                     /* bsp file version */
        qfalse,                         /* cod-style lump len/ofs order */
index f6c0647f8cf3a725ba5682d3f82564ee983d0e25..91d9ca4b02157be86ae4d45c07580e6eaf931047 100644 (file)
@@ -74,6 +74,10 @@ game_t struct
        qfalse,                         /* patch casting enabled */
        qfalse,                         /* compile deluxemaps */
        0,                                      /* deluxemaps default mode */
+       512,                /* minimap size */
+       1.0f,               /* minimap sharpener */
+       0.0f,               /* minimap border */
+       "%s.tga",           /* minimap name format */
        "IBSP",                         /* bsp file prefix */
        47,                                     /* bsp file version */
        qfalse,                         /* cod-style lump len/ofs order */
index fafa7084b998001bc558223522004d77baafe202..ac11c79249614576cfb7eec8ab9833c4df074af8 100644 (file)
@@ -149,6 +149,10 @@ game_t struct
        qfalse,                         /* patch casting enabled */
        qfalse,                         /* compile deluxemaps */
        0,                                      /* deluxemaps default mode */
+       512,                /* minimap size */
+       1.0f,               /* minimap sharpener */
+       0.0f,               /* minimap border */
+       "%s.tga",           /* minimap name format */
        "RBSP",                                 /* bsp file prefix */
        1,                                              /* bsp file version */
        qfalse,                                 /* cod-style lump len/ofs order */
index 2ab4205e921a308b44251086eb44c01c4e97a027..caa13b50be282f58ada7e0f983a95579a1841d10 100644 (file)
@@ -122,6 +122,10 @@ game_t struct
        qfalse,                         /* patch casting enabled */
        qtrue,                          /* compile deluxemaps */
        0,                                      /* deluxemaps default mode */
+       512,                /* minimap size */
+       1.0f,               /* minimap sharpener */
+       0.0f,               /* minimap border */
+       "%s.tga",           /* minimap name format */
        "IBSP",                         /* bsp file prefix */
        46,                                     /* bsp file version */
        qfalse,                         /* cod-style lump len/ofs order */
index d37e71273b42ba105949044969ef6069b0187cea..642caf8fc9adbbac2ea40c9fca7766ede8a6f7d3 100644 (file)
@@ -80,6 +80,10 @@ game_t struct
        qfalse,                         /* patch casting enabled */
        qfalse,                         /* compile deluxemaps */
        0,                                      /* deluxemaps default mode */
+       512,                /* minimap size */
+       1.0f,               /* minimap sharpener */
+       0.0f,               /* minimap border */
+       "%s.tga",           /* minimap name format */
        "IBSP",                         /* bsp file prefix */
        46,                                     /* bsp file version */
        qfalse,                         /* cod-style lump len/ofs order */
index a78bdc1a0641419fade88e21e27c1f87df8a889c..533246590489eef7cd281991a1c11cad2b77dbfa 100644 (file)
@@ -139,6 +139,10 @@ game_t struct
        qfalse,                         /* patch casting enabled */
        qfalse,                         /* compile deluxemaps */
        0,                                      /* deluxemaps default mode */
+       512,                /* minimap size */
+       1.0f,               /* minimap sharpener */
+       0.0f,               /* minimap border */
+       "%s.tga",           /* minimap name format */
        "IBSP",                         /* bsp file prefix */
        46,                                     /* bsp file version */
        qfalse,                         /* cod-style lump len/ofs order */
index 8c927d88d5c482e61a2de21aad2a3ee6f4b390b6..20255946fd255d28d86b66977ff75a1b1658302f 100644 (file)
@@ -76,6 +76,10 @@ game_t struct
        qfalse,                         /* patch casting enabled */
        qfalse,                         /* compile deluxemaps */
        0,                                      /* deluxemaps default mode */
+       512,                /* minimap size */
+       1.0f,               /* minimap sharpener */
+       0.0f,               /* minimap border */
+       "%s.tga",           /* minimap name format */
        "IBSP",                         /* bsp file prefix */
        46,                                     /* bsp file version */
        qfalse,                         /* cod-style lump len/ofs order */
index ab89ea9bfbd3169e5dc60063aeb51f07b67e1f86..9d56d89582ea948f6a7c87d6a7267a384a925954 100644 (file)
@@ -338,9 +338,8 @@ determines solid non-sky brushes in the world
 
 void MiniMapSetupBrushes( void )
 {
-       int                             i, j, b, compileFlags;
+       int                             i, b, compileFlags;
        bspBrush_t              *brush;
-       bspBrushSide_t  *side;
        bspShader_t             *shader;
        shaderInfo_t    *si;
        
@@ -434,7 +433,7 @@ qboolean MiniMapEvaluateSampleOffsets(int *bestj, int *bestk, float *bestval)
 void MiniMapMakeSampleOffsets()
 {
        int i, j, k, jj, kk;
-       float val, valj, valk, dx, dy, sx, sy, rx, ry;
+       float val, valj, valk, sx, sy, rx, ry;
 
        Sys_Printf( "Generating good sample offsets (this may take a while)...\n" );
 
@@ -501,12 +500,34 @@ void MiniMapMakeSampleOffsets()
        }
 }
 
+void MergeRelativePath(char *out, const char *absolute, const char *relative)
+{
+       const char *endpos = absolute + strlen(absolute);
+       while(endpos != absolute && (endpos[-1] == '/' || endpos[-1] == '\\'))
+               --endpos;
+       while(relative[0] == '.' && relative[1] == '.' && (relative[2] == '/' || relative[2] == '\\'))
+       {
+               relative += 3;
+               while(endpos != absolute)
+               {
+                       --endpos;
+                       if(*endpos == '/' || *endpos == '\\')
+                               break;
+               }
+               while(endpos != absolute && (endpos[-1] == '/' || endpos[-1] == '\\'))
+                       --endpos;
+       }
+       memcpy(out, absolute, endpos - absolute);
+       out[endpos - absolute] = '/';
+       strcpy(out + (endpos - absolute + 1), relative);
+}
+
 int MiniMapBSPMain( int argc, char **argv )
 {
        char minimapFilename[1024];
        char basename[1024];
        char path[1024];
-       char parentpath[1024];
+       char relativeMinimapFilename[1024];
        float minimapSharpen;
        float border;
        byte *data3b, *p;
@@ -534,12 +555,14 @@ int MiniMapBSPMain( int argc, char **argv )
        minimap.model = &bspModels[0];
        VectorCopy(minimap.model->mins, mins);
        VectorCopy(minimap.model->maxs, maxs);
+
        *minimapFilename = 0;
-       minimapSharpen = 1;
-       minimap.width = minimap.height = 512;
+       minimapSharpen = game->miniMapSharpen;
+       minimap.width = minimap.height = game->miniMapSize;
+       border = game->miniMapBorder;
+
        minimap.samples = 1;
        minimap.sample_offsets = NULL;
-       border = 1/66.0; /* good default for Nexuiz */
 
        /* process arguments */
        for( i = 1; i < (argc - 1); i++ )
@@ -606,12 +629,8 @@ int MiniMapBSPMain( int argc, char **argv )
        {
                ExtractFileBase(source, basename);
                ExtractFilePath(source, path);
-               if(*path)
-                       path[strlen(path)-1] = 0;
-               ExtractFilePath(path, parentpath);
-               sprintf(minimapFilename, "%sgfx", parentpath);
-               Q_mkdir(minimapFilename);
-               sprintf(minimapFilename, "%sgfx/%s_mini.tga", parentpath, basename);
+               sprintf(relativeMinimapFilename, game->miniMapNameFormat, basename);
+               MergeRelativePath(minimapFilename, path, relativeMinimapFilename);
                Sys_Printf("Output file name automatically set to %s\n", minimapFilename);
        }
 
index f78f45f2ae093fab018e538cdfddfe400ef5e242..3756b2e568fd0b9104be43cbbd007fa35fc3d1e1 100644 (file)
@@ -561,6 +561,10 @@ typedef struct game_s
        qboolean                        patchShadows;                                   /* patch casting enabled */
        qboolean                        deluxeMap;                                              /* compile deluxemaps */
        int                                     deluxeMode;                                             /* deluxemap mode (0 - modelspace, 1 - tangentspace with renormalization, 2 - tangentspace without renormalization) */
+       int                 miniMapSize;                    /* minimap size */
+       float               miniMapSharpen;                 /* minimap sharpening coefficient */
+       float               miniMapBorder;                  /* minimap border amount */
+       char                *miniMapNameFormat;             /* minimap name format */
        char                            *bspIdent;                                              /* 4-letter bsp file prefix */
        int                                     bspVersion;                                             /* bsp version to use */
        qboolean                        lumpSwap;                                               /* cod-style len/ofs order */