Better photons for persistent display, ability to toggle gravity view (ctrl+g)
This commit is contained in:
parent
43b75ea058
commit
36ee81fc6b
@ -176,6 +176,8 @@ extern int zoom_en;
|
|||||||
extern int zoom_x, zoom_y;
|
extern int zoom_x, zoom_y;
|
||||||
extern int zoom_wx, zoom_wy;
|
extern int zoom_wx, zoom_wy;
|
||||||
|
|
||||||
|
extern int drawgrav_enable;
|
||||||
|
|
||||||
void menu_count(void);
|
void menu_count(void);
|
||||||
|
|
||||||
void get_sign_pos(int i, int *x0, int *y0, int *w, int *h);
|
void get_sign_pos(int i, int *x0, int *y0, int *w, int *h);
|
||||||
|
@ -2587,6 +2587,16 @@ void draw_parts(pixel *vid)
|
|||||||
cr = cr>255?255:cr;
|
cr = cr>255?255:cr;
|
||||||
cg = cg>255?255:cg;
|
cg = cg>255?255:cg;
|
||||||
cb = cb>255?255:cb;
|
cb = cb>255?255:cb;
|
||||||
|
if(cmode == CM_PERS){
|
||||||
|
if(parts[i].pavg[0] && parts[i].pavg[1])
|
||||||
|
{
|
||||||
|
draw_line(vid, nx, ny, parts[i].pavg[0], parts[i].pavg[1], cr, cg, cb, XRES+BARSIZE);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
vid[ny*(XRES+BARSIZE)+nx] = PIXRGB(cr, cg, cb);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
blendpixel(vid, nx, ny, cr, cg, cb, 192);
|
blendpixel(vid, nx, ny, cr, cg, cb, 192);
|
||||||
blendpixel(vid, nx+1, ny, cr, cg, cb, 96);
|
blendpixel(vid, nx+1, ny, cr, cg, cb, 96);
|
||||||
blendpixel(vid, nx-1, ny, cr, cg, cb, 96);
|
blendpixel(vid, nx-1, ny, cr, cg, cb, 96);
|
||||||
@ -2598,6 +2608,7 @@ void draw_parts(pixel *vid)
|
|||||||
blendpixel(vid, nx-1, ny-1, cr, cg, cb, 32);
|
blendpixel(vid, nx-1, ny-1, cr, cg, cb, 32);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
//Life can be 11 too, so don't just check for 10
|
//Life can be 11 too, so don't just check for 10
|
||||||
else if (t==PT_SWCH && parts[i].life >= 10)
|
else if (t==PT_SWCH && parts[i].life >= 10)
|
||||||
{
|
{
|
||||||
|
@ -78,6 +78,8 @@ int zoom_wx=0, zoom_wy=0;
|
|||||||
unsigned char ZFACTOR = 256/ZSIZE_D;
|
unsigned char ZFACTOR = 256/ZSIZE_D;
|
||||||
unsigned char ZSIZE = ZSIZE_D;
|
unsigned char ZSIZE = ZSIZE_D;
|
||||||
|
|
||||||
|
int drawgrav_enable = 0;
|
||||||
|
|
||||||
void menu_count(void)//puts the number of elements in each section into .itemcount
|
void menu_count(void)//puts the number of elements in each section into .itemcount
|
||||||
{
|
{
|
||||||
int i=0;
|
int i=0;
|
||||||
|
@ -1804,7 +1804,7 @@ int main(int argc, char *argv[])
|
|||||||
if (bsy<0)
|
if (bsy<0)
|
||||||
bsy = 0;
|
bsy = 0;
|
||||||
|
|
||||||
if(ngrav_enable)
|
if(ngrav_enable && drawgrav_enable)
|
||||||
draw_grav(vid_buf);
|
draw_grav(vid_buf);
|
||||||
draw_walls(vid_buf);
|
draw_walls(vid_buf);
|
||||||
update_particles(vid_buf); //update everything
|
update_particles(vid_buf); //update everything
|
||||||
@ -2223,12 +2223,19 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (sdl_key=='g')
|
if (sdl_key=='g')
|
||||||
|
{
|
||||||
|
if(sdl_mod & (KMOD_CTRL))
|
||||||
|
{
|
||||||
|
drawgrav_enable =! drawgrav_enable;
|
||||||
|
}
|
||||||
|
else
|
||||||
{
|
{
|
||||||
if (sdl_mod & (KMOD_SHIFT))
|
if (sdl_mod & (KMOD_SHIFT))
|
||||||
GRID_MODE = (GRID_MODE+9)%10;
|
GRID_MODE = (GRID_MODE+9)%10;
|
||||||
else
|
else
|
||||||
GRID_MODE = (GRID_MODE+1)%10;
|
GRID_MODE = (GRID_MODE+1)%10;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if (sdl_key=='m')
|
if (sdl_key=='m')
|
||||||
{
|
{
|
||||||
if(sl!=sr)
|
if(sl!=sr)
|
||||||
|
@ -769,10 +769,15 @@ inline int create_part(int p, int x, int y, int t)//the function for creating a
|
|||||||
{
|
{
|
||||||
parts[i].pavg[1] = pv[y/CELL][x/CELL];
|
parts[i].pavg[1] = pv[y/CELL][x/CELL];
|
||||||
}
|
}
|
||||||
if (t==PT_QRTZ)
|
else if (t==PT_QRTZ)
|
||||||
{
|
{
|
||||||
parts[i].pavg[1] = pv[y/CELL][x/CELL];
|
parts[i].pavg[1] = pv[y/CELL][x/CELL];
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
parts[i].pavg[0] = 0.0f;
|
||||||
|
parts[i].pavg[1] = 0.0f;
|
||||||
|
}
|
||||||
if (t!=PT_STKM&&t!=PT_STKM2)//set everything to default values first, except for stickman.
|
if (t!=PT_STKM&&t!=PT_STKM2)//set everything to default values first, except for stickman.
|
||||||
{
|
{
|
||||||
parts[i].x = (float)x;
|
parts[i].x = (float)x;
|
||||||
|
Reference in New Issue
Block a user