summaryrefslogtreecommitdiff
path: root/src/graphics.c
diff options
context:
space:
mode:
authorSavely Skresanov <savask@yandex.ru>2012-06-02 14:53:38 (GMT)
committer Savely Skresanov <savask@yandex.ru>2012-06-02 14:59:25 (GMT)
commit7f5408f196002476c4765f1cae833e1441e4b276 (patch)
tree4c5472506662dcb46fd2344c0129443a3a61c3aa /src/graphics.c
parent939265a77de93fd6e9b5136ad948fc16ce077918 (diff)
downloadpowder-7f5408f196002476c4765f1cae833e1441e4b276.zip
powder-7f5408f196002476c4765f1cae833e1441e4b276.tar.gz
Moved soap and stick men graphics things to special functions.
Diffstat (limited to 'src/graphics.c')
-rw-r--r--src/graphics.c132
1 files changed, 2 insertions, 130 deletions
diff --git a/src/graphics.c b/src/graphics.c
index 8b9e02e..c82a20a 100644
--- a/src/graphics.c
+++ b/src/graphics.c
@@ -1883,7 +1883,7 @@ void render_parts(pixel *vid)
if (ptypes[t].graphics_func)
{
#endif
- if ((*(ptypes[t].graphics_func))(&(parts[i]), nx, ny, &pixel_mode, &cola, &colr, &colg, &colb, &firea, &firer, &fireg, &fireb)) //That's a lot of args, a struct might be better
+ if ((*(ptypes[t].graphics_func))(&(parts[i]), nx, ny, &pixel_mode, &cola, &colr, &colg, &colb, &firea, &firer, &fireg, &fireb, vid)) //That's a lot of args, a struct might be better
{
graphicscache[t].isready = 1;
graphicscache[t].pixel_mode = pixel_mode;
@@ -1899,7 +1899,7 @@ void render_parts(pixel *vid)
}
else
{
- if(graphics_DEFAULT(&(parts[i]), nx, ny, &pixel_mode, &cola, &colr, &colg, &colb, &firea, &firer, &fireg, &fireb))
+ if(graphics_DEFAULT(&(parts[i]), nx, ny, &pixel_mode, &cola, &colr, &colg, &colb, &firea, &firer, &fireg, &fireb, vid))
{
graphicscache[t].isready = 1;
graphicscache[t].pixel_mode = pixel_mode;
@@ -2016,134 +2016,6 @@ void render_parts(pixel *vid)
#endif
//Pixel rendering
- if (t==PT_SOAP)
- {
- if ((parts[i].ctype&7) == 7)
- draw_line(vid, nx, ny, (int)(parts[parts[i].tmp].x+0.5f), (int)(parts[parts[i].tmp].y+0.5f), colr, colg, colb, XRES+BARSIZE);
- }
- if(pixel_mode & PSPEC_STICKMAN)
- {
- char buff[20]; //Buffer for HP
- int s;
- int legr, legg, legb;
- playerst *cplayer;
- if(t==PT_STKM)
- cplayer = &player;
- else if(t==PT_STKM2)
- cplayer = &player2;
- else if(t==PT_FIGH)
- 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);
- glBegin(GL_LINE_STRIP);
- if(t==PT_FIGH)
- {
- glVertex2f(fnx, fny+2);
- glVertex2f(fnx+2, fny);
- glVertex2f(fnx, fny-2);
- glVertex2f(fnx-2, fny);
- glVertex2f(fnx, fny+2);
- }
- else
- {
- glVertex2f(fnx-2, fny-2);
- glVertex2f(fnx+2, fny-2);
- glVertex2f(fnx+2, fny+2);
- glVertex2f(fnx-2, fny+2);
- glVertex2f(fnx-2, fny-2);
- }
- 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]);
-
- glVertex2f(cplayer->legs[0], cplayer->legs[1]);
- glVertex2f(cplayer->legs[4], cplayer->legs[5]);
-
- glVertex2f(nx, ny+3);
- glVertex2f(cplayer->legs[8], cplayer->legs[9]);
-
- glVertex2f(cplayer->legs[8], cplayer->legs[9]);
- glVertex2f(cplayer->legs[12], cplayer->legs[13]);
- glEnd();
-#else
- s = XRES+BARSIZE;
-
- if (t==PT_STKM2)
- {
- legr = 100;
- legg = 100;
- legb = 255;
- }
- else
- {
- legr = 255;
- legg = 255;
- legb = 255;
- }
-
- if (colour_mode==COLOUR_HEAT)
- {
- legr = colr;
- legg = colg;
- legb = colb;
- }
-
- //head
- if(t==PT_FIGH)
- {
- draw_line(vid , nx, ny+2, nx+2, ny, colr, colg, colb, s);
- draw_line(vid , nx+2, ny, nx, ny-2, colr, colg, colb, s);
- draw_line(vid , nx, ny-2, nx-2, ny, colr, colg, colb, s);
- draw_line(vid , nx-2, ny, nx, ny+2, colr, colg, colb, s);
- }
- else
- {
- draw_line(vid , nx-2, ny+2, nx+2, ny+2, colr, colg, colb, s);
- draw_line(vid , nx-2, ny-2, nx+2, ny-2, colr, colg, colb, s);
- draw_line(vid , nx-2, ny-2, nx-2, ny+2, colr, colg, colb, s);
- draw_line(vid , nx+2, ny-2, nx+2, ny+2, colr, colg, colb, s);
- }
- //legs
- draw_line(vid , nx, ny+3, cplayer->legs[0], cplayer->legs[1], legr, legg, legb, s);
- draw_line(vid , cplayer->legs[0], cplayer->legs[1], cplayer->legs[4], cplayer->legs[5], legr, legg, legb, s);
- draw_line(vid , nx, ny+3, cplayer->legs[8], cplayer->legs[9], legr, legg, legb, s);
- draw_line(vid , cplayer->legs[8], cplayer->legs[9], cplayer->legs[12], cplayer->legs[13], legr, legg, legb, s);
-#endif
- }
#ifdef OGLR
if((display_mode & DISPLAY_EFFE) && (fabs(fnx-flx)>1.5f || fabs(fny-fly)>1.5f))
{