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
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
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 */
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 */
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 */
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 */
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 */
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
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 */
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 */
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 */
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 */
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 */
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 */
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 */
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 */
}
}
-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);
// 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 */
int x, y;
int i;
vec3_t mins, maxs;
+ qboolean keepaspect;
/* arg checking */
if( argc < 2 )
minimapSharpen = game->miniMapSharpen;
minimap.width = minimap.height = game->miniMapSize;
border = game->miniMapBorder;
+ keepaspect = game->miniMapKeepAspect;
minimap.samples = 1;
minimap.sample_offsets = NULL;
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]);
}
}
- MiniMapMakeMinsMaxs(mins, maxs, border);
+ MiniMapMakeMinsMaxs(mins, maxs, border, keepaspect);
if(!*minimapFilename)
{
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 */