Pretty effect when drawing powders, activate with 'n'
This commit is contained in:
parent
cb30cbcce7
commit
ee47b2dd68
@ -162,6 +162,7 @@ extern int aheat_enable;
|
||||
extern int decorations_enable;
|
||||
extern int hud_enable;
|
||||
extern int debug_flags;
|
||||
extern int pretty_powder;
|
||||
int limitFPS;
|
||||
int water_equal_test;
|
||||
|
||||
|
@ -40,6 +40,11 @@ extern unsigned cmode;
|
||||
extern SDL_Surface *sdl_scrn;
|
||||
extern int sdl_scale;
|
||||
|
||||
extern int sandcolour_r;
|
||||
extern int sandcolour_g;
|
||||
extern int sandcolour_b;
|
||||
extern int sandcolour_frame;
|
||||
|
||||
extern unsigned char fire_r[YRES/CELL][XRES/CELL];
|
||||
extern unsigned char fire_g[YRES/CELL][XRES/CELL];
|
||||
extern unsigned char fire_b[YRES/CELL][XRES/CELL];
|
||||
|
@ -25,6 +25,11 @@ unsigned cmode = CM_FIRE;
|
||||
SDL_Surface *sdl_scrn;
|
||||
int sdl_scale = 1;
|
||||
|
||||
int sandcolour_r = 0;
|
||||
int sandcolour_g = 0;
|
||||
int sandcolour_b = 0;
|
||||
int sandcolour_frame = 0;
|
||||
|
||||
unsigned char fire_r[YRES/CELL][XRES/CELL];
|
||||
unsigned char fire_g[YRES/CELL][XRES/CELL];
|
||||
unsigned char fire_b[YRES/CELL][XRES/CELL];
|
||||
|
10
src/main.c
10
src/main.c
@ -179,6 +179,7 @@ int decorations_enable = 1;
|
||||
int hud_enable = 1;
|
||||
int active_menu = 0;
|
||||
int framerender = 0;
|
||||
int pretty_powder = 0;
|
||||
int amd = 1;
|
||||
int FPSB = 0;
|
||||
int MSIGN =-1;
|
||||
@ -1802,6 +1803,13 @@ int main(int argc, char *argv[])
|
||||
if (bsy<0)
|
||||
bsy = 0;
|
||||
|
||||
//Pretty powders, colour cycle
|
||||
//sandcolour_r = 0;
|
||||
//sandcolour_g = 0;
|
||||
sandcolour_b = sandcolour_r = sandcolour_g = (int)(20.0f*sin((float)sandcolour_frame*(M_PI/180.0f)));
|
||||
sandcolour_frame++;
|
||||
sandcolour_frame%=360;
|
||||
|
||||
if(ngrav_enable && drawgrav_enable)
|
||||
draw_grav(vid_buf);
|
||||
draw_walls(part_vbuf);
|
||||
@ -2362,6 +2370,8 @@ int main(int argc, char *argv[])
|
||||
aheat_enable = !aheat_enable;
|
||||
if (sdl_key=='h')
|
||||
hud_enable = !hud_enable;
|
||||
if (sdl_key=='n')
|
||||
pretty_powder = !pretty_powder;
|
||||
if (sdl_key=='p')
|
||||
dump_frame(vid_buf, XRES, YRES, XRES+BARSIZE);
|
||||
if (sdl_key=='v'&&(sdl_mod & (KMOD_LCTRL|KMOD_RCTRL)))
|
||||
|
14
src/powder.c
14
src/powder.c
@ -988,6 +988,20 @@ inline int create_part(int p, int x, int y, int tv)//the function for creating a
|
||||
if (t!=PT_STKM&&t!=PT_STKM2 && t!=PT_PHOT && t!=PT_NEUT)
|
||||
pmap[y][x] = t|(i<<8);
|
||||
|
||||
//Fancy dust effects for powder types
|
||||
if((ptypes[t].properties & TYPE_PART) && pretty_powder)
|
||||
{
|
||||
int colr, colg, colb, randa;
|
||||
randa = (rand()%30)-15;
|
||||
colr = (PIXR(ptypes[t].pcolors)+sandcolour_r+(rand()%20)-10+randa);
|
||||
colg = (PIXG(ptypes[t].pcolors)+sandcolour_g+(rand()%20)-10+randa);
|
||||
colb = (PIXB(ptypes[t].pcolors)+sandcolour_b+(rand()%20)-10+randa);
|
||||
colr = colr>255 ? 255 : (colr<0 ? 0 : colr);
|
||||
colg = colg>255 ? 255 : (colg<0 ? 0 : colg);
|
||||
colb = colb>255 ? 255 : (colb<0 ? 0 : colb);
|
||||
parts[i].dcolour = 0xFF000000 | (colr<<16) | (colg<<8) | colb;
|
||||
}
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user