]> git.xonotic.org Git - xonotic/netradiant.git/commitdiff
allow not keeping aspect
authordivverent <divverent@61c419a2-8eb2-4b30-bcec-8cead039b335>
Mon, 27 Apr 2009 15:03:55 +0000 (15:03 +0000)
committerdivverent <divverent@61c419a2-8eb2-4b30-bcec-8cead039b335>
Mon, 27 Apr 2009 15:03:55 +0000 (15:03 +0000)
git-svn-id: svn://svn.icculus.org/netradiant/trunk@345 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 026b0ba2819e265bccdd3f46f0ad3c42fde45000..ff936f9cd14aaaa1f9d7707e3b7f4d38616e8e99 100644 (file)
@@ -67,6 +67,7 @@ game_t struct
        512,                /* minimap size */\r
        1.0f,               /* minimap sharpener */\r
        0.0f,               /* minimap border */\r
+       qtrue,              /* minimap keep aspect */\r
        "%s.tga",           /* minimap name format */\r
        "IBSP",                         /* bsp file prefix */\r
        46,                                     /* bsp file version */\r
index 86a1909c0f4d5672130683afa0c59ef663cf5280..5671266d0a6636086d0a57949cda1dceb89333a0 100644 (file)
@@ -67,6 +67,7 @@ game_t struct
        512,                /* minimap size */\r
        1.0f,               /* minimap sharpener */\r
        0.0f,               /* minimap border */\r
+       qtrue,              /* minimap keep aspect */\r
        "%s.tga",           /* minimap name format */\r
        "IBSP",                         /* bsp file prefix */\r
        46,                                     /* bsp file version */\r
index 9ee1e33d13e5a8d26a3befe0f72948b98977f3a3..a3b2950c3e4353b20e10e939bd0ea8e13c2e7256 100644 (file)
@@ -126,6 +126,7 @@ game_t struct
        512,                /* minimap size */
        1.0f,               /* minimap sharpener */
        0.0f,               /* minimap border */
+       qtrue,              /* minimap keep aspect */
        "%s.tga",           /* minimap name format */
        "IBSP",                         /* bsp file prefix */
        46,                                     /* bsp file version */
index b876894bd57e13a76615482b2965ddbb6852dac6..e4dbc6bf75cdb82927edcf2492e516263c2f9470 100644 (file)
@@ -161,6 +161,7 @@ game_t struct
        512,                /* minimap size */
        1.0f,               /* minimap sharpener */
        0.0f,               /* minimap border */
+       qtrue,              /* minimap keep aspect */
        "%s.tga",           /* minimap name format */
        "IBSP",                         /* bsp file prefix */
        46,                                     /* bsp file version */
index 4ff04520308b33524e3e5c8c439004cc465bcb0a..69597b2b31c4025ebf140316342b9f4e82971b65 100644 (file)
@@ -80,6 +80,7 @@ game_t struct
        512,                /* minimap size */
        1.0f,               /* minimap sharpener */
        0.0f,               /* minimap border */
+       qtrue,              /* minimap keep aspect */
        "%s.tga",           /* minimap name format */
        "RBSP",                         /* bsp file prefix */
        1,                                      /* bsp file version */
index 338c018c0566832515729d6aed746811288c4f88..15cbf9544499c975c3abc1c761a8c621ea6bd653 100644 (file)
@@ -77,6 +77,7 @@ game_t struct
        512,                /* minimap size */
        1.0f,               /* minimap sharpener */
        0.0f,               /* minimap border */
+       qtrue,              /* minimap keep aspect */
        "%s.tga",           /* minimap name format */
        "RBSP",                         /* bsp file prefix */
        1,                                      /* bsp file version */
index 633b2a526fdb45169325d51a64b2bd3d03337146..70258c440c9caab6bf2550bcda780b93b1c62bb7 100644 (file)
@@ -76,6 +76,7 @@ game_t struct
        512,                /* minimap size */
        1.0f,               /* minimap sharpener */
        1.0f/66.0f,         /* minimap border */
+       qtrue,              /* minimap keep aspect */
        "../gfx/%s_mini.tga", /* minimap name format */
        "IBSP",                         /* bsp file prefix */
        46,                                     /* bsp file version */
index 7fa4412c1ba70aa6329e9a035c5927cb7c781d22..2db39568f964b993fbd7d98526677b8177f80a14 100644 (file)
@@ -67,6 +67,7 @@ game_t struct
        512,                /* minimap size */\r
        1.0f,               /* minimap sharpener */\r
        0.0f,               /* minimap border */\r
