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
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
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 */
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 */
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 */
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 */
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 */
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
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 */
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 */
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 */
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 */
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 */
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 */
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 */
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 */
void MiniMapSetupBrushes( void )
{
- int i, j, b, compileFlags;
+ int i, b, compileFlags;
bspBrush_t *brush;
- bspBrushSide_t *side;
bspShader_t *shader;
shaderInfo_t *si;
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" );
}
}
+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;
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++ )
{
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);
}
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 */