OSDN Git Service

[Refactor] include整理、不要な定義削除
authorshimitei <shimitei@gmail.com>
Fri, 19 Mar 2021 22:51:25 +0000 (07:51 +0900)
committershimitei <shimitei@gmail.com>
Sat, 20 Mar 2021 04:09:03 +0000 (13:09 +0900)
ifdef WINDOWSは最初に配置する。
windows.hが2回includeされているので1回にする。
WIN32_LEAN_AND_MEANでwindows.hをincludeするとMCI関連が抜けるためmciapi.hのincludeを追加した。
他、不要なinclude、define、プロトタイプ関数宣言を削除した。

src/main-win.cpp

index ec4c3b7..352ad68 100644 (file)
@@ -89,6 +89,7 @@
  * </p>
  */
 
+#ifdef WINDOWS
 #include "autopick/autopick-pref-processor.h"
 #include "cmd-io/cmd-process-screen.h"
 #include "cmd-io/cmd-save.h"
 #include "dungeon/quest.h"
 #include "floor/floor-base-definitions.h"
 #include "floor/floor-events.h"
-#include "game-option/game-play-options.h"
 #include "game-option/runtime-arguments.h"
 #include "game-option/special-options.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 "main/sound-definitions-table.h"
 #include "main/sound-of-music.h"
 #include "monster-floor/monster-lite.h"
+#include "save/save.h"
 #include "system/angband-version.h"
 #include "system/angband.h"
 #include "system/floor-type-definition.h"
 #include "wizard/wizard-spoiler.h"
 #include "world/world.h"
 
-#ifdef WINDOWS
-#include "dungeon/dungeon.h"
-#include "save/save.h"
 #include <direct.h>
 #include <locale.h>
+/*
+ * Exclude parts of WINDOWS.H that are not needed (Win32)
+ */
+#define WIN32_LEAN_AND_MEAN
+#define NONLS /* All NLS defines and routines */
+#define NOSERVICE /* All Service Controller routines, SERVICE_ equates, etc. */
+#define NOMCX /* Modem Configuration Extensions */
+
+/*
+ * Include the "windows" support file
+ */
 #include <windows.h>
 
 /*
+ * Exclude parts of MMSYSTEM.H that are not needed
+ */
+#define MMNODRV /* Installable driver support */
+#define MMNOWAVE /* Waveform support */
+#define MMNOMIDI /* MIDI support */
+#define MMNOAUX /* Auxiliary audio support */
+#define MMNOTIMER /* Timer support */
+#define MMNOJOY /* Joystick support */
+#define MMNOMCI /* MCI support */
+#define MMNOMMIO /* Multimedia file I/O support */
+
+/*
+ * Include some more files. Note: the Cygnus Cygwin compiler
+ * doesn't use mmsystem.h instead it includes the winmm library
+ * which performs a similar function.
+ */
+#include <commdlg.h>
+#include <mmsystem.h>
+#include <mciapi.h>
+
+/*
+ * Include the support for loading bitmaps
+ */
+#include "term/readdib.h"
+
+#define INVALID_FILE_NAME (DWORD)0xFFFFFFFF
+#define MOUSE_SENS 40
+
+/*
  * Available graphic modes
  */
 #define GRAPHICS_NONE 0
 #define IDM_HELP_CONTENTS 901
 
 /*
- * Exclude parts of WINDOWS.H that are not needed (Win32)
- */
-#define WIN32_LEAN_AND_MEAN
-#define NONLS /* All NLS defines and routines */
-#define NOSERVICE /* All Service Controller routines, SERVICE_ equates, etc. */
-#define NOMCX /* Modem Configuration Extensions */
-
-/*
- * Include the "windows" support file
- */
-#include <windows.h>
-
-/*
- * Exclude parts of MMSYSTEM.H that are not needed
- */
-#define MMNODRV /* Installable driver support */
-#define MMNOWAVE /* Waveform support */
-#define MMNOMIDI /* MIDI support */
-#define MMNOAUX /* Auxiliary audio support */
-#define MMNOTIMER /* Timer support */
-#define MMNOJOY /* Joystick support */
-#define MMNOMCI /* MCI support */
-#define MMNOMMIO /* Multimedia file I/O support */
-
-#define INVALID_FILE_NAME (DWORD)0xFFFFFFFF
-#define MOUSE_SENS 40
-
-/*
- * Include some more files. Note: the Cygnus Cygwin compiler
- * doesn't use mmsystem.h instead it includes the winmm library
- * which performs a similar function.
- */
-#include <commdlg.h>
-#include <mmsystem.h>
-
-/*
- * Include the support for loading bitmaps
- */
-#include "term/readdib.h"
-
-#define MoveTo(H, X, Y) MoveToEx(H, X, Y, NULL)
-
-/*
  * Foreground color bits
  */
 #define VID_BLACK 0x00
@@ -565,10 +559,6 @@ static byte ignore_key_list[] = {
     VK_SHIFT, VK_CONTROL, VK_MENU, VK_LWIN, VK_RWIN, VK_LSHIFT, VK_RSHIFT, VK_LCONTROL, VK_RCONTROL, VK_LMENU, VK_RMENU, 0 /* End of List */
 };
 
-/* Function prototype */
-
-static bool is_already_running(void);
-
 /* bg */
 static void delete_bg(void)
 {