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);
|
||||||
|
@ -2553,7 +2553,7 @@ void draw_parts(pixel *vid)
|
|||||||
cr *= x;
|
cr *= x;
|
||||||
cg *= x;
|
cg *= x;
|
||||||
cb *= x;
|
cb *= x;
|
||||||
vid[ny*(XRES+BARSIZE)+nx] = PIXRGB(cr>255?255:cr,cg>255?255:cg,cb>255?255:cb);
|
vid[ny*(XRES+BARSIZE)+nx] = PIXRGB(cr>255?255:cr,cg>255?255:cg,cb>255?255:cb);
|
||||||
cr >>= 4;
|
cr >>= 4;
|
||||||
cg >>= 4;
|
cg >>= 4;
|
||||||
cb >>= 4;
|
cb >>= 4;
|
||||||
@ -2587,15 +2587,26 @@ 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;
|
||||||
blendpixel(vid, nx, ny, cr, cg, cb, 192);
|
if(cmode == CM_PERS){
|
||||||
blendpixel(vid, nx+1, ny, cr, cg, cb, 96);
|
if(parts[i].pavg[0] && parts[i].pavg[1])
|
||||||
blendpixel(vid, nx-1, ny, cr, cg, cb, 96);
|
{
|
||||||
blendpixel(vid, nx, ny+1, cr, cg, cb, 96);
|
draw_line(vid, nx, ny, parts[i].pavg[0], parts[i].pavg[1], cr, cg, cb, XRES+BARSIZE);
|
||||||
blendpixel(vid, nx, ny-1, cr, cg, cb, 96);
|
}
|
||||||
blendpixel(vid, nx+1, ny-1, cr, cg, cb, 32);
|
else
|
||||||
blendpixel(vid, nx-1, ny+1, cr, cg, cb, 32);
|
{
|
||||||
blendpixel(vid, nx+1, ny+1, cr, cg, cb, 32);
|
vid[ny*(XRES+BARSIZE)+nx] = PIXRGB(cr, cg, cb);
|
||||||
blendpixel(vid, nx-1, ny-1, cr, cg, cb, 32);
|
}
|
||||||
|
} else {
|
||||||
|
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, ny+1, cr, cg, cb, 96);
|
||||||
|
blendpixel(vid, nx, ny-1, cr, cg, cb, 96);
|
||||||
|
blendpixel(vid, nx+1, ny-1, cr, cg, cb, 32);
|
||||||
|
blendpixel(vid, nx-1, ny+1, cr, cg, cb, 32);
|
||||||
|
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
|
||||||
|
@ -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;
|
||||||
|
15
src/main.c
15
src/main.c
@ -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
|
||||||
@ -2224,10 +2224,17 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
if (sdl_key=='g')
|
if (sdl_key=='g')
|
||||||
{
|
{
|
||||||
if (sdl_mod & (KMOD_SHIFT))
|
if(sdl_mod & (KMOD_CTRL))
|
||||||
GRID_MODE = (GRID_MODE+9)%10;
|
{
|
||||||
|
drawgrav_enable =! drawgrav_enable;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
GRID_MODE = (GRID_MODE+1)%10;
|
{
|
||||||
|
if (sdl_mod & (KMOD_SHIFT))
|
||||||
|
GRID_MODE = (GRID_MODE+9)%10;
|
||||||
|
else
|
||||||
|
GRID_MODE = (GRID_MODE+1)%10;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (sdl_key=='m')
|
if (sdl_key=='m')
|
||||||
{
|
{
|
||||||
|
@ -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