Add blob display back. Also fix small nothing mode bug.

This commit is contained in:
Jacob1 2011-11-16 20:02:30 -05:00 committed by Simon Robertshaw
parent 2d1a0d474f
commit 8f493b62c3
3 changed files with 86 additions and 5 deletions

View File

@ -30,6 +30,7 @@
#define RENDER_FIRE OPTIONS | PSPEC_STICKMAN | PMODE_FLAT | PMODE_ADD | PMODE_BLEND | FIREMODE
#define RENDER_GLOW OPTIONS | PSPEC_STICKMAN | PMODE_FLAT | PMODE_GLOW | PMODE_SPARK | PMODE_FLARE | PMODE_LFLARE | PMODE_ADD | PMODE_BLEND
#define RENDER_BLUR OPTIONS | PSPEC_STICKMAN | PMODE_FLAT | PMODE_BLUR | PMODE_ADD | PMODE_BLEND
#define RENDER_BLOB OPTIONS | PSPEC_STICKMAN | PMODE_FLAT | PMODE_BLOB | PMODE_ADD | PMODE_BLEND
#define RENDER_BASC OPTIONS | PSPEC_STICKMAN | PMODE_FLAT | PMODE_ADD | PMODE_BLEND
#define RENDER_NONE OPTIONS | PSPEC_STICKMAN | PMODE_FLAT

View File

@ -1850,6 +1850,8 @@ void render_parts(pixel *vid)
pixel_mode |= PMODE_FLAT;
if(pixel_mode & PMODE_GLOW && !(render_mode & PMODE_GLOW))
pixel_mode |= PMODE_FLAT;
if (render_mode & PMODE_BLOB)
pixel_mode |= PMODE_BLOB;
pixel_mode &= render_mode;
@ -2730,7 +2732,85 @@ void draw_walls(pixel *vid)
vid[(y*CELL+j)*(XRES+BARSIZE)+(x*CELL+i)] = PIXPACK(0x242424);
}
}
if (render_mode & PMODE_BLOB)
{
// when in blob view, draw some blobs...
if (wtypes[wt].drawstyle==1)
{
for (j=0; j<CELL; j+=2)
for (i=(j>>1)&1; i<CELL; i+=2)
drawblob(vid, (x*CELL+i), (y*CELL+j), PIXR(pc), PIXG(pc), PIXB(pc));
}
else if (wtypes[wt].drawstyle==2)
{
for (j=0; j<CELL; j+=2)
for (i=0; i<CELL; i+=2)
drawblob(vid, (x*CELL+i), (y*CELL+j), PIXR(pc), PIXG(pc), PIXB(pc));
}
else if (wtypes[wt].drawstyle==3)
{
for (j=0; j<CELL; j++)
for (i=0; i<CELL; i++)
drawblob(vid, (x*CELL+i), (y*CELL+j), PIXR(pc), PIXG(pc), PIXB(pc));
}
else if (wtypes[wt].drawstyle==4)
{
for (j=0; j<CELL; j++)
for (i=0; i<CELL; i++)
if(i == j)
drawblob(vid, (x*CELL+i), (y*CELL+j), PIXR(pc), PIXG(pc), PIXB(pc));
else if (i == j+1 || (i == 0 && j == CELL-1))
drawblob(vid, (x*CELL+i), (y*CELL+j), PIXR(gc), PIXG(gc), PIXB(gc));
else
drawblob(vid, (x*CELL+i), (y*CELL+j), 0x20, 0x20, 0x20);
}
if (bmap[y][x]==WL_EWALL)
{
if (emap[y][x])
{
for (j=0; j<CELL; j++)
for (i=0; i<CELL; i++)
if (i&j&1)
drawblob(vid, (x*CELL+i), (y*CELL+j), 0x80, 0x80, 0x80);
}
else
{
for (j=0; j<CELL; j++)
for (i=0; i<CELL; i++)
if (!(i&j&1))
drawblob(vid, (x*CELL+i), (y*CELL+j), 0x80, 0x80, 0x80);
}
}
else if (bmap[y][x]==WL_WALLELEC)
{
for (j=0; j<CELL; j++)
for (i=0; i<CELL; i++)
{
if (!((y*CELL+j)%2) && !((x*CELL+i)%2))
drawblob(vid, (x*CELL+i), (y*CELL+j), PIXR(pc), PIXG(pc), PIXB(pc));
else
drawblob(vid, (x*CELL+i), (y*CELL+j), 0x80, 0x80, 0x80);
}
}
else if (bmap[y][x]==WL_EHOLE)
{
if (emap[y][x])
{
for (j=0; j<CELL; j++)
for (i=0; i<CELL; i++)
drawblob(vid, (x*CELL+i), (y*CELL+j), 0x24, 0x24, 0x24);
for (j=0; j<CELL; j+=2)
for (i=0; i<CELL; i+=2)
vid[(y*CELL+j)*(XRES+BARSIZE)+(x*CELL+i)] = PIXPACK(0x000000);
}
else
{
for (j=0; j<CELL; j+=2)
for (i=0; i<CELL; i+=2)
drawblob(vid, (x*CELL+i), (y*CELL+j), 0x24, 0x24, 0x24);
}
}
}
if (wtypes[wt].eglow && emap[y][x])
{
// glow if electrified

View File

@ -6168,10 +6168,10 @@ void render_ui(pixel * vid_buf, int xcoord, int ycoord, int orientation)
ui_checkbox *render_cb;
ui_checkbox *display_cb;
ui_checkbox *colour_cb;
int render_optioncount = 5;
int render_options[] = {RENDER_EFFE, RENDER_GLOW, RENDER_FIRE, RENDER_BLUR, RENDER_BASC};
int render_optionicons[] = {0xCC, 0xC3, 0x9B, 0xC4, 0xD1};
char * render_desc[] = {"Effects", "Glow", "Fire", "Blur", "Basic"};
int render_optioncount = 7;
int render_options[] = {RENDER_EFFE, RENDER_GLOW, RENDER_FIRE, RENDER_BLUR, RENDER_BASC, RENDER_BLOB, RENDER_NONE};
int render_optionicons[] = {0xCC, 0xC3, 0x9B, 0xC4, 0xD1, 0xD1, 0xD1};
char * render_desc[] = {"Effects", "Glow", "Fire", "Blur", "Basic", "Blob", "None"};
int display_optioncount = 7;
int display_options[] = {DISPLAY_AIRC, DISPLAY_AIRP, DISPLAY_AIRV, DISPLAY_AIRH, DISPLAY_WARP, DISPLAY_PERS, DISPLAY_EFFE};