diff --git a/src/buttons.c b/src/buttons.c index 6c37d869..696c5622 100644 --- a/src/buttons.c +++ b/src/buttons.c @@ -1355,12 +1355,12 @@ void Button_Skins(int btn) Window_dropdown_add_item(cursor_dropdown, temp, cursors[temp]); Window_set_normal_button(172, 87, 14, 14, - (Config.Display_image_limits)?"X":" ", -1, 1, SDLK_LAST); // 8 + (Config.Display_image_limits)?"X":" ", -1, 1, KEY_NONE); // 8 Print_in_window( 190, 85,"Draw picture", MC_Dark, MC_Light); Print_in_window( 190, 94,"limits", MC_Dark, MC_Light); Window_set_normal_button(172, 111, 14, 14, - (Config.Separate_colors)?"X":" ", -1, 1, SDLK_LAST); // 9 + (Config.Separate_colors)?"X":" ", -1, 1, KEY_NONE); // 9 Print_in_window( 190, 109,"Separate", MC_Dark, MC_Light); Print_in_window( 190, 118,"colors", MC_Dark, MC_Light); @@ -1978,7 +1978,7 @@ void Button_Resolution(int btn) // 10 little buttons for the state of each visible mode for (temp=0; temp FROMCODE /// Indicates "no keyboard shortcut". #define KEY_NONE 0 + +#if defined(USE_SDL) /// /// This is the "key identifier" for the mouse 3rd button. /// It was chosen to not conflict with any SDL key number. @@ -798,6 +800,18 @@ GFX2_GLOBAL iconv_t cd_utf16_inv; // UTF16 => FROMCODE /// It was chosen to not conflict with any SDL key number. #define KEY_JOYBUTTON (SDLK_LAST+4) +#else +// Not SDL 1.2 +#define KEY_MOUSEMIDDLE 0x0210 +#define KEY_MOUSEX1 0x0211 +#define KEY_MOUSEX2 0x0212 +#define KEY_MOUSEWHEELUP 0x0200 +#define KEY_MOUSEWHEELDOWN 0x0201 +#define KEY_MOUSEWHEELLEFT 0x0202 +#define KEY_MOUSEWHEELRIGHT 0x0203 +#define KEY_JOYBUTTON 0x0100 +#endif + /// The joystick axis are {X,Y} - on all platforms so far. /// If there is ever a platform where they are reversed, put /// these lines in each platform "case" below. @@ -870,12 +884,14 @@ GFX2_GLOBAL iconv_t cd_utf16_inv; // UTF16 => FROMCODE #define JOY_BUTTON_JOY (10) #define KEY_ESC (KEY_JOYBUTTON+JOY_BUTTON_HOME) -#else +#elif defined(USE_SDL) || defined(USE_SDL2) /// /// This is the key identifier for ESC. When hard-coding keyboard shortcuts /// for buttons, etc. we use this instead of SDLK_ESCAPE, /// so the console ports can get a joybutton equivalent of it. #define KEY_ESC SDLK_ESCAPE +#else + #define KEY_ESC 1 #endif #endif diff --git a/src/hotkeys.c b/src/hotkeys.c index 9ad9361a..d3da45b1 100644 --- a/src/hotkeys.c +++ b/src/hotkeys.c @@ -19,6 +19,9 @@ You should have received a copy of the GNU General Public License along with Grafx2; if not, see */ +#if defined(USE_SDL) || defined(USE_SDL2) +#include +#endif #include "struct.h" #include "global.h" #include "hotkeys.h" diff --git a/src/hotkeys.h b/src/hotkeys.h index 9365ff27..273a512d 100644 --- a/src/hotkeys.h +++ b/src/hotkeys.h @@ -31,7 +31,6 @@ #else #define bool char #endif -#include #define NB_SHORTCUTS 212 ///< Number of actions that can have a key combination associated to it. diff --git a/src/palette.c b/src/palette.c index 2045079f..80dbbbaa 100644 --- a/src/palette.c +++ b/src/palette.c @@ -2923,7 +2923,7 @@ void Button_Secondary_palette(int btn) Num2str(RGB_scale,str,3); Print_in_window(RGBScale_X,RGBScale_Y,str,MC_Black,MC_Light); - Window_set_normal_button(35,106,13,11,"",-1,1,SDLK_LAST); // 8 + Window_set_normal_button(35,106,13,11,"",-1,1,KEY_NONE); // 8 Print_in_window(38,108,(palette_vertical)?"X":" ",MC_Black,MC_Light); Print_in_window(51,108,"Vertical",MC_Dark,MC_Light); diff --git a/src/transform.c b/src/transform.c index e14a719a..37a69ec9 100644 --- a/src/transform.c +++ b/src/transform.c @@ -123,9 +123,9 @@ void Button_Transform_menu(int btn) Window_set_normal_button( 17,140, 27,14,"Y\022" ,1,1,SDLK_y); // 3 Print_in_window( 84,114,"Rotate",MC_Dark,MC_Light); - Window_set_normal_button( 69,125, 37,14,"-90\xb0" ,0,1,SDLK_LAST); // 4 - Window_set_normal_button(107,125, 37,14,"+90\xb0" ,0,1,SDLK_LAST); // 5 - Window_set_normal_button( 69,140, 75,14,"180\xb0" ,0,1,SDLK_LAST); // 6 + Window_set_normal_button( 69,125, 37,14,"-90\xb0" ,0,1,KEY_NONE); // 4 + Window_set_normal_button(107,125, 37,14,"+90\xb0" ,0,1,KEY_NONE); // 5 + Window_set_normal_button( 69,140, 75,14,"180\xb0" ,0,1,KEY_NONE); // 6 Print_in_window( 87, 19,"Resize",MC_Dark,MC_Light); Window_set_normal_button( 80, 86, 60,14,"RESIZE",1,1,SDLK_r); // 7