summaryrefslogtreecommitdiff
path: root/src/graphics.c
diff options
context:
space:
mode:
authorCracker64 <cracker642@gmail.com>2010-12-29 14:44:12 (GMT)
committer Cracker64 <cracker642@gmail.com>2010-12-29 14:44:12 (GMT)
commit25b95e211e5c38e29798bfb6be9c5656d9a408d7 (patch)
treeb8e275239da97b546612ee6dedb487a4a0092197 /src/graphics.c
parent761ea03882fd779cc77ac7cb49ff59bbfe94b51e (diff)
downloadpowder-25b95e211e5c38e29798bfb6be9c5656d9a408d7.zip
powder-25b95e211e5c38e29798bfb6be9c5656d9a408d7.tar.gz
new display, Life, shows life in a grayscale gradient, will ONLY show up in debug mode, on shift-1, fix filt floodfill, portal has bigger storage, other fixes.
Diffstat (limited to 'src/graphics.c')
-rw-r--r--src/graphics.c34
1 files changed, 32 insertions, 2 deletions
diff --git a/src/graphics.c b/src/graphics.c
index a2e73e6..a22cf58 100644
--- a/src/graphics.c
+++ b/src/graphics.c
@@ -1478,6 +1478,31 @@ void draw_parts(pixel *vid)
cb = 0;
blendpixel(vid, nx, ny, cr, cg, cb, 255);
}
+ else if(cmode==CM_LIFE)
+ {
+ float frequency = 0.4;
+ int q;
+ if(!(parts[i].life<5))
+ q = sqrt(parts[i].life);
+ else
+ q = parts[i].life;
+ cr = sin(frequency*q) * 100 + 128;
+ cg = sin(frequency*q) * 100 + 128;
+ cb = sin(frequency*q) * 100 + 128;
+ if(cr>=255)
+ cr = 255;
+ if(cg>=255)
+ cg = 255;
+ if(cb>=255)
+ cb = 255;
+ if(cr<=0)
+ cr = 0;
+ if(cg<=0)
+ cg = 0;
+ if(cb<=0)
+ cb = 0;
+ blendpixel(vid, nx, ny, cr, cg, cb, 255);
+ }
else if(t==PT_MWAX&&cmode == CM_FANCY)
{
for(x=-1; x<=1; x++)
@@ -2400,7 +2425,8 @@ void draw_parts(pixel *vid)
blendpixel(vid, nx-1, ny-1, cr, cg, cb, 32);
}
}
- else if(t==PT_BOMB){
+ else if(t==PT_BOMB)
+ {
if(parts[i].tmp==0){
cr = PIXR(ptypes[t].pcolors);
cg = PIXG(ptypes[t].pcolors);
@@ -2425,6 +2451,8 @@ void draw_parts(pixel *vid)
addpixel(vid, nx, ny-newx, cr, cg, cb, gradv);
gradv = gradv/1.1f;
}
+ } else {
+ blendpixel(vid, nx, ny, cr, cg, cb, 255);
}
}
else if(parts[i].tmp==1){
@@ -2442,6 +2470,8 @@ void draw_parts(pixel *vid)
addpixel(vid, nx, ny-newx, cr, cg, cb, gradv);
gradv = gradv/1.5f;
}
+ } else {
+ blendpixel(vid, nx, ny, cr, cg, cb, 255);
}
}
else {
@@ -3318,7 +3348,7 @@ void sdl_open(void)
SDL_WM_SetCaption("The Powder Toy", "Powder Toy");
sdl_seticon();
SDL_EnableUNICODE(1);
- //SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL);
+ SDL_EnableKeyRepeat(SDL_DEFAULT_REPEAT_DELAY, SDL_DEFAULT_REPEAT_INTERVAL);
}
#ifdef OpenGL