diff options
| author | Simon <simon@hardwired.org.uk> | 2010-12-29 21:15:40 (GMT) |
|---|---|---|
| committer | Simon <simon@hardwired.org.uk> | 2010-12-29 21:15:40 (GMT) |
| commit | 3715925dd95c7433c4bfd3078089bcf05a16f813 (patch) | |
| tree | 6e7c1ac2757738343f748fd51d4ab3ad5dcca3a9 /src/graphics.c | |
| parent | 713034ed619378aa0abc6b38b69604e1aba8821c (diff) | |
| parent | 5766f9aa7ee0f78adea5799322dce67506d9247d (diff) | |
| download | powder-3715925dd95c7433c4bfd3078089bcf05a16f813.zip powder-3715925dd95c7433c4bfd3078089bcf05a16f813.tar.gz | |
Merge branch 'master' of git://github.com/cracker64/The-Powder-Toy
Diffstat (limited to 'src/graphics.c')
| -rw-r--r-- | src/graphics.c | 27 |
1 files changed, 26 insertions, 1 deletions
diff --git a/src/graphics.c b/src/graphics.c index c68835a..7095af8 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++) @@ -3323,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 |
