summaryrefslogtreecommitdiff
path: root/src/interface.c
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2011-05-24 13:55:29 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2011-05-24 13:55:29 (GMT)
commit453c69d39aa565ba61aef98f0f7b7bc8f3b94da0 (patch)
tree3675b28e5774d1b9f72eccaa4ac554f380b666c7 /src/interface.c
parenteafcdf8ec94b058707f1a6b8a2b9b5076c6275ca (diff)
parent956218736b557eb91bb4d841006ddce0d3cdbeed (diff)
downloadpowder-453c69d39aa565ba61aef98f0f7b7bc8f3b94da0.zip
powder-453c69d39aa565ba61aef98f0f7b7bc8f3b94da0.tar.gz
Merge branch 'master' of github.com:FacialTurd/The-Powder-Toy
Diffstat (limited to 'src/interface.c')
-rw-r--r--src/interface.c58
1 files changed, 57 insertions, 1 deletions
diff --git a/src/interface.c b/src/interface.c
index ff4968a..35fac84 100644
--- a/src/interface.c
+++ b/src/interface.c
@@ -4360,7 +4360,7 @@ void decorations_ui(pixel *vid_buf,pixel *decorations,int *bsx,int *bsy)
drawrect(vid_buf, window_offset_x + onleft_button_offset_x +1, window_offset_y +255+6, 12, 12, 255, 255, 255, 255);
drawrect(vid_buf, window_offset_x + 230, window_offset_y +255+6, 26, 12, 255, 255, 255, 255);
drawtext(vid_buf, window_offset_x + 232, window_offset_y +255+9, "Clear", 255, 255, 255, 255);
- drawtext(vid_buf, 2, 388, "Welcome to the decoration editor v.1 (by cracker64) \n\nPro tip: click the current color to move the selector to the other side. Left click is eraser. ", 255, 255, 255, 255);
+ drawtext(vid_buf, 2, 388, "Welcome to the decoration editor v.1 (by cracker64) \n\nPro tip: click the current color to move the selector to the other side. Right click is eraser. ", 255, 255, 255, 255);
ui_edit_draw(vid_buf, &box_R);
ui_edit_draw(vid_buf, &box_G);
ui_edit_draw(vid_buf, &box_B);
@@ -4557,6 +4557,62 @@ void decorations_ui(pixel *vid_buf,pixel *decorations,int *bsx,int *bsy)
}*/
}
}
+ if (sdl_key==SDLK_LEFTBRACKET) {
+ if (sdl_mod & (KMOD_LALT|KMOD_RALT) && !(sdl_mod & (KMOD_SHIFT|KMOD_CTRL)))
+ {
+ *bsx -= 1;
+ *bsy -= 1;
+ }
+ else if (sdl_mod & (KMOD_SHIFT) && !(sdl_mod & (KMOD_CTRL)))
+ {
+ *bsx -= 1;
+ }
+ else if (sdl_mod & (KMOD_CTRL) && !(sdl_mod & (KMOD_SHIFT)))
+ {
+ *bsy -= 1;
+ }
+ else
+ {
+ *bsx -= ceil((*bsx/5)+0.5f);
+ *bsy -= ceil((*bsy/5)+0.5f);
+ }
+ if (*bsx>1180)
+ *bsx = 1180;
+ if (*bsy>1180)
+ *bsy = 1180;
+ if (*bsx<0)
+ *bsx = 0;
+ if (*bsy<0)
+ *bsy = 0;
+ }
+ if (sdl_key==SDLK_RIGHTBRACKET) {
+ if (sdl_mod & (KMOD_LALT|KMOD_RALT) && !(sdl_mod & (KMOD_SHIFT|KMOD_CTRL)))
+ {
+ *bsx += 1;
+ *bsy += 1;
+ }
+ else if (sdl_mod & (KMOD_SHIFT) && !(sdl_mod & (KMOD_CTRL)))
+ {
+ *bsx += 1;
+ }
+ else if (sdl_mod & (KMOD_CTRL) && !(sdl_mod & (KMOD_SHIFT)))
+ {
+ *bsy += 1;
+ }
+ else
+ {
+ *bsx += ceil((*bsx/5)+0.5f);
+ *bsy += ceil((*bsy/5)+0.5f);
+ }
+ if (*bsx>1180)
+ *bsx = 1180;
+ if (*bsy>1180)
+ *bsy = 1180;
+ if (*bsx<0)
+ *bsx = 0;
+ if (*bsy<0)
+ *bsy = 0;
+ }
if(sdl_key=='b' || sdl_key==SDLK_ESCAPE)
{
free(old_buf);