|
- #ifndef IZ_CONFIG_H
- #define IZ_CONFIG_H
-
- #include <stdio.h>
- #include <string.h>
- #include <SDL_filesystem.h>
- #include <SDL_keyboard.h>
- #include <minIni.h>
-
- #include "../IZ_common.h"
- #include "../IZ_action.h"
-
- typedef struct {
- uint16_t width;
- uint16_t height;
- uint8_t max_fps;
- } IZ_VideoConfig;
-
- typedef struct {
- uint16_t gamepad_axis_threshold;
- } IZ_InputConfig;
-
- typedef SDL_KeyCode IZ_KeyCode;
-
- typedef int IZ_PadButton;
-
- typedef struct {
- IZ_KeyCode keyboard[CONTROLS];
- IZ_PadButton gamepad[CONTROLS];
- } IZ_ControlsConfig;
-
- typedef struct {
- IZ_VideoConfig video;
- IZ_InputConfig input;
- IZ_ControlsConfig controls[PLAYERS];
- } IZ_Config;
-
- static const IZ_KeyCode IZ_DEFAULT_KEYBOARD_CONTROLS[PLAYERS][CONTROLS] = {
- {
- SDLK_UP,
- SDLK_RIGHT,
- SDLK_DOWN,
- SDLK_LEFT,
- SDLK_RETURN, // yes
- SDLK_BACKSPACE, // no
- SDLK_a, // action0
- SDLK_s, // action1
- SDLK_d, // action2
- SDLK_f, // action3
- SDLK_z, // action4
- SDLK_x, // action5
- SDLK_c, // action6
- SDLK_v, // action7
- SDLK_w, // action8
- SDLK_e, // action9
- },
- };
-
- static const uint8_t IZ_DEFAULT_JOYSTICK_CONTROLS[PLAYERS][CONTROLS] = {
- {
- 255,
- 255,
- 255,
- 255,
- 11,
- 10,
- 1,
- 0,
- 4,
- 3,
- 6,
- 7,
- 8,
- 9,
- 13,
- 14,
- },
- };
-
- void IZ_GetConfigPath(char* config_path);
-
- void IZ_SaveConfig(IZ_Config* config);
-
- void IZ_LoadConfig(IZ_Config* config);
-
- #endif
|