+       qtrue,              /* minimap keep aspect */\r
        "%s.tga",           /* minimap name format */\r
        "IBSP",                         /* bsp file prefix */\r
        46,                                     /* bsp file version */\r
index 5fedd571ba7f6407f4cbac9754288247d706f4cb..7ce65bfae9c8f368c6c3c5dec9d0e2adcf2af422 100644 (file)
@@ -126,8 +126,9 @@ game_t struct
        qfalse,                         /* compile deluxemaps */
        0,                                      /* deluxemaps default mode */
        512,                /* minimap size */
-       1.0f,               /* minimap sharpener */
+       0.0f,               /* minimap sharpener */
        0.0f,               /* minimap border */
+       qfalse,             /* minimap keep aspect */
        "%s.tga",           /* minimap name format */
        "FBSP",                         /* bsp file prefix */
        1,                                      /* bsp file version */
index 4097a7e8ece777bb19a9bb4dbd806b814e557a26..2236f12bcded8fd31cf1bf134f40dda6020f4e90 100644 (file)
@@ -125,6 +125,7 @@ game_t struct
        512,                /* minimap size */
        1.0f,               /* minimap sharpener */
        0.0f,               /* minimap border */
+       qtrue,              /* minimap keep aspect */
        "%s.tga",           /* minimap name format */
        "IBSP",                         /* bsp file prefix */
        46,                                     /* bsp file version */
index 91d9ca4b02157be86ae4d45c07580e6eaf931047..34f56717228e8c7e8f73ef35b909c949eeaac0b5 100644 (file)
@@ -77,6 +77,7 @@ game_t struct
        512,                /* minimap size */
        1.0f,               /* minimap sharpener */
        0.0f,               /* minimap border */
+       qtrue,              /* minimap keep aspect */
        "%s.tga",           /* minimap name format */
        "IBSP",                         /* bsp file prefix */
        47,                                     /* bsp file version */
index ac11c79249614576cfb7eec8ab9833c4df074af8..1ef5e479a0a21cd84d61f0f9e40165c50b85ae4f 100644 (file)
@@ -152,6 +152,7 @@ game_t struct
        512,                /* minimap size */
        1.0f,               /* minimap sharpener */
        0.0f,               /* minimap border */
+       qtrue,              /* minimap keep aspect */
        "%s.tga",           /* minimap name format */
        "RBSP",                                 /* bsp file prefix */
        1,                                              /* bsp file version */
index caa13b50be282f58ada7e0f983a95579a1841d10..d76771818d1920057bb4f3625b97f955d64b7708 100644 (file)
@@ -125,6 +125,7 @@ game_t struct
        512,                /* minimap size */
        1.0f,               /* minimap sharpener */
        0.0f,               /* minimap border */
+       qtrue,              /* minimap keep aspect */
        "%s.tga",           /* minimap name format */
        "IBSP",                         /* bsp file prefix */
        46,                                     /* bsp file version */
index 642caf8fc9adbbac2ea40c9fca7766ede8a6f7d3..6543d094725dadde6deb8066a78c749376234830 100644 (file)
@@ -83,6 +83,7 @@ game_t struct
        512,                /* minimap size */
        1.0f,               /* minimap sharpener */
        0.0f,               /* minimap border */
+       qtrue,              /* minimap keep aspect */
        "%s.tga",           /* minimap name format */
        "IBSP",                         /* bsp file prefix */
        46,                                     /* bsp file version */
index 533246590489eef7cd281991a1c11cad2b77dbfa..816994a89b057ce47a7111428530d25cd27a5567 100644 (file)
@@ -142,6 +142,7 @@ game_t struct
        512,                /* minimap size */
        1.0f,               /* minimap sharpener */
        0.0f,               /* minimap border */
+       qtrue,              /* minimap keep aspect */
        "%s.tga",           /* minimap name format */
        "IBSP",                         /* bsp file prefix */
        46,                                     /* bsp file version */
index 20255946fd255d28d86b66977ff75a1b1658302f..d26a173416e885914c1915c0c7d1cfeb1709c813 100644 (file)
@@ -79,6 +79,7 @@ game_t struct
        512,                /* minimap size */
        1.0f,               /* minimap sharpener */
        0.0f,               /* minimap border */
