| 1 | #pragma once |
| 2 | #include <cerrno> |
| 3 | #include <sys/stat.h> |
| 4 | #include <SDL2/SDL.h> |
| 5 | |
| 6 | #define CONFIG_DIR_DEFAULT_MODE S_IRWXU | S_IRGRP | S_IXGRP | S_IROTH | S_IXOTH |
| 7 | #define USE_CONFIG_DIR true |
| 8 | #define CONFIG_DIR_NAME "LaiNES" |
| 9 | #define CONFIG_FALLBACK ".laines-settings" |
| 10 | /* PATH_MAX is a portability nightmare. */ |
| 11 | #define CONFIG_PATH_MAX 1024 |
| 12 | |
| 13 | namespace GUI { |
| 14 | |
| 15 | /* Loading and saving */ |
| 16 | void load_settings(); |
| 17 | void save_settings(); |
| 18 | const char* get_config_path(char * buf, int buflen); |
| 19 | |
| 20 | extern int last_window_size; |
| 21 | extern SDL_Scancode KEY_A []; |
| 22 | extern SDL_Scancode KEY_B []; |
| 23 | extern SDL_Scancode KEY_SELECT[]; |
| 24 | extern SDL_Scancode KEY_START []; |
| 25 | extern SDL_Scancode KEY_UP []; |
| 26 | extern SDL_Scancode KEY_DOWN []; |
| 27 | extern SDL_Scancode KEY_LEFT []; |
| 28 | extern SDL_Scancode KEY_RIGHT []; |
| 29 | extern int BTN_UP []; |
| 30 | extern int BTN_DOWN []; |
| 31 | extern int BTN_LEFT []; |
| 32 | extern int BTN_RIGHT []; |
| 33 | extern int BTN_A []; |
| 34 | extern int BTN_B []; |
| 35 | extern int BTN_SELECT[]; |
| 36 | extern int BTN_START []; |
| 37 | extern bool useJoystick[]; |
| 38 | |
| 39 | } |
| 40 | |