less ugly mapdims
replaced the mapdims array with a struct with properly identified members also reduced the calclight postfilter to actually used map areas
This commit is contained in:
+13
-14
@@ -534,15 +534,14 @@ void drawradar_showmap(playerent *p, int w, int h)
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
glDisable(GL_BLEND);
|
||||
|
||||
float gdim = max(mapdims[4], mapdims[5]); //no border
|
||||
float coordtrans = (minimapviewsize)/(gdim);
|
||||
|
||||
float offd = fabs(float(mapdims[5])-float(mapdims[4])) /2.0f;
|
||||
float gdim = max(mapdims.xspan, mapdims.yspan); //no border
|
||||
float offd = fabs((mapdims.yspan - mapdims.xspan) / 2.0f);
|
||||
if(!gdim) { gdim = ssize/2.0f; offd = 0; }
|
||||
float offx = gdim==mapdims[5] ? offd : 0;
|
||||
float offy = gdim==mapdims[4] ? offd : 0;
|
||||
float coordtrans = minimapviewsize / gdim;
|
||||
float offx = gdim == mapdims.yspan ? offd : 0;
|
||||
float offy = gdim == mapdims.xspan ? offd : 0;
|
||||
|
||||
vec mdd = vec(mapdims[0]-offx, mapdims[1]-offy, 0);
|
||||
vec mdd = vec(mapdims.x1 - offx, mapdims.y1 - offy, 0);
|
||||
vec cod(offx, offy, 0);
|
||||
vec ppv = vec(p->o).sub(mdd).mul(coordtrans);
|
||||
|
||||
@@ -600,18 +599,18 @@ void drawradar_showmap(playerent *p, int w, int h)
|
||||
void drawradar_vicinity(playerent *p, int w, int h)
|
||||
{
|
||||
extern GLuint minimaptex;
|
||||
int gdim = max(mapdims[4], mapdims[5]);
|
||||
int gdim = max(mapdims.xspan, mapdims.yspan);
|
||||
float radarviewsize = min(VIRTW,VIRTH)/5;
|
||||
float halfviewsize = radarviewsize/2.0f;
|
||||
float iconsize = radarentsize/0.4f;
|
||||
float scaleh = radarheight/(2.0f*gdim);
|
||||
float scaled = radarviewsize/float(radarheight);
|
||||
float offd = fabs((mapdims[5]-mapdims[4]) /2.0f);
|
||||
if(!gdim) { gdim = ssize/2; offd = 0; }
|
||||
float offx = gdim==mapdims[5]?offd:0;
|
||||
float offy = gdim==mapdims[4]?offd:0;
|
||||
vec rtr = vec(mapdims[0]-offx, mapdims[1]-offy, 0);
|
||||
vec rsd = vec(mapdims[0]+mapdims[4]/2, mapdims[1]+mapdims[5]/2, 0);
|
||||
float offd = fabs((mapdims.yspan - mapdims.xspan) / 2.0f);
|
||||
if(gdim < 1) { gdim = ssize/2; offd = 0; }
|
||||
float offx = gdim == mapdims.yspan ? offd : 0;
|
||||
float offy = gdim==mapdims.xspan ? offd : 0;
|
||||
vec rtr = vec(mapdims.x1 - offx, mapdims.y1 - offy, 0);
|
||||
vec rsd = vec(mapdims.xm, mapdims.ym, 0);
|
||||
float d2s = radarheight/2.0f;
|
||||
glColor3f(1.0f, 1.0f, 1.0f);
|
||||
glPushMatrix();
|
||||
|
||||
Reference in New Issue
Block a user