diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2011-11-21 00:48:53 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2011-11-21 00:48:53 (GMT) |
| commit | 4c2f8d56f148b0a02d28f061f835f39efe4273e4 (patch) | |
| tree | 17e4229d4c8c57986813246e9f74a7d622b9a630 /src | |
| parent | 876c861c425ad424ffc5af4bf39b2a3441b50f9a (diff) | |
| parent | 92e72e004bec1794378f47be4d81b924a29111f9 (diff) | |
| download | powder-4c2f8d56f148b0a02d28f061f835f39efe4273e4.zip powder-4c2f8d56f148b0a02d28f061f835f39efe4273e4.tar.gz | |
Merge branch 'master' of github.com:FacialTurd/The-Powder-Toy
Diffstat (limited to 'src')
| -rw-r--r-- | src/graphics.c | 54 |
1 files changed, 32 insertions, 22 deletions
diff --git a/src/graphics.c b/src/graphics.c index 4142815..c036d89 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -1939,9 +1939,30 @@ void render_parts(pixel *vid) cplayer = &fighters[(unsigned char)parts[i].tmp]; else continue; + + if (mousex>(nx-3) && mousex<(nx+3) && mousey<(ny+3) && mousey>(ny-3)) //If mous is in the head + { + sprintf(buff, "%3d", parts[i].life); //Show HP + drawtext(vid, mousex-8-2*(parts[i].life<100)-2*(parts[i].life<10), mousey-12, buff, 255, 255, 255, 255); + } + + if (colour_mode!=COLOUR_HEAT) + { + if (cplayer->elem<PT_NUM) + { + colr = PIXR(ptypes[cplayer->elem].pcolors); + colg = PIXG(ptypes[cplayer->elem].pcolors); + colb = PIXB(ptypes[cplayer->elem].pcolors); + } + else + { + colr = 0x80; + colg = 0x80; + colb = 0xFF; + } + } #ifdef OGLR glColor4f(((float)colr)/255.0f, ((float)colg)/255.0f, ((float)colb)/255.0f, 1.0f); - glEnable(GL_LINE_SMOOTH); glBegin(GL_LINE_STRIP); if(t==PT_FIGH) { @@ -1961,6 +1982,15 @@ void render_parts(pixel *vid) } glEnd(); glBegin(GL_LINES); + + if (colour_mode!=COLOUR_HEAT) + { + if (t==PT_STKM2) + glColor4f(100.0f/255.0f, 100.0f/255.0f, 1.0f, 1.0f); + else + glColor4f(1.0f, 1.0f, 1.0f, 1.0f); + } + glVertex2f(nx, ny+3); glVertex2f(cplayer->legs[0], cplayer->legs[1]); @@ -1973,27 +2003,7 @@ void render_parts(pixel *vid) glVertex2f(cplayer->legs[8], cplayer->legs[9]); glVertex2f(cplayer->legs[12], cplayer->legs[13]); glEnd(); - glDisable(GL_LINE_SMOOTH); #else - - if (mousex>(nx-3) && mousex<(nx+3) && mousey<(ny+3) && mousey>(ny-3)) //If mous is in the head - { - sprintf(buff, "%3d", parts[i].life); //Show HP - drawtext(vid, mousex-8-2*(parts[i].life<100)-2*(parts[i].life<10), mousey-12, buff, 255, 255, 255, 255); - } - - if (cplayer->elem<PT_NUM) - { - colr = PIXR(ptypes[cplayer->elem].pcolors); - colg = PIXG(ptypes[cplayer->elem].pcolors); - colb = PIXB(ptypes[cplayer->elem].pcolors); - } - else - { - colr = 0x80; - colg = 0x80; - colb = 0xFF; - } s = XRES+BARSIZE; if (t==PT_STKM2) @@ -2009,7 +2019,7 @@ void render_parts(pixel *vid) legb = 255; } - if (colour_mode) + if (colour_mode==COLOUR_HEAT) { legr = colr; legg = colg; |
