diff options
| author | Bryan Hoyle <starfoxprime@gmail.com> | 2011-08-24 00:29:26 (GMT) |
|---|---|---|
| committer | Bryan Hoyle <starfoxprime@gmail.com> | 2011-08-24 00:29:26 (GMT) |
| commit | 578144c48a1b35ae8d0763637752d935169663ac (patch) | |
| tree | ad0407b144aca61502e8419c96fc385a9f5aea28 /src/interface.c | |
| parent | f577c319db982e6b3d3b3731f1980c89182da982 (diff) | |
| parent | 6581c29bf7eaf07483178804199f090b1c0e43ff (diff) | |
| download | powder-578144c48a1b35ae8d0763637752d935169663ac.zip powder-578144c48a1b35ae8d0763637752d935169663ac.tar.gz | |
Merge remote branch 'origin/master'
Diffstat (limited to 'src/interface.c')
| -rw-r--r-- | src/interface.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/interface.c b/src/interface.c index de226f3..bb07f98 100644 --- a/src/interface.c +++ b/src/interface.c @@ -26,7 +26,7 @@ #endif SDLMod sdl_mod; -int sdl_key, sdl_wheel, sdl_caps=0, sdl_ascii, sdl_zoom_trig=0; +int sdl_key, sdl_rkey, sdl_wheel, sdl_caps=0, sdl_ascii, sdl_zoom_trig=0; #if (defined(LIN32) || defined(LIN64)) && defined(SDL_VIDEO_DRIVER_X11) SDL_SysWMinfo sdl_wminfo; Atom XA_CLIPBOARD, XA_TARGETS; @@ -1945,12 +1945,8 @@ void menu_ui_v3(pixel *vid_buf, int i, int *sl, int *sr, int *dae, int b, int bq } } } - else if (i==SC_SPECIAL)//special menu + else if (i==SC_TOOL)//tools menu { - if (fwidth > XRES-BARSIZE) { //fancy scrolling - float overflow = fwidth-(XRES-BARSIZE), location = ((float)XRES-BARSIZE)/((float)(mx-(XRES-BARSIZE))); - xoff = (int)(overflow / location); - } for (n = UI_WALLSTART; n<UI_WALLSTART+UI_WALLCOUNT; n++) { if (n==SPC_AIR||n==SPC_HEAT||n==SPC_COOL||n==SPC_VACUUM||n==SPC_WIND||n==SPC_PGRV||n==SPC_NGRV) @@ -1985,6 +1981,13 @@ void menu_ui_v3(pixel *vid_buf, int i, int *sl, int *sr, int *dae, int b, int bq } } } + } + else if (i==SC_SPECIAL)//special menu + { + if (fwidth > XRES-BARSIZE) { //fancy scrolling + float overflow = fwidth-(XRES-BARSIZE), location = ((float)XRES-BARSIZE)/((float)(mx-(XRES-BARSIZE))); + xoff = (int)(overflow / location); + } for (n = 0; n<PT_NUM; n++) { if (ptypes[n].menusection==i&&ptypes[n].menu==1) @@ -2100,7 +2103,7 @@ void menu_ui_v3(pixel *vid_buf, int i, int *sl, int *sr, int *dae, int b, int bq { drawtext(vid_buf, XRES-textwidth((char *)msections[i].name)-BARSIZE, sy-10, (char *)msections[i].name, 255, 255, 255, 255); } - else if (i==SC_WALL||(i==SC_SPECIAL&&h>=UI_WALLSTART)) + else if (i==SC_WALL||i==SC_TOOL) { drawtext(vid_buf, XRES-textwidth((char *)wtypes[h-UI_WALLSTART].descs)-BARSIZE, sy-10, (char *)wtypes[h-UI_WALLSTART].descs, 255, 255, 255, 255); } @@ -2205,7 +2208,7 @@ int color_menu_ui(pixel *vid_buf, int i, int *cr, int *cg, int *cb, int b, int b int sdl_poll(void) { SDL_Event event; - sdl_key=sdl_wheel=sdl_ascii=0; + sdl_key=sdl_rkey=sdl_wheel=sdl_ascii=0; while (SDL_PollEvent(&event)) { switch (event.type) @@ -2265,6 +2268,7 @@ int sdl_poll(void) break; case SDL_KEYUP: + sdl_rkey=event.key.keysym.sym; if (event.key.keysym.sym == SDLK_CAPSLOCK) sdl_caps = 0; if (event.key.keysym.sym == 'z') |
