Commit 16559c24 authored by nanahira's avatar nanahira

mergedef

parents 8e511e58 7f02a000
...@@ -1198,6 +1198,7 @@ void Game::LoadConfig() { ...@@ -1198,6 +1198,7 @@ void Game::LoadConfig() {
gameConf.defaultOT = atoi(valbuf); gameConf.defaultOT = atoi(valbuf);
} else if(!strcmp(strbuf, "enable_bot_mode")) { } else if(!strcmp(strbuf, "enable_bot_mode")) {
gameConf.enable_bot_mode = atoi(valbuf); gameConf.enable_bot_mode = atoi(valbuf);
#ifdef YGOPRO_USE_IRRKLANG
} else if(!strcmp(strbuf, "enable_sound")) { } else if(!strcmp(strbuf, "enable_sound")) {
gameConf.enable_sound = atoi(valbuf) > 0; gameConf.enable_sound = atoi(valbuf) > 0;
} else if(!strcmp(strbuf, "sound_volume")) { } else if(!strcmp(strbuf, "sound_volume")) {
...@@ -1208,6 +1209,7 @@ void Game::LoadConfig() { ...@@ -1208,6 +1209,7 @@ void Game::LoadConfig() {
gameConf.music_volume = atof(valbuf) / 100; gameConf.music_volume = atof(valbuf) / 100;
} else if(!strcmp(strbuf, "music_mode")) { } else if(!strcmp(strbuf, "music_mode")) {
gameConf.music_mode = atoi(valbuf); gameConf.music_mode = atoi(valbuf);
#endif
} else if(!strcmp(strbuf, "window_maximized")) { } else if(!strcmp(strbuf, "window_maximized")) {
gameConf.window_maximized = atoi(valbuf) > 0; gameConf.window_maximized = atoi(valbuf) > 0;
} else if(!strcmp(strbuf, "window_width")) { } else if(!strcmp(strbuf, "window_width")) {
...@@ -1303,6 +1305,7 @@ void Game::LoadConfig() { ...@@ -1303,6 +1305,7 @@ void Game::LoadConfig() {
gameConf.defaultOT = atoi(valbuf); gameConf.defaultOT = atoi(valbuf);
} else if(!strcmp(strbuf, "enable_bot_mode")) { } else if(!strcmp(strbuf, "enable_bot_mode")) {
gameConf.enable_bot_mode = atoi(valbuf); gameConf.enable_bot_mode = atoi(valbuf);
#ifdef YGOPRO_USE_IRRKLANG
} else if(!strcmp(strbuf, "enable_sound")) { } else if(!strcmp(strbuf, "enable_sound")) {
gameConf.enable_sound = atoi(valbuf) > 0; gameConf.enable_sound = atoi(valbuf) > 0;
} else if(!strcmp(strbuf, "sound_volume")) { } else if(!strcmp(strbuf, "sound_volume")) {
...@@ -1313,6 +1316,7 @@ void Game::LoadConfig() { ...@@ -1313,6 +1316,7 @@ void Game::LoadConfig() {
gameConf.music_volume = atof(valbuf) / 100; gameConf.music_volume = atof(valbuf) / 100;
} else if(!strcmp(strbuf, "music_mode")) { } else if(!strcmp(strbuf, "music_mode")) {
gameConf.music_mode = atoi(valbuf); gameConf.music_mode = atoi(valbuf);
#endif
} else if(!strcmp(strbuf, "window_maximized")) { } else if(!strcmp(strbuf, "window_maximized")) {
gameConf.window_maximized = atoi(valbuf) > 0; gameConf.window_maximized = atoi(valbuf) > 0;
} else if(!strcmp(strbuf, "window_width")) { } else if(!strcmp(strbuf, "window_width")) {
...@@ -1394,6 +1398,7 @@ void Game::SaveConfig() { ...@@ -1394,6 +1398,7 @@ void Game::SaveConfig() {
fprintf(fp, "ignore_deck_changes = %d\n", (chkIgnoreDeckChanges->isChecked() ? 1 : 0)); fprintf(fp, "ignore_deck_changes = %d\n", (chkIgnoreDeckChanges->isChecked() ? 1 : 0));
fprintf(fp, "default_ot = %d\n", gameConf.defaultOT); fprintf(fp, "default_ot = %d\n", gameConf.defaultOT);
fprintf(fp, "enable_bot_mode = %d\n", gameConf.enable_bot_mode); fprintf(fp, "enable_bot_mode = %d\n", gameConf.enable_bot_mode);
#ifdef YGOPRO_USE_IRRKLANG
fprintf(fp, "enable_sound = %d\n", (chkEnableSound->isChecked() ? 1 : 0)); fprintf(fp, "enable_sound = %d\n", (chkEnableSound->isChecked() ? 1 : 0));
fprintf(fp, "enable_music = %d\n", (chkEnableMusic->isChecked() ? 1 : 0)); fprintf(fp, "enable_music = %d\n", (chkEnableMusic->isChecked() ? 1 : 0));
fprintf(fp, "#Volume of sound and music, between 0 and 100\n"); fprintf(fp, "#Volume of sound and music, between 0 and 100\n");
...@@ -1404,6 +1409,7 @@ void Game::SaveConfig() { ...@@ -1404,6 +1409,7 @@ void Game::SaveConfig() {
if(vol < 0) vol = 0; else if(vol > 100) vol = 100; if(vol < 0) vol = 0; else if(vol > 100) vol = 100;
fprintf(fp, "music_volume = %d\n", vol); fprintf(fp, "music_volume = %d\n", vol);
fprintf(fp, "music_mode = %d\n", (chkMusicMode->isChecked() ? 1 : 0)); fprintf(fp, "music_mode = %d\n", (chkMusicMode->isChecked() ? 1 : 0));
#endif
fprintf(fp, "window_maximized = %d\n", (gameConf.window_maximized ? 1 : 0)); fprintf(fp, "window_maximized = %d\n", (gameConf.window_maximized ? 1 : 0));
fprintf(fp, "window_width = %d\n", gameConf.window_width); fprintf(fp, "window_width = %d\n", gameConf.window_width);
fprintf(fp, "window_height = %d\n", gameConf.window_height); fprintf(fp, "window_height = %d\n", gameConf.window_height);
...@@ -1617,6 +1623,7 @@ void Game::initUtils() { ...@@ -1617,6 +1623,7 @@ void Game::initUtils() {
MakeDirectory("textures/cover2"); MakeDirectory("textures/cover2");
MakeDirectory("textures/pscale"); MakeDirectory("textures/pscale");
//sound //sound
#ifdef YGOPRO_USE_IRRKLANG
MakeDirectory("sound"); MakeDirectory("sound");
MakeDirectory("sound/BGM"); MakeDirectory("sound/BGM");
MakeDirectory("sound/BGM/advantage"); MakeDirectory("sound/BGM/advantage");
...@@ -1629,6 +1636,7 @@ void Game::initUtils() { ...@@ -1629,6 +1636,7 @@ void Game::initUtils() {
//custom sound //custom sound
MakeDirectory("sound/custom"); MakeDirectory("sound/custom");
MakeDirectory("sound/BGM/custom"); MakeDirectory("sound/BGM/custom");
#endif
//pics //pics
MakeDirectory("pics"); MakeDirectory("pics");
MakeDirectory("pics/field"); MakeDirectory("pics/field");
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment