New shotty sources
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6919 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
@@ -88,6 +88,88 @@ VARP(hideconsole, 0, 0, 1);
|
||||
VARP(hidespecthud, 0, 0, 1);
|
||||
VAR(showmap, 0, 0, 1);
|
||||
|
||||
|
||||
//shotty::
|
||||
//VAR(showsgpat, 0, 0, 1);
|
||||
|
||||
void drawsgpat(int w, int h)
|
||||
{
|
||||
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
|
||||
glDisable(GL_TEXTURE_2D);
|
||||
glColor3ub(0, 0, 0);
|
||||
float sz = min(VIRTW, VIRTH),
|
||||
x1 = VIRTW/2 - sz/2,
|
||||
x2 = VIRTW/2 + sz/2,
|
||||
y1 = VIRTH/2 - sz/2,
|
||||
y2 = VIRTH/2 + sz/2,
|
||||
border = (512 - 64*2)/512.0f;
|
||||
glBegin(GL_TRIANGLE_FAN);
|
||||
glVertex2f(x1 + 0.5f*sz, y1 + 0.5f*sz);
|
||||
int rgbcv = 0;
|
||||
loopi(8+1)
|
||||
{
|
||||
/* if((i%3)==0) { glColor3ub(rgbcv,rgbcv,rgbcv); rgbcv += 4; //rgbcv -= 255/(8+1); }*/
|
||||
if(i%2) glColor3ub(64,64,64); else glColor3ub(32,32,32);
|
||||
float c = 0.5f*(1 + border*cosf(i*2*M_PI/8.0f)), s = 0.5f*(1 + border*sinf(i*2*M_PI/8.0f));
|
||||
glVertex2f(x1 + c*sz, y1 + s*sz);
|
||||
}
|
||||
glColor3ub(255,255,255);
|
||||
glEnd();
|
||||
|
||||
glDisable(GL_BLEND);
|
||||
|
||||
rgbcv = 32;
|
||||
glBegin(GL_TRIANGLE_STRIP);
|
||||
loopi(8+1)
|
||||
{
|
||||
/* if((i%3)==0) { glColor3ub(rgbcv,rgbcv,rgbcv); //,128); rgbcv += 8; //rgbcv -= 255/(8+1); }*/
|
||||
if(i%2) glColor3ub(16,16,16); else glColor3ub(32,32,32);
|
||||
float c = 0.5f*(1 + border*cosf(i*2*M_PI/8.0f)), s = 0.5f*(1 + border*sinf(i*2*M_PI/8.0f));
|
||||
glVertex2f(x1 + c*sz, y1 + s*sz);
|
||||
c = c < 0.4f ? 0 : (c > 0.6f ? 1 : 0.5f);
|
||||
s = s < 0.4f ? 0 : (s > 0.6f ? 1 : 0.5f);
|
||||
glVertex2f(x1 + c*sz, y1 + s*sz);
|
||||
}
|
||||
glColor3ub(255,255,255);
|
||||
glEnd();
|
||||
|
||||
glEnable(GL_TEXTURE_2D);
|
||||
static Texture *pattex = NULL;
|
||||
if(!pattex) pattex = textureload("packages/misc/sgpat.png", 4);
|
||||
loopk(3)
|
||||
{
|
||||
switch(k)
|
||||
{
|
||||
case 0: glColor3ub( 32, 250, 250); break; // center
|
||||
case 1: glColor3ub( 250, 64, 64); break; // middle
|
||||
case 2: glColor3ub( 250, 250, 64); break; // outer
|
||||
default: glColor3ub( 255, 255, 255); break;
|
||||
}
|
||||
extern sgray pat[SGRAYS*3];
|
||||
int j = k * SGRAYS;
|
||||
loopi(SGRAYS)
|
||||
{
|
||||
if(pattex)
|
||||
{
|
||||
vec p = pat[j+i].rv;
|
||||
int ppx = VIRTW/2 + p.x*(sz/2);
|
||||
int ppy = VIRTH/2 + p.y*(sz/2);
|
||||
drawicon(pattex, ppx, ppy, 16, 1, 1, 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
glEnable(GL_BLEND);
|
||||
/*
|
||||
// 2011may31: dmg/hits output comes upon each shot, let the pattern be shown "pure"
|
||||
extern int lastsgs_hits;
|
||||
extern int lastsgs_dmgt;
|
||||
//draw_textf("H: %d DMG: %d", 8, 32, lastsgs_hits, lastsgs_dmgt);
|
||||
defformatstring(t2show4hitdmg)("H: %d DMG: %d", lastsgs_hits, lastsgs_dmgt);
|
||||
draw_text(t2show4hitdmg, VIRTW/2-text_width(t2show4hitdmg), VIRTH/2-3*FONTH/4);
|
||||
*/
|
||||
}
|
||||
//::shotty
|
||||
|
||||
void drawscope(bool preload)
|
||||
{
|
||||
static Texture *scopetex = NULL;
|
||||
@@ -777,6 +859,7 @@ void gl_drawhud(int w, int h, int curfps, int nquads, int curvert, bool underwat
|
||||
players.inrange(player1->followplayercn) && players[player1->followplayercn]);
|
||||
|
||||
if(/*!menu &&*/ (!hideradar || showmap)) drawradar(p, w, h);
|
||||
//if(showsgpat) drawsgpat(w,h); // shotty
|
||||
if(!editmode)
|
||||
{
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
|
||||
Reference in New Issue
Block a user