*** empty log message ***

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@913 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
Lee Salzman
2007-04-04 01:54:18 +00:00
parent c508ab9d58
commit 5c9c9fe6c7
6 changed files with 23 additions and 8 deletions

Before

Width:  |  Height:  |  Size: 39 KiB

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.0 KiB

After

Width:  |  Height:  |  Size: 4.5 KiB

+1 -1
View File
@@ -48,7 +48,7 @@ extern void box(block &b, float z1, float z2, float z3, float z4);
extern void dot(int x, int y, float z);
extern void linestyle(float width, int r, int g, int b);
extern void blendbox(int x1, int y1, int x2, int y2, bool border, int tex = -1);
extern void quad(GLuint tex, float x, float y, float s, float tx, float ty, float ts);
extern void quad(GLuint tex, float x, float y, float s, float tx, float ty, float tsx, float tsy = 0);
extern void circle(GLuint tex, float x, float y, float r, float tx, float ty, float tr, int subdiv = 32);
extern void gl_drawframe(int w, int h, float changelod, float curfps);
extern void clearminimap();
+6 -5
View File
@@ -77,14 +77,15 @@ void box(block &b, float z1, float z2, float z3, float z4)
xtraverts += 4;
}
void quad(GLuint tex, float x, float y, float s, float tx, float ty, float ts)
void quad(GLuint tex, float x, float y, float s, float tx, float ty, float tsx, float tsy)
{
if(!tsy) tsy = tsx;
glBindTexture(GL_TEXTURE_2D, tex);
glBegin(GL_QUADS);
glTexCoord2f(tx, ty); glVertex2f(x, y);
glTexCoord2f(tx+ts, ty); glVertex2f(x+s, y);
glTexCoord2f(tx+ts, ty+ts); glVertex2f(x+s, y+s);
glTexCoord2f(tx, ty+ts); glVertex2f(x, y+s);
glTexCoord2f(tx, ty); glVertex2f(x, y);
glTexCoord2f(tx+tsx, ty); glVertex2f(x+s, y);
glTexCoord2f(tx+tsx, ty+tsy); glVertex2f(x+s, y+s);
glTexCoord2f(tx, ty+tsy); glVertex2f(x, y+s);
glEnd();
xtraverts += 4;
}
+15 -1
View File
@@ -145,6 +145,8 @@ bool insideradar(const vec &centerpos, float radius, const vec &o)
return o.distxy(centerpos)<=radius;
}
VAR(foop, 0, 10, 1000);
void drawradar(int w, int h)
{
vec center = showmap ? vec(ssize/2, ssize/2, 0) : player1->o;
@@ -155,13 +157,14 @@ void drawradar(int w, int h)
float radarsize = worldsize/res*radarviewsize;
float iconsize = radarentsize/(float)res*radarviewsize;
float coordtrans = radarsize/worldsize;
float overlaysize = radarviewsize*4.0f/3.25f;
glPushMatrix();
if(showmap) glTranslatef(VIRTW/2-radarviewsize/2, 0, 0);
else
{
glTranslatef(VIRTW-radarviewsize-10+radarviewsize/2, 10+radarviewsize/2, 0);
glTranslatef(VIRTW-radarviewsize-(overlaysize-radarviewsize)/2-10+radarviewsize/2, 10+(overlaysize-radarviewsize)/2+radarviewsize/2, 0);
glRotatef(-camera1->yaw, 0, 0, 1);
glTranslatef(-radarviewsize/2, -radarviewsize/2, 0);
}
@@ -207,6 +210,17 @@ void drawradar(int w, int h)
glEnable(GL_BLEND);
glPopMatrix();
if(!showmap)
{
glDisable(GL_CULL_FACE);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
glColor3f(1, 1, 1);
static Texture *overlaytex = NULL;
if(!overlaytex) overlaytex = textureload("packages/misc/radaroverlay.png", 3);
quad(overlaytex->id, VIRTW-overlaysize-10, 10, overlaysize, 0.5f*team_int(player1->team), 0, 0.5f, 1.0f);
glEnable(GL_CULL_FACE);
}
}
void gl_drawhud(int w, int h, int curfps, int nquads, int curvert, bool underwater)
+1 -1
View File
@@ -181,7 +181,7 @@ void draw_textf(const char *fstr, int left, int top, ...)
void draw_text(const char *str, int left, int top)
{
static Texture *charstex = NULL;
if(!charstex) charstex = textureload("packages/misc/newchars.png");
if(!charstex) charstex = textureload("packages/misc/chars.png");
glBlendFunc(GL_ONE, GL_ONE);
glBindTexture(GL_TEXTURE_2D, charstex->id);