minimap precision improvements
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@5682 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
@@ -752,9 +752,9 @@ void drawminimap(int w, int h)
|
||||
camera1->o.z = 96 * dd;
|
||||
camera1->pitch = -90;
|
||||
camera1->yaw = 0;
|
||||
int orthd = 4 /*+ 2*dd*/ + gdim/2; // +2-4 for clean border if map goes even to the edge. - ac_iceroad still has a bug though @ "2 + 2*dd +" - "4 +" seems better.
|
||||
int orthd = 2 /*+ 2*dd*/ + gdim/2; // +2-4 for clean border if map goes even to the edge. - ac_iceroad still has a bug though @ "2 + 2*dd +" - "4 +" seems better.
|
||||
// this does not avoid possible data corruption on windowed runs :-/ - the issue seems to lie with the window lying outside the desktop edges - at least that was the case for me (flowtron)
|
||||
glViewport(0, 0, size, size); // !not wsize here
|
||||
glViewport(0, 0, size-(size/orthd), size-(size/orthd)); // !not wsize here
|
||||
glClearDepth(0.0);
|
||||
glClearColor(0, 0, 0, 0);//1);
|
||||
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT); // stencil added 2010jul22
|
||||
|
||||
@@ -405,7 +405,9 @@ void drawradar(playerent *p, int w, int h)
|
||||
float radarviewsize = showmap?3*min(VIRTW,VIRTH)/4:min(VIRTW,VIRTH)/5;
|
||||
float halfviewsize = radarviewsize/2.0f;
|
||||
float iconsize = (showmap?radarentsize/4:radarentsize)/(float)gdim*radarviewsize;
|
||||
float coordtrans = showmap?radarviewsize/gdim:1;
|
||||
int orthd = 2 + (gdim-2)/2;
|
||||
int displace = radarviewsize/orthd;
|
||||
float coordtrans = showmap?(radarviewsize-displace)/(gdim+3):1;
|
||||
int offd = (abs(mapdims[5]-mapdims[4])/2)*coordtrans;
|
||||
if(!gdim) { gdim = ssize/2; offd = 0; }
|
||||
int offx = gdim==mapdims[5]?offd:0;
|
||||
@@ -443,7 +445,7 @@ void drawradar(playerent *p, int w, int h)
|
||||
vec mdd(mapdims[0], mapdims[1], 0);
|
||||
vec cod(offx, offy, 0);
|
||||
vec ppv = vec(p->o).sub(mdd).mul(coordtrans).add(cod);
|
||||
drawradarent(ppv.x, ppv.y, p->yaw, p->state==CS_ALIVE ? (isattacking(p) ? 2 : 0) : 1, 2, iconsize, isattacking(p), "%s", colorname(p)); // local player
|
||||
drawradarent(ppv.x+displace, ppv.y+displace, p->yaw, p->state==CS_ALIVE ? (isattacking(p) ? 2 : 0) : 1, 2, iconsize, isattacking(p), "%s", colorname(p)); // local player
|
||||
loopv(players) // other players
|
||||
{
|
||||
playerent *pl = players[i];
|
||||
|
||||
Reference in New Issue
Block a user