[Maintenance] [th02] Move the menu options in huuma_cfg_t to their own structure

Necessary for ZUN_RES.COM.
This commit is contained in:
nmlgc 2015-09-08 17:02:52 +02:00
parent 43001161e3
commit 547dafe071
2 changed files with 14 additions and 10 deletions

View File

@ -45,16 +45,16 @@ int cfg_load(void)
if(file_exist(cfg_fn)) { if(file_exist(cfg_fn)) {
file_ropen(cfg_fn); file_ropen(cfg_fn);
file_read(&cfg, sizeof(cfg)); file_read(&cfg, sizeof(cfg));
rank = cfg.rank; rank = cfg.opts.rank;
snd_bgm_mode = cfg.bgm_mode; snd_bgm_mode = cfg.opts.bgm_mode;
bombs = cfg.bombs; bombs = cfg.opts.bombs;
lives = cfg.lives; lives = cfg.opts.lives;
mikoconfig_sgm = cfg.resident_sgm; mikoconfig_sgm = cfg.resident_sgm;
if(!mikoconfig_sgm) { if(!mikoconfig_sgm) {
return 1; return 1;
} }
mikoconfig = MK_FP(mikoconfig_sgm, 0); mikoconfig = MK_FP(mikoconfig_sgm, 0);
mikoconfig->perf = cfg.perf; mikoconfig->perf = cfg.opts.perf;
mikoconfig->debug = cfg.debug; mikoconfig->debug = cfg.debug;
file_close(); file_close();
@ -79,11 +79,11 @@ void cfg_save(void)
huuma_cfg_t cfg; huuma_cfg_t cfg;
cfg.debug = 0; cfg.debug = 0;
cfg.rank = rank; cfg.opts.rank = rank;
cfg.bgm_mode = snd_bgm_mode; cfg.opts.bgm_mode = snd_bgm_mode;
cfg.bombs = bombs; cfg.opts.bombs = bombs;
cfg.lives = lives; cfg.opts.lives = lives;
cfg.perf = mikoconfig->perf; cfg.opts.perf = mikoconfig->perf;
file_create(cfg_fn); file_create(cfg_fn);
file_write(&cfg, offsetof(huuma_cfg_t, resident_sgm)); file_write(&cfg, offsetof(huuma_cfg_t, resident_sgm));

View File

@ -211,6 +211,10 @@ typedef struct {
char bombs; char bombs;
char lives; char lives;
char perf; char perf;
} huuma_options_t;
typedef struct {
huuma_options_t opts;
int resident_sgm; int resident_sgm;
char debug; char debug;
} huuma_cfg_t; } huuma_cfg_t;