summaryrefslogtreecommitdiff
path: root/src/elements
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-06-17 21:34:17 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-06-17 21:34:17 (GMT)
commit4b073de82a77db344b728434ee9ed18f69a06b4e (patch)
tree17a4f27f3c8f12a10f12d79442bb76e18e7f40ed /src/elements
parent36de2f19f57ff056166ae268404f1f3851ea3077 (diff)
downloadpowder-4b073de82a77db344b728434ee9ed18f69a06b4e.zip
powder-4b073de82a77db344b728434ee9ed18f69a06b4e.tar.gz
Revert "Moved soap and stick men graphics things to special functions."
This reverts commit 7f5408f196002476c4765f1cae833e1441e4b276. Conflicts: includes/powder.h
Diffstat (limited to 'src/elements')
-rw-r--r--src/elements/figh.c4
-rw-r--r--src/elements/newgraphics.c145
-rw-r--r--src/elements/pipe.c4
-rw-r--r--src/elements/stkm.c6
-rw-r--r--src/elements/stkm2.c4
5 files changed, 9 insertions, 154 deletions
diff --git a/src/elements/figh.c b/src/elements/figh.c
index 1b2a5c5..ce00af7 100644
--- a/src/elements/figh.c
+++ b/src/elements/figh.c
@@ -107,6 +107,7 @@ int update_FIGH(UPDATE_FUNC_ARGS)
int graphics_FIGH(GRAPHICS_FUNC_ARGS)
{
playerst * cplayer = &fighters[(unsigned char)cpart->tmp];
+ *pixel_mode = PSPEC_STICKMAN;
if (cplayer->elem<PT_NUM)
{
*colr = PIXR(ptypes[cplayer->elem].pcolors);
@@ -117,6 +118,5 @@ int graphics_FIGH(GRAPHICS_FUNC_ARGS)
{
*colr = *colg = *colb = 255;
}
- graphics_stickmen(GRAPHICS_FUNC_SUBCALL_ARGS);
- return 0;
+ return 1;
}
diff --git a/src/elements/newgraphics.c b/src/elements/newgraphics.c
index 5679b63..946afc8 100644
--- a/src/elements/newgraphics.c
+++ b/src/elements/newgraphics.c
@@ -562,149 +562,4 @@ int graphics_COAL(GRAPHICS_FUNC_ARGS) //Both COAL and Broken Coal
}
return 0;
}
-int graphics_SOAP(GRAPHICS_FUNC_ARGS)
-{
- if (decorations_enable && cpart->dcolour)
- {
- int a = (cpart->dcolour>>24)&0xFF;
- *firer = *colr = (a*((cpart->dcolour>>16)&0xFF) + (255-a)**colr) >> 8;
- *fireg = *colg = (a*((cpart->dcolour>>8)&0xFF) + (255-a)**colg) >> 8;
- *fireb = *colb = (a*((cpart->dcolour)&0xFF) + (255-a)**colb) >> 8;
- }
- if ((cpart->ctype&7) == 7)
- draw_line(vid, nx, ny, (int)(parts[cpart->tmp].x+0.5f), (int)(parts[cpart->tmp].y+0.5f), *colr, *colg, *colb, XRES+BARSIZE);
- return 0;
-}
-int graphics_stickmen(GRAPHICS_FUNC_ARGS)
-{
- char buff[20]; //Buffer for HP
- int s;
- int legr, legg, legb;
- playerst *cplayer;
-
- *pixel_mode = 0;
- switch(cpart->type)
- {
- case PT_STKM:
- cplayer = &player;
- break;
- case PT_STKM2:
- cplayer = &player2;
- break;
- case PT_FIGH:
- cplayer = &fighters[(unsigned char)cpart->tmp];
- break;
- default:
- return 0;
- }
-
- if (mousex>(nx-3) && mousex<(nx+3) && mousey<(ny+3) && mousey>(ny-3)) //If mouse is in the head
- {
- sprintf(buff, "%3d", cpart->life); //Show HP
- drawtext(vid, mousex-8-2*(cpart->life<100)-2*(cpart->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 (cpart->type==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(cpart->type==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
-
- return 0;
-}
diff --git a/src/elements/pipe.c b/src/elements/pipe.c
index 9d7a4b1..aa6e16b 100644
--- a/src/elements/pipe.c
+++ b/src/elements/pipe.c
@@ -292,11 +292,11 @@ int graphics_PIPE(GRAPHICS_FUNC_ARGS)
*colb = PIXR(ptypes[t].pcolors);
if (ptypes[t].graphics_func)
{
- (*(ptypes[t].graphics_func))(&tpart, nx, ny, pixel_mode, cola, colr, colg, colb, firea, firer, fireg, fireb, vid);
+ (*(ptypes[t].graphics_func))(&tpart, nx, ny, pixel_mode, cola, colr, colg, colb, firea, firer, fireg, fireb);
}
else
{
- graphics_DEFAULT(&tpart, nx, ny, pixel_mode, cola, colr, colg, colb, firea, firer, fireg, fireb, vid);
+ graphics_DEFAULT(&tpart, nx, ny, pixel_mode, cola, colr, colg, colb, firea, firer, fireg, fireb);
}
}
//*colr = PIXR(ptypes[cpart->tmp&0xFF].pcolors);
diff --git a/src/elements/stkm.c b/src/elements/stkm.c
index 43182dc..d0bd14a 100644
--- a/src/elements/stkm.c
+++ b/src/elements/stkm.c
@@ -32,6 +32,7 @@ int update_STKM(UPDATE_FUNC_ARGS)
int graphics_STKM(GRAPHICS_FUNC_ARGS)
{
+ *pixel_mode = PSPEC_STICKMAN;
if ((int)player.elem<PT_NUM)
{
*colr = PIXR(ptypes[player.elem].pcolors);
@@ -42,8 +43,7 @@ int graphics_STKM(GRAPHICS_FUNC_ARGS)
{
*colr = *colg = *colb = 255;
}
- graphics_stickmen(GRAPHICS_FUNC_SUBCALL_ARGS);
- return 0;
+ return 1;
}
int run_stickman(playerst* playerp, UPDATE_FUNC_ARGS) {
@@ -57,7 +57,7 @@ int run_stickman(playerst* playerp, UPDATE_FUNC_ARGS) {
playerp->elem = parts[i].ctype;
playerp->frames++;
- //Temperature handling
+ //Tempirature handling
if (parts[i].temp<243)
parts[i].life -= 1;
if ((parts[i].temp<309.6f) && (parts[i].temp>=243))
diff --git a/src/elements/stkm2.c b/src/elements/stkm2.c
index 7386f75..61ef286 100644
--- a/src/elements/stkm2.c
+++ b/src/elements/stkm2.c
@@ -29,6 +29,7 @@ int update_STKM2(UPDATE_FUNC_ARGS) {
int graphics_STKM2(GRAPHICS_FUNC_ARGS)
{
+ *pixel_mode = PSPEC_STICKMAN;
if ((int)player2.elem<PT_NUM)
{
*colr = PIXR(ptypes[player2.elem].pcolors);
@@ -39,6 +40,5 @@ int graphics_STKM2(GRAPHICS_FUNC_ARGS)
{
*colr = *colg = *colb = 255;
}
- graphics_stickmen(GRAPHICS_FUNC_SUBCALL_ARGS);
- return 0;
+ return 1;
}