mirror of
https://github.com/kichikuou/system3-sdl2.git
synced 2026-10-13 09:48:15 +03:00
Introduce Config struct
For now, it's just a container for command line arguments.
This commit is contained in:
+10
-9
@@ -10,6 +10,7 @@
|
||||
#include "mako.h"
|
||||
#include "msgskip.h"
|
||||
#include "dri.h"
|
||||
#include "../config.h"
|
||||
#include "../fileio.h"
|
||||
#include "crc32.h"
|
||||
|
||||
@@ -17,7 +18,7 @@ extern SDL_Window* g_window;
|
||||
|
||||
// 初期化
|
||||
|
||||
NACT::NACT(int sys_ver, uint32 crc32_a, uint32 crc32_b, const char* font_file, const MAKOConfig& mako_config)
|
||||
NACT::NACT(int sys_ver, uint32 crc32_a, uint32 crc32_b, const Config& config)
|
||||
: sys_ver(sys_ver), crc32_a(crc32_a), crc32_b(crc32_b), lang(get_language())
|
||||
{
|
||||
platform_initialize();
|
||||
@@ -84,8 +85,8 @@ NACT::NACT(int sys_ver, uint32 crc32_a, uint32 crc32_b, const char* font_file, c
|
||||
memset(pcm, 0, sizeof(pcm));
|
||||
|
||||
// 各種クラス生成
|
||||
ags = new AGS(this, font_file);
|
||||
mako = new MAKO(this, mako_config);
|
||||
ags = new AGS(this, config);
|
||||
mako = new MAKO(this, config);
|
||||
msgskip = new MsgSkip(this);
|
||||
|
||||
#ifdef USE_JOY
|
||||
@@ -538,16 +539,16 @@ void NACT::fatal(const char* format, ...) {
|
||||
fatal_error = true;
|
||||
}
|
||||
|
||||
NACT* NACT::create(const char* game_id, const char* font_file, const MAKOConfig& mako_config) {
|
||||
uint32 crc32_a = NACT::calc_crc32("ADISK.DAT", game_id);
|
||||
uint32 crc32_b = NACT::calc_crc32("BDISK.DAT", game_id);
|
||||
NACT* NACT::create(const Config& config) {
|
||||
uint32 crc32_a = NACT::calc_crc32("ADISK.DAT", config.game_id);
|
||||
uint32 crc32_b = NACT::calc_crc32("BDISK.DAT", config.game_id);
|
||||
int sys_ver = NACT::get_sys_ver(crc32_a, crc32_b);
|
||||
switch (sys_ver) {
|
||||
case 1:
|
||||
return new NACT_Sys1(crc32_a, crc32_b, font_file, mako_config);
|
||||
return new NACT_Sys1(crc32_a, crc32_b, config);
|
||||
case 2:
|
||||
return new NACT_Sys2(crc32_a, crc32_b, font_file, mako_config);
|
||||
return new NACT_Sys2(crc32_a, crc32_b, config);
|
||||
default:
|
||||
return new NACT_Sys3(crc32_a, crc32_b, font_file, mako_config);
|
||||
return new NACT_Sys3(crc32_a, crc32_b, config);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user