OSDN Git Service

v3.0.0 Alpha5 OSDN最終版
[hengband/hengband.git] / src / main-win.c
index 51d20c6..d50d04f 100644 (file)
 #include "floor/floor-events.h"
 #include "game-option/runtime-arguments.h"
 #include "game-option/special-options.h"
-#include "io/record-play-movie.h"
 #include "io/files-util.h"
 #include "io/inet.h"
 #include "io/input-key-acceptor.h"
+#include "io/record-play-movie.h"
 #include "io/signal-handlers.h"
 #include "io/write-diary.h"
 #include "main/angband-initializer.h"
@@ -817,6 +817,7 @@ static void save_prefs(void)
     strcpy(buf, use_bg ? "1" : "0");
     WritePrivateProfileString("Angband", "BackGround", buf, ini_file);
     WritePrivateProfileString("Angband", "BackGroundBitmap", bg_bitmap_file[0] != '\0' ? bg_bitmap_file : "bg.bmp", ini_file);
+    WritePrivateProfileString("Angband", "SaveFile", savefile, ini_file);
 
     for (int i = 0; i < MAX_TERM_DATA; ++i) {
         save_prefs_aux(i);
@@ -892,6 +893,7 @@ static void load_prefs(void)
     arg_music = (GetPrivateProfileInt("Angband", "Music", 0, ini_file) != 0);
     use_bg = GetPrivateProfileInt("Angband", "BackGround", 0, ini_file);
     GetPrivateProfileString("Angband", "BackGroundBitmap", "bg.bmp", bg_bitmap_file, 1023, ini_file);
+    GetPrivateProfileString("Angband", "SaveFile", "", savefile, 1023, ini_file);
     for (int i = 0; i < MAX_TERM_DATA; ++i) {
         load_prefs_aux(i);
     }
@@ -945,15 +947,17 @@ static void load_sound_prefs(void)
     char wav_path[1024];
     char *zz[SAMPLE_SOUND_MAX];
 
-    path_build(ini_path, 1024, ANGBAND_DIR_XTRA_SOUND, "sound.cfg");
+    path_build(ini_path, 1024, ANGBAND_DIR_XTRA_SOUND, "sound_debug.cfg");
+    if (GetPrivateProfileString("Device", "type", "", mci_device_type, 256, ini_path) == 0) {
+        path_build(ini_path, 1024, ANGBAND_DIR_XTRA_SOUND, "sound.cfg");
+        GetPrivateProfileString("Device", "type", "", mci_device_type, 256, ini_path);
+    }
+
     for (int i = 0; i < SOUND_MAX; i++) {
         GetPrivateProfileString("Sound", angband_sound_name[i], "", tmp, 1024, ini_path);
         int num = tokenize_whitespace(tmp, SAMPLE_SOUND_MAX, zz);
         for (int j = 0; j < num; j++) {
-            /* Access the sound */
             path_build(wav_path, 1024, ANGBAND_DIR_XTRA_SOUND, zz[j]);
-
-            /* Save the sound filename, if it exists */
             if (check_file(wav_path))
                 sound_file[i][j] = string_make(zz[j]);
         }
@@ -968,8 +972,12 @@ static void load_music_prefs(void)
     char *zz[SAMPLE_MUSIC_MAX];
     char key[80];
 
-    path_build(ini_path, 1024, ANGBAND_DIR_XTRA_MUSIC, "music.cfg");
-    GetPrivateProfileString("Device", "type", "", mci_device_type, 256, ini_path);
+    path_build(ini_path, 1024, ANGBAND_DIR_XTRA_MUSIC, "music_debug.cfg");
+    if (GetPrivateProfileString("Device", "type", "", mci_device_type, 256, ini_path) == 0) {
+        path_build(ini_path, 1024, ANGBAND_DIR_XTRA_MUSIC, "music.cfg");
+        GetPrivateProfileString("Device", "type", "", mci_device_type, 256, ini_path);
+    }
+
     for (int i = 0; i < MUSIC_BASIC_MAX; i++) {
         GetPrivateProfileString("Basic", angband_music_basic_name[i], "", tmp, 1024, ini_path);
         int num = tokenize_whitespace(tmp, SAMPLE_MUSIC_MAX, zz);
@@ -1972,7 +1980,7 @@ static void windows_map(player_type *player_ptr)
 static void term_data_link(term_data *td)
 {
     term_type *t = &td->t;
-    term_init(t, td->cols, td->rows, td->keys);
+    term_init(t, td->cols, td->rows, FILE_READ_BUFF_SIZE);
     t->soft_cursor = TRUE;
     t->higher_pict = TRUE;
     t->attr_blank = TERM_WHITE;
@@ -2073,8 +2081,8 @@ static void init_windows(void)
         td = &data[i];
 
         my_td = td;
-        td->w = CreateWindowEx(
-            td->dwExStyle, AngList, td->s, td->dwStyle, td->pos_x, td->pos_y, td->size_wid, td->size_hgt, HWND_DESKTOP, NULL, hInstance, NULL);
+        td->w
+            = CreateWindowEx(td->dwExStyle, AngList, td->s, td->dwStyle, td->pos_x, td->pos_y, td->size_wid, td->size_hgt, HWND_DESKTOP, NULL, hInstance, NULL);
         my_td = NULL;
 
         if (!td->w)
@@ -2289,6 +2297,7 @@ static void process_menus(player_type *player_ptr, WORD wCmd)
         } else {
             game_in_progress = TRUE;
             term_flush();
+            strcpy(savefile, "");
             play_game(player_ptr, TRUE, FALSE);
             quit(NULL);
         }
@@ -3050,7 +3059,7 @@ LRESULT PASCAL AngbandWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam
         p_ptr->panic_save = 1;
         signals_ignore_tstp();
         (void)strcpy(p_ptr->died_from, _("(緊急セーブ)", "(panic save)"));
-        (void)save_player(p_ptr);
+        (void)save_player(p_ptr, SAVE_TYPE_CLOSE_GAME);
         quit(NULL);
         return 0;
     }
@@ -3459,6 +3468,7 @@ static void init_stuff(void)
     validate_dir(ANGBAND_DIR_INFO, FALSE);
     validate_dir(ANGBAND_DIR_PREF, TRUE);
     validate_dir(ANGBAND_DIR_SAVE, FALSE);
+    validate_dir(ANGBAND_DIR_DEBUG_SAVE, FALSE);
     validate_dir(ANGBAND_DIR_USER, TRUE);
     validate_dir(ANGBAND_DIR_XTRA, TRUE);
     path_build(path, sizeof(path), ANGBAND_DIR_FILE, _("news_j.txt", "news.txt"));