From 547dafe07160280df5b6d7f73688a7306c8c6764 Mon Sep 17 00:00:00 2001 From: nmlgc Date: Tue, 8 Sep 2015 17:02:52 +0200 Subject: [PATCH] [Maintenance] [th02] Move the menu options in huuma_cfg_t to their own structure Necessary for ZUN_RES.COM. --- th02/op_01.c | 20 ++++++++++---------- th02/th02.h | 4 ++++ 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/th02/op_01.c b/th02/op_01.c index 54034e93..66186fd3 100644 --- a/th02/op_01.c +++ b/th02/op_01.c @@ -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)); diff --git a/th02/th02.h b/th02/th02.h index 8716b61c..9c16016e 100644 --- a/th02/th02.h +++ b/th02/th02.h @@ -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;