2011-05-21 18:20:04 +02:00
|
|
|
/*
|
|
|
|
* This software is licensed under the terms of the MIT-License
|
2017-02-11 02:24:47 +01:00
|
|
|
* See COPYING for further information.
|
2011-05-21 18:20:04 +02:00
|
|
|
* ---
|
|
|
|
* Copyright (C) 2011, Lukas Weber <laochailan@web.de>
|
2012-08-03 07:06:19 +02:00
|
|
|
* Copyright (C) 2012, Alexeyew Andrew <http://akari.thebadasschoobs.org/>
|
2011-05-21 18:20:04 +02:00
|
|
|
*/
|
2017-02-11 02:24:47 +01:00
|
|
|
|
2011-05-21 18:20:04 +02:00
|
|
|
#ifndef CONFIG_H
|
|
|
|
#define CONFIG_H
|
|
|
|
|
2017-02-04 03:56:40 +01:00
|
|
|
#include <SDL_keycode.h>
|
2011-05-21 18:20:04 +02:00
|
|
|
|
|
|
|
typedef struct Config {
|
2012-07-29 22:39:52 +02:00
|
|
|
int intval[64];
|
|
|
|
char* strval[64];
|
2012-08-15 17:03:53 +02:00
|
|
|
float fltval[64];
|
2011-05-21 18:20:04 +02:00
|
|
|
} Config;
|
|
|
|
|
|
|
|
extern Config tconfig;
|
|
|
|
|
2012-07-30 16:26:04 +02:00
|
|
|
/*
|
|
|
|
* <Akari> IMPORTANT: When adding new controls, ALWAYS add them RIGHT AFTER the last KEY_* constant.
|
|
|
|
* Not doing so will likely break replays! And don't forget to update CONFIG_KEY_LAST below.
|
2012-08-15 02:41:21 +02:00
|
|
|
* Same goes for GP_*.
|
2012-07-30 16:26:04 +02:00
|
|
|
*/
|
|
|
|
|
2012-08-03 07:06:19 +02:00
|
|
|
typedef enum ConfigKey {
|
2011-05-21 18:20:04 +02:00
|
|
|
KEY_UP = 0,
|
|
|
|
KEY_DOWN,
|
|
|
|
KEY_LEFT,
|
|
|
|
KEY_RIGHT,
|
|
|
|
KEY_FOCUS,
|
|
|
|
KEY_SHOT,
|
2011-06-27 13:36:35 +02:00
|
|
|
KEY_BOMB,
|
2017-02-11 02:24:47 +01:00
|
|
|
|
2011-07-02 16:06:10 +02:00
|
|
|
KEY_FULLSCREEN,
|
2011-07-02 18:36:08 +02:00
|
|
|
KEY_SCREENSHOT,
|
2012-07-30 16:26:04 +02:00
|
|
|
KEY_SKIP,
|
2017-02-11 02:24:47 +01:00
|
|
|
|
|
|
|
KEY_IDDQD, // must be present even without DEBUG!
|
2017-02-15 18:10:56 +01:00
|
|
|
KEY_HAHAIWIN,
|
2017-02-11 02:24:47 +01:00
|
|
|
|
2011-06-29 17:01:03 +02:00
|
|
|
FULLSCREEN,
|
2017-02-11 02:24:47 +01:00
|
|
|
|
2011-06-27 13:36:35 +02:00
|
|
|
NO_SHADER,
|
2012-07-13 20:32:47 +02:00
|
|
|
NO_AUDIO,
|
2017-01-17 20:00:52 +01:00
|
|
|
NO_MUSIC,
|
2017-01-24 14:40:57 +01:00
|
|
|
SFX_VOLUME,
|
|
|
|
BGM_VOLUME,
|
2017-02-11 02:24:47 +01:00
|
|
|
|
2012-07-13 22:42:35 +02:00
|
|
|
NO_STAGEBG,
|
2012-07-16 17:47:06 +02:00
|
|
|
NO_STAGEBG_FPSLIMIT,
|
2017-02-11 02:24:47 +01:00
|
|
|
|
2012-07-28 22:53:53 +02:00
|
|
|
SAVE_RPY,
|
2017-02-11 02:24:47 +01:00
|
|
|
|
2012-07-28 22:53:53 +02:00
|
|
|
VID_WIDTH,
|
|
|
|
VID_HEIGHT,
|
2017-02-11 02:24:47 +01:00
|
|
|
|
2012-08-15 02:41:21 +02:00
|
|
|
PLAYERNAME,
|
2017-02-11 02:24:47 +01:00
|
|
|
|
2012-08-15 02:41:21 +02:00
|
|
|
GAMEPAD_ENABLED,
|
|
|
|
GAMEPAD_DEVICE,
|
2012-08-15 14:33:32 +02:00
|
|
|
GAMEPAD_AXIS_UD,
|
|
|
|
GAMEPAD_AXIS_LR,
|
2012-08-15 17:03:53 +02:00
|
|
|
GAMEPAD_AXIS_UD_SENS,
|
|
|
|
GAMEPAD_AXIS_LR_SENS,
|
2012-08-16 21:20:58 +02:00
|
|
|
GAMEPAD_AXIS_DEADZONE,
|
2012-08-15 16:36:39 +02:00
|
|
|
GAMEPAD_AXIS_FREE,
|
2017-02-11 02:24:47 +01:00
|
|
|
|
2012-08-15 02:41:21 +02:00
|
|
|
// gamepad controls
|
|
|
|
// The UDLR ones should work without adjusting - but you can assign custom buttons to them if you really need to
|
|
|
|
GP_UP,
|
|
|
|
GP_DOWN,
|
|
|
|
GP_LEFT,
|
|
|
|
GP_RIGHT,
|
|
|
|
GP_FOCUS,
|
|
|
|
GP_SHOT,
|
|
|
|
GP_BOMB,
|
|
|
|
GP_SKIP,
|
2017-02-10 02:11:45 +01:00
|
|
|
GP_PAUSE,
|
|
|
|
|
|
|
|
VSYNC,
|
2012-08-03 07:06:19 +02:00
|
|
|
} ConfigKey;
|
2011-05-21 18:20:04 +02:00
|
|
|
|
2012-08-03 07:06:19 +02:00
|
|
|
typedef enum ConfigKeyType {
|
|
|
|
CFGT_INT,
|
|
|
|
CFGT_STRING,
|
2012-08-15 17:03:53 +02:00
|
|
|
CFGT_KEYBINDING,
|
|
|
|
CFGT_FLOAT
|
2012-08-03 07:06:19 +02:00
|
|
|
} ConfigKeyType;
|
|
|
|
|
|
|
|
typedef struct ConfigEntry {
|
|
|
|
ConfigKeyType type;
|
|
|
|
ConfigKey key;
|
|
|
|
char *name;
|
|
|
|
} ConfigEntry;
|
|
|
|
|
|
|
|
extern ConfigEntry configdefs[];
|
|
|
|
Config tconfig;
|
2011-05-21 18:20:04 +02:00
|
|
|
|
2012-07-14 16:37:52 +02:00
|
|
|
#define CONFIG_KEY_FIRST KEY_UP
|
2017-02-15 18:10:56 +01:00
|
|
|
#define CONFIG_KEY_LAST KEY_HAHAIWIN
|
2012-08-15 02:41:21 +02:00
|
|
|
|
|
|
|
#define CONFIG_GPKEY_FIRST GP_UP
|
|
|
|
#define CONFIG_GPKEY_LAST GP_PAUSE
|
|
|
|
|
2012-08-03 07:06:19 +02:00
|
|
|
#define CONFIG_LOAD_BUFSIZE 256
|
2012-07-30 16:26:04 +02:00
|
|
|
|
2017-02-07 05:26:04 +01:00
|
|
|
int config_scan2key(int scan);
|
2012-08-15 02:41:21 +02:00
|
|
|
int config_button2gpkey(int btn);
|
|
|
|
int config_gpkey2key(int btn);
|
|
|
|
int config_button2key(int btn);
|
|
|
|
|
2012-08-10 22:08:51 +02:00
|
|
|
void config_preset(void);
|
2012-08-03 07:06:19 +02:00
|
|
|
void config_load(char *filename);
|
|
|
|
void config_save(char *filename);
|
|
|
|
ConfigEntry* config_findentry(char *name);
|
2012-08-16 18:15:46 +02:00
|
|
|
ConfigEntry* config_findentry_byid(int id);
|
2012-08-03 07:06:19 +02:00
|
|
|
|
2012-08-10 21:27:46 +02:00
|
|
|
int config_intval(char*);
|
|
|
|
int config_intval_p(ConfigEntry*);
|
|
|
|
char* config_strval(char*);
|
|
|
|
char* config_strval_p(ConfigEntry*);
|
2012-08-15 17:03:53 +02:00
|
|
|
float config_fltval(char*);
|
|
|
|
float config_fltval_p(ConfigEntry*);
|
2012-07-14 16:37:52 +02:00
|
|
|
|
2011-07-02 16:06:10 +02:00
|
|
|
#endif
|