+       qtrue,              /* minimap keep aspect */
        "%s.tga",           /* minimap name format */
        "IBSP",                         /* bsp file prefix */
        46,                                     /* bsp file version */
index 9d56d89582ea948f6a7c87d6a7267a384a925954..45d5ca51423adbde5d2c3e022cf8192d189e7be4 100644 (file)
@@ -293,7 +293,7 @@ static void MiniMapSharpen(int y)
        }
 }
 
-void MiniMapMakeMinsMaxs(vec3_t mins_in, vec3_t maxs_in, float border)
+void MiniMapMakeMinsMaxs(vec3_t mins_in, vec3_t maxs_in, float border, qboolean keepaspect)
 {
        vec3_t mins, maxs, extend;
        VectorCopy(mins_in, mins);
@@ -302,17 +302,19 @@ void MiniMapMakeMinsMaxs(vec3_t mins_in, vec3_t maxs_in, float border)
        // line compatible to nexuiz mapinfo
        Sys_Printf("size %f %f %f %f %f %f\n", mins[0], mins[1], mins[2], maxs[0], maxs[1], maxs[2]);
 
-       VectorSubtract(maxs, mins, extend);
-
-       if(extend[1] > extend[0])
+       if(keepaspect)
        {
-               mins[0] -= (extend[1] - extend[0]) * 0.5;
-               maxs[0] += (extend[1] - extend[0]) * 0.5;
-       }
-       else
-       {
-               mins[1] -= (extend[0] - extend[1]) * 0.5;
-               maxs[1] += (extend[0] - extend[1]) * 0.5;
+               VectorSubtract(maxs, mins, extend);
+               if(extend[1] > extend[0])
+               {
+                       mins[0] -= (extend[1] - extend[0]) * 0.5;
+                       maxs[0] += (extend[1] - extend[0]) * 0.5;
+               }
+               else
+               {
+                       mins[1] -= (extend[0] - extend[1]) * 0.5;
+                       maxs[1] += (extend[0] - extend[1]) * 0.5;
+               }
        }
 
        /* border: amount of black area around the image */
@@ -535,6 +537,7 @@ int MiniMapBSPMain( int argc, char **argv )
        int x, y;
        int i;
        vec3_t mins, maxs;
+       qboolean keepaspect;
 
        /* arg checking */
        if( argc < 2 )
@@ -560,6 +563,7 @@ int MiniMapBSPMain( int argc, char **argv )
        minimapSharpen = game->miniMapSharpen;
        minimap.width = minimap.height = game->miniMapSize;
        border = game->miniMapBorder;
+       keepaspect = game->miniMapKeepAspect;
 
        minimap.samples = 1;
        minimap.sample_offsets = NULL;
@@ -604,6 +608,16 @@ int MiniMapBSPMain( int argc, char **argv )
                        i++;
                        Sys_Printf( "Border set to %f\n", border );
                }
+               else if( !strcmp( argv[ i ],  "-keepaspect" ) )
+               {
+                       keepaspect = qtrue;
+                       Sys_Printf( "Keeping aspect ratio by letterboxing\n", border );
+               }
+               else if( !strcmp( argv[ i ],  "-nokeepaspect" ) )
+               {
+                       keepaspect = qfalse;
+                       Sys_Printf( "Not keeping aspect ratio\n", border );
+               }
                else if( !strcmp( argv[ i ],  "-o" ) )
                {
                        strcpy(minimapFilename, argv[i + 1]);
@@ -623,7 +637,7 @@ int MiniMapBSPMain( int argc, char **argv )
                }
        }
 
-       MiniMapMakeMinsMaxs(mins, maxs, border);
+       MiniMapMakeMinsMaxs(mins, maxs, border, keepaspect);
 
        if(!*minimapFilename)
        {
index 3756b2e568fd0b9104be43cbbd007fa35fc3d1e1..c4c6a4bd1d08e94787077606b9c0d6862ba3da59 100644 (file)
@@ -564,6 +564,7 @@ typedef struct game_s
        int                 miniMapSize;                    /* minimap size */
        float               miniMapSharpen;                 /* minimap sharpening coefficient */
        float               miniMapBorder;                  /* minimap border amount */
+       qboolean            miniMapKeepAspect;              /* minimap keep aspect ratio by letterboxing */
        char                *miniMapNameFormat;             /* minimap name format */
        char                            *bspIdent;                                              /* 4-letter bsp file prefix */
        int                                     bspVersion;                                             /* bsp version to use */