[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)) {
file_ropen(cfg_fn);
file_read(&cfg, sizeof(cfg));
rank = cfg.rank;
snd_bgm_mode = cfg.bgm_mode;
bombs = cfg.bombs;
lives = cfg.lives;
rank = cfg.opts.rank;
snd_bgm_mode = cfg.opts.bgm_mode;
bombs = cfg.opts.bombs;
lives = cfg.opts.lives;
mikoconfig_sgm = cfg.resident_sgm;
if(!mikoconfig_sgm) {
return 1;
}
mikoconfig = MK_FP(mikoconfig_sgm, 0);
mikoconfig->perf = cfg.perf;
mikoconfig->perf = cfg.opts.perf;
mikoconfig->debug = cfg.debug;
file_close();
@ -79,11 +79,11 @@ void cfg_save(void)
huuma_cfg_t cfg;
cfg.debug = 0;
cfg.rank = rank;
cfg.bgm_mode = snd_bgm_mode;
cfg.bombs = bombs;
cfg.lives = lives;
cfg.perf = mikoconfig->perf;
cfg.opts.rank = rank;
cfg.opts.bgm_mode = snd_bgm_mode;
cfg.opts.bombs = bombs;
cfg.opts.lives = lives;
cfg.opts.perf = mikoconfig->perf;
file_create(cfg_fn);
file_write(&cfg, offsetof(huuma_cfg_t, resident_sgm));

View File

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