summaryrefslogtreecommitdiff
path: root/src/interface.c
diff options
context:
space:
mode:
authorchaos.powdertoy.co.uk <admin@powdertoy.co.uk>2012-03-15 02:14:17 (GMT)
committer chaos.powdertoy.co.uk <admin@powdertoy.co.uk>2012-03-15 02:14:17 (GMT)
commit6254d4064dff390ce92c1803cdf9d9fb58a62e79 (patch)
treec95626a1f5ea562d7a4dc5c58a02b0db3c902043 /src/interface.c
parent4fc0f750221a33a9ac922022ee58ccda6bbe3440 (diff)
parent7a454d4d729a5715a7c1e71dfbaf303471bf8d1f (diff)
downloadpowder-6254d4064dff390ce92c1803cdf9d9fb58a62e79.zip
powder-6254d4064dff390ce92c1803cdf9d9fb58a62e79.tar.gz
Merge branch 'master' of github.com:FacialTurd/The-Powder-Toy
Diffstat (limited to 'src/interface.c')
-rw-r--r--src/interface.c33
1 files changed, 24 insertions, 9 deletions
diff --git a/src/interface.c b/src/interface.c
index 163e46b..eede146 100644
--- a/src/interface.c
+++ b/src/interface.c
@@ -2219,7 +2219,7 @@ void menu_ui(pixel *vid_buf, int i, int *sl, int *sr)
}
*/
//current menu function
-void menu_ui_v3(pixel *vid_buf, int i, int *sl, int *sr, int *dae, int b, int bq, int mx, int my)
+void menu_ui_v3(pixel *vid_buf, int i, int *sl, int *sr, int *su, int *dae, int b, int bq, int mx, int my)
{
int h,x,y,n=0,height,width,sy,rows=0,xoff=0,fwidth;
SEC = SEC2;
@@ -2458,7 +2458,7 @@ void menu_ui_v3(pixel *vid_buf, int i, int *sl, int *sr, int *dae, int b, int bq
SEC2 = -1;
}
else {
- *sl = h;
+ *sl = *su = h;
*dae = 51;
}
}
@@ -2478,7 +2478,7 @@ void menu_ui_v3(pixel *vid_buf, int i, int *sl, int *sr, int *dae, int b, int bq
SEC2 = -1;
}
else {
- *sr = h;
+ *sr = *su = h;
*dae = 51;
}
}
@@ -2537,7 +2537,7 @@ int color_menu_ui(pixel *vid_buf, int i, int *cr, int *cg, int *cb, int b, int b
float overflow = fwidth-(XRES-BARSIZE), location = ((float)XRES-BARSIZE)/((float)(mx-(XRES-BARSIZE)));
xoff = (int)(overflow / location);
}
- for (n = 0; n<3; n++)
+ for (n = 0; n<4; n++)
{
for (a=1; a<15; a++)
{
@@ -2547,6 +2547,8 @@ int color_menu_ui(pixel *vid_buf, int i, int *cr, int *cg, int *cb, int b, int b
vid_buf[(XRES+BARSIZE)*(y+a)+((x-xoff)+c)] = PIXRGB(PIXR(toollist[n].colour)-10*a, PIXG(toollist[n].colour)-10*a, PIXB(toollist[n].colour)-10*a);
else if (n == DECO_DARKEN)
vid_buf[(XRES+BARSIZE)*(y+a)+((x-xoff)+c)] = PIXRGB(PIXR(toollist[n].colour)+10*a, PIXG(toollist[n].colour)+10*a, PIXB(toollist[n].colour)+10*a);
+ else if (n == DECO_SMUDGE)
+ vid_buf[(XRES+BARSIZE)*(y+a)+((x-xoff)+c)] = PIXRGB(PIXR(toollist[n].colour), PIXG(toollist[n].colour)-5*c, PIXB(toollist[n].colour)+5*c);
else if (n == DECO_DRAW)
vid_buf[(XRES+BARSIZE)*(y+a)+((x-xoff)+c)] = PIXRGB(*cr,*cg,*cb);
else
@@ -2619,7 +2621,15 @@ void quickoptions_menu(pixel *vid_buf, int b, int bq, int x, int y)
quickoptions_tooltip_y = (i*16)+5;
if(b && !bq)
{
- *(quickmenu[i].variable) = !(*(quickmenu[i].variable));
+ if (!strcmp(quickmenu[i].name,"Newtonian gravity"))
+ {
+ if(!ngrav_enable)
+ start_grav_async();
+ else
+ stop_grav_async();
+ }
+ else
+ *(quickmenu[i].variable) = !(*(quickmenu[i].variable));
}
}
}
@@ -2884,6 +2894,11 @@ void set_cmode(int cm) // sets to given view mode
{
colour_mode = COLOUR_HEAT;
strcpy(itc_msg, "Heat Display");
+ free(display_modes);
+ display_modes = calloc(2, sizeof(unsigned int));
+ display_mode |= DISPLAY_AIRH;
+ display_modes[0] = DISPLAY_AIRH;
+ display_modes[1] = 0;
}
else if (cmode==CM_FANCY)
{
@@ -6426,10 +6441,10 @@ void render_ui(pixel * vid_buf, int xcoord, int ycoord, int orientation)
int display_optionicons[] = {0xD4, 0x99, 0x98, 0xBE, 0xDE, 0x9A, -1};
char * display_desc[] = {"Air: Cracker", "Air: Pressure", "Air: Velocity", "Air: Heat", "Warp effect", "Persistent", "Effects"};
- int colour_optioncount = 3;
- int colour_options[] = {COLOUR_LIFE, COLOUR_HEAT, COLOUR_GRAD};
- int colour_optionicons[] = {0xE0, 0xBE, 0xD3};
- char * colour_desc[] = {"Life", "Heat", "Heat Gradient"};
+ int colour_optioncount = 4;
+ int colour_options[] = {COLOUR_BASC, COLOUR_LIFE, COLOUR_HEAT, COLOUR_GRAD};
+ int colour_optionicons[] = {0xDB, 0xE0, 0xBE, 0xD3};
+ char * colour_desc[] = {"Basic", "Life", "Heat", "Heat Gradient"};
yoffset = 16;
xoffset = 0;