From: divverent Date: Sun, 26 Apr 2009 09:42:48 +0000 (+0000) Subject: be compatible to nexuiz for minimaps :P X-Git-Tag: svn-r421~90 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=633f825b613b5eef0a3cda0732481efc7c8c469f;p=xonotic%2Fnetradiant.git be compatible to nexuiz for minimaps :P git-svn-id: svn://svn.icculus.org/netradiant/trunk@330 61c419a2-8eb2-4b30-bcec-8cead039b335 --- diff --git a/tools/quake3/q3map2/main.c b/tools/quake3/q3map2/main.c index 4b8f5f4e..1170a46d 100644 --- a/tools/quake3/q3map2/main.c +++ b/tools/quake3/q3map2/main.c @@ -253,6 +253,37 @@ static void SharpenMiniMapRunner(int y) } } +void MiniMapMakeMinsMaxs() +{ + vec3_t mins, maxs, extend; + VectorCopy(minimap.model->mins, mins); + VectorCopy(minimap.model->maxs, maxs); + 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; + } + + VectorSubtract(maxs, mins, extend); + VectorScale(extend, 1.0 / 64.0, extend); + + VectorSubtract(mins, extend, mins); + VectorAdd(maxs, extend, maxs); + + VectorCopy(mins, minimap.mins); + VectorSubtract(maxs, mins, minimap.size); + + // 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]); +} + int MiniMapBSPMain( int argc, char **argv ) { char minimapFilename[1024]; @@ -294,8 +325,7 @@ int MiniMapBSPMain( int argc, char **argv ) LoadBSPFile( source ); minimap.model = &bspModels[0]; - VectorCopy(minimap.model->mins, minimap.mins); - VectorSubtract(minimap.model->maxs, minimap.model->mins, minimap.size); + MiniMapMakeMinsMaxs(); SetupBrushes();