summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJacob1 <jfu614@gmail.com>2011-11-17 01:02:30 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2011-11-18 14:15:49 (GMT)
commit8f493b62c31490301db4e388eda9707ea7777d9a (patch)
tree564d71203f420117481032e40c170e55d23565c9 /src
parent2d1a0d474f44cd64a5948de8410c1a0c75908abc (diff)
downloadpowder-8f493b62c31490301db4e388eda9707ea7777d9a.zip
powder-8f493b62c31490301db4e388eda9707ea7777d9a.tar.gz
Add blob display back. Also fix small nothing mode bug.
Diffstat (limited to 'src')
-rw-r--r--src/graphics.c82
-rw-r--r--src/interface.c8
2 files changed, 85 insertions, 5 deletions
diff --git a/src/graphics.c b/src/graphics.c
index 6be9bb6..50c1a70 100644
--- a/src/graphics.c
+++ b/src/graphics.c
@@ -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
diff --git a/src/interface.c b/src/interface.c
index 79d1995..847b968 100644
--- a/src/interface.c
+++ b/src/interface.c
@@ -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};