summaryrefslogtreecommitdiff
path: root/src/graphics.c
diff options
context:
space:
mode:
authorCracker64 <cracker642@gmail.com>2011-05-10 19:32:00 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2011-05-14 12:46:10 (GMT)
commit9d20d6af82a3216c673dc5a8c0a3f03ff4326c4f (patch)
tree53567d991ce0efc03ab74393612dd75c5894b4f0 /src/graphics.c
parente675fb3cc18117bee065719afd390995e8494e87 (diff)
downloadpowder-9d20d6af82a3216c673dc5a8c0a3f03ff4326c4f.zip
powder-9d20d6af82a3216c673dc5a8c0a3f03ff4326c4f.tar.gz
Decoration has a color menu. GoL uses less memory(17MB less), and probably a bit faster.
Diffstat (limited to 'src/graphics.c')
-rw-r--r--src/graphics.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/graphics.c b/src/graphics.c
index 66c4c81..fdaa6d3 100644
--- a/src/graphics.c
+++ b/src/graphics.c
@@ -448,7 +448,7 @@ void draw_tool(pixel *vid_buf, int b, int sl, int sr, unsigned pc, unsigned iswa
}
}
*/
-//draw walls
+//draws walls and elements for menu
int draw_tool_xy(pixel *vid_buf, int x, int y, int b, unsigned pc)
{
int i, j, c;
@@ -3139,6 +3139,11 @@ void draw_decorations(pixel *vid_buf,pixel *decorations)
void create_decorations(pixel *decorations,int x, int y, int rx, int ry, int r, int g, int b)
{
int i,j;
+ if (rx==0 && ry==0)
+ {
+ decorations[(y)*(XRES+BARSIZE)+(x)] = PIXRGB(r, g, b);
+ return;
+ }
for (j=-ry; j<=ry; j++)
for (i=-rx; i<=rx; i++)
if(y+j>=0 && x+i>=0 && x+i<XRES && y+j<YRES)