OSDN Git Service

[Feature] 啓蒙/周辺感知で壁の中の壁も感知する / 壁に囲まれた壁を表示するオプション #643
[hengbandforosx/hengbandosx.git] / src / main-win.cpp
index e14f845..639502d 100644 (file)
@@ -1,9 +1,9 @@
 /*!
- * todo main関数を含むファイルの割に長過ぎる。main-win-utils.cなどといった形で分割したい
  * @file main-win.cpp
  * @brief Windows版固有実装(メインエントリポイント含む)
  * @date 2018/03/16
  * @author Hengband Team
+ * @todo main関数を含むファイルの割に長過ぎる。main-win-utils.cなどといった形で分割したい
  * @details
  *
  * <h3>概要</h3>
@@ -984,8 +984,8 @@ static void init_background(void)
     }
 }
 
-/*
- * Resize a window
+/*!
+ * @brief Resize a window
  */
 static void term_window_resize(term_data *td)
 {
@@ -996,12 +996,12 @@ static void term_window_resize(term_data *td)
     InvalidateRect(td->w, NULL, TRUE);
 }
 
-/*
- * todo 引数のpathを消す
- * Force the use of a new "font file" for a term_data.
+/*!
+ * @brief Force the use of a new "font file" for a term_data.
  * This function may be called before the "window" is ready.
  * This function returns zero only if everything succeeds.
- * Note that the "font name" must be capitalized!!!
+ * @note that the "font name" must be capitalized!!!
+ * @todo 引数のpathを消す
  */
 static errr term_force_font(term_data *td, concptr path)
 {
@@ -1266,10 +1266,6 @@ static errr term_xtra_win_sound(int v)
  */
 static errr term_xtra_win_music(int n, int v)
 {
-    // FIXME use_musicの値に関わらずミュートを実行している
-    if (n == TERM_XTRA_MUSIC_MUTE)
-        main_win_music::stop_music();
-
     if (!use_music) {
         return 1;
     }
@@ -1278,6 +1274,19 @@ static errr term_xtra_win_music(int n, int v)
 }
 
 /*
+ * Hack -- play a music matches a situation
+ */
+static errr term_xtra_win_scene()
+{
+    // TODO 場面に合った壁紙変更対応
+    if (!use_music) {
+        return 1;
+    }
+
+    return main_win_music::play_music_scene();
+}
+
+/*
  * Delay for "x" milliseconds
  */
 static int term_xtra_win_delay(int v)
@@ -1286,9 +1295,9 @@ static int term_xtra_win_delay(int v)
     return 0;
 }
 
-/*
- * todo z-termに影響があるのでplayer_typeの追加は保留
- * Do a "special thing"
+/*!
+ * @brief Do a "special thing"
+ * @todo z-termに影響があるのでplayer_typeの追加は保留
  */
 static errr term_xtra_win(int n, int v)
 {
@@ -1299,9 +1308,14 @@ static errr term_xtra_win(int n, int v)
     case TERM_XTRA_MUSIC_BASIC:
     case TERM_XTRA_MUSIC_DUNGEON:
     case TERM_XTRA_MUSIC_QUEST:
-    case TERM_XTRA_MUSIC_TOWN:
+    case TERM_XTRA_MUSIC_TOWN: {
+        return term_xtra_win_music(n, v);
+    }
     case TERM_XTRA_MUSIC_MUTE: {
-        return (term_xtra_win_music(n, v));
+        return main_win_music::stop_music();
+    }
+    case TERM_XTRA_SCENE: {
+        return term_xtra_win_scene();
     }
     case TERM_XTRA_SOUND: {
         return (term_xtra_win_sound(v));
@@ -2557,7 +2571,7 @@ static bool process_keydown(WPARAM wParam, LPARAM lParam)
 }
 
 /*!
- * todo WNDCLASSに影響があるのでplayer_type*の追加は保留
+ * @todo WNDCLASSに影響があるのでplayer_type*の追加は保留
  */
 LRESULT PASCAL AngbandWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 {
@@ -2571,7 +2585,7 @@ LRESULT PASCAL AngbandWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam
         break;
     }
     case WM_CREATE: {
-        mop.dwCallback = (DWORD)hWnd;
+        setup_mci(hWnd);
         return 0;
     }
     case WM_GETMINMAXINFO: {
@@ -2602,10 +2616,7 @@ LRESULT PASCAL AngbandWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam
         return 0;
     }
     case MM_MCINOTIFY: {
-        if (wParam == MCI_NOTIFY_SUCCESSFUL) {
-            mciSendCommand(mop.wDeviceID, MCI_SEEK, MCI_SEEK_TO_START, 0);
-            mciSendCommand(mop.wDeviceID, MCI_PLAY, MCI_NOTIFY, (DWORD)&mop);
-        }
+        main_win_music::on_mci_notify(wParam, lParam);
 
         return 0;
     }
@@ -2782,7 +2793,7 @@ LRESULT PASCAL AngbandWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam
         if (td->size_hack)
             return 1;
 
-        // todo 二重のswitch文。後で分割する.
+        //!< @todo 二重のswitch文。後で分割する.
         switch (wParam) {
         case SIZE_MINIMIZED: {
             for (int i = 1; i < MAX_TERM_DATA; i++) {
@@ -2883,7 +2894,7 @@ LRESULT PASCAL AngbandWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam
 }
 
 /*!
- * todo WNDCLASSに影響があるのでplayer_type*の追加は保留
+ * @todo WNDCLASSに影響があるのでplayer_type*の追加は保留
  */
 LRESULT PASCAL AngbandListProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
 {
@@ -3229,7 +3240,7 @@ static spoiler_output_status create_debug_spoiler(LPSTR cmd_line)
 }
 
 /*!
- * todo よく見るとhMutexはちゃんと使われていない……?
+ * @todo よく見るとhMutexはちゃんと使われていない……?
  * @brief (Windows固有)変愚蛮怒が起動済かどうかのチェック
  */
 static bool is_already_running(void)