OSDN Git Service

[Refactor] #37353 コメント整理 / Refactor comments.
[hengband/hengband.git] / src / main-win.c
index 9156763..d31b397 100644 (file)
 * <p>\r
 * The "Term_xtra_win_clear()" function should probably do a low-level\r
 * clear of the current window, and redraw the borders and other things,\r
-* if only for efficiency.  XXX XXX XXX\r
+* if only for efficiency.  \r
 * </p>\r
 *\r
 * <p>\r
 * A simpler method is needed for selecting the "tile size" for windows.\r
-* XXX XXX XXX\r
 * </p>\r
 *\r
 * <p>\r
 * window, I think, and only a few calls actually check for its existance,\r
 * this may be okay since "NULL" means "on top of all windows". (?)  The\r
 * user must never be allowed to "hide" the main window, or the "menubar"\r
-* will disappear.  XXX XXX XXX\r
+* will disappear.  \r
 * </p>\r
 *\r
 * <p>\r
 * Special "Windows Help Files" can be placed into "lib/xtra/help/" for\r
 * use with the "winhelp.exe" program.  These files *may* be available\r
-* at the ftp site somewhere, but I have not seen them.  XXX XXX XXX\r
+* at the ftp site somewhere, but I have not seen them.  \r
 * </p>\r
 *\r
 * <p>\r
 #endif\r
 \r
 /*\r
- * Hack -- Fake declarations from "dos.h" XXX XXX XXX\r
+ * Hack -- Fake declarations from "dos.h" \r
  */\r
 #ifdef WIN32\r
 #define INVALID_FILE_NAME (DWORD)0xFFFFFFFF\r
@@ -434,7 +433,7 @@ struct _term_data
 \r
 };\r
 \r
-#define MAX_TERM_DATA 8        //!< Maximum number of windows XXX XXX XXX\r
+#define MAX_TERM_DATA 8        //!< Maximum number of windows \r
 \r
 static term_data data[MAX_TERM_DATA]; //!< An array of term_data's\r
 static term_data *my_td; //!< Hack -- global "window creation" pointer\r
@@ -900,8 +899,6 @@ static char *analyze_font(char *path, int *wp, int *hp)
        /* Save results */\r
        (*wp) = wid;\r
        (*hp) = hgt;\r
-\r
-       /* Result */\r
        return (p);\r
 }\r
 #endif\r
@@ -1070,7 +1067,6 @@ static void term_getsize(term_data *td)
        rc.top = 0;\r
        rc.bottom = rc.top + hgt;\r
 \r
-       /* XXX XXX XXX */\r
        /* rc.right += 1; */\r
        /* rc.bottom += 1; */\r
 \r
@@ -1358,7 +1354,7 @@ static void load_prefs(void)
 #if defined(USE_SOUND) || defined(USE_MUSIC)\r
 \r
 /*\r
- * XXX XXX XXX - Taken from files.c.\r
+ * - Taken from files.c.\r
  *\r
  * Extract "tokens" from a buffer\r
  *\r
@@ -1780,17 +1776,14 @@ static bool init_graphics(void)
        /* Activate a palette */\r
        if (!new_palette())\r
        {\r
-               /* Free bitmap XXX XXX XXX */\r
+               /* Free bitmap */\r
 \r
-               /* Oops */\r
                plog(_("パレットを実現できません!", "Cannot activate palette!"));\r
                return (FALSE);\r
        }\r
 \r
        /* Graphics available */\r
        current_graphics_mode = arg_graphics;\r
-\r
-       /* Result */\r
        return (current_graphics_mode);\r
 }\r
 #endif /* USE_GRAPHICS */\r
@@ -1811,8 +1804,6 @@ static bool init_music(void)
                /* Sound available */\r
                can_use_music = TRUE;\r
        }\r
-\r
-       /* Result */\r
        return (can_use_music);\r
 }\r
 \r
@@ -1842,8 +1833,6 @@ static bool init_sound(void)
                /* Sound available */\r
                can_use_sound = TRUE;\r
        }\r
-\r
-       /* Result */\r
        return (can_use_sound);\r
 }\r
 #endif /* USE_SOUND */\r
@@ -2384,7 +2373,7 @@ static errr Term_xtra_win_flush(void)
 /*\r
  * Hack -- clear the screen\r
  *\r
- * Make this more efficient XXX XXX XXX\r
+ * Make this more efficient \r
  */\r
 static errr Term_xtra_win_clear(void)\r
 {\r
@@ -2473,7 +2462,6 @@ static errr Term_xtra_win_sound(int v)
 \r
 #else /* USE_SOUND */\r
 \r
-       /* Oops */\r
        return (1);\r
 \r
 #endif /* USE_SOUND */\r
@@ -2695,7 +2683,6 @@ static errr Term_xtra_win(int n, int v)
                }\r
        }\r
 \r
-       /* Oops */\r
        return 1;\r
 }\r
 \r
@@ -2826,7 +2813,7 @@ static errr Term_wipe_win(int x, int y, int n)
  *\r
  * One would think there is a more efficient method for telling a window\r
  * what color it should be using to draw with, but perhaps simply changing\r
- * it every time is not too inefficient.  XXX XXX XXX\r
+ * it every time is not too inefficient.  \r
  */\r
 static errr Term_text_win(int x, int y, int n, TERM_COLOR a, const char *s)\r
 {\r
@@ -3087,7 +3074,7 @@ static errr Term_pict_win(TERM_LEN x, TERM_LEN y, int n, const TERM_COLOR *ap, c
        /* Draw attr/char pairs */\r
        for (i = 0; i < n; i++, x2 += w2)\r
        {\r
-               byte a = ap[i];\r
+               TERM_COLOR a = ap[i];\r
                char c = cp[i];\r
 \r
 \r
@@ -3191,12 +3178,12 @@ static errr Term_pict_win(TERM_LEN x, TERM_LEN y, int n, const TERM_COLOR *ap, c
 static void windows_map(void)\r
 {\r
        term_data *td = &data[0];\r
-       byte a;\r
+       TERM_COLOR a;\r
        char c;\r
-       int x, min_x, max_x;\r
-       int y, min_y, max_y;\r
+       TERM_LEN x, min_x, max_x;\r
+       TERM_LEN y, min_y, max_y;\r
 \r
-       byte ta;\r
+       TERM_COLOR ta;\r
        char tc;\r
 \r
        /* Only in graphics mode */\r
@@ -3297,7 +3284,7 @@ static void term_data_link(term_data *td)
  * to over-ride selected values, then create the windows, and fonts.\r
  *\r
  * Must use SW_SHOW not SW_SHOWNA, since on 256 color display\r
- * must make active to realize the palette.  XXX XXX XXX\r
+ * must make active to realize the palette.  \r
  */\r
 static void init_windows(void)\r
 {\r
@@ -3402,7 +3389,6 @@ static void init_windows(void)
                        /* Force the use of that font */\r
                        (void)term_force_font(td, buf);\r
 \r
-                       /* Oops */\r
                        td->tile_wid = 8;\r
                        td->tile_hgt = 13;\r
 \r
@@ -3487,7 +3473,7 @@ static void init_windows(void)
        SetWindowPos(td->w, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);\r
 \r
 \r
-       /* New palette XXX XXX XXX */\r
+       /* New palette */\r
        (void)new_palette();\r
 \r
 \r
@@ -3915,7 +3901,6 @@ static void process_menus(WORD wCmd)
                        }\r
                        else\r
                        {\r
-                               /* Save Screen */\r
                                screen_save();\r
 \r
                                /* Clear screen */\r
@@ -4457,7 +4442,7 @@ static void process_menus(WORD wCmd)
 \r
                                if (hwndSaver)\r
                                {\r
-                                       /* Push the window to the bottom XXX XXX XXX */\r
+                                       /* Push the window to the bottom */\r
                                        SetWindowPos(hwndSaver, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);\r
                                }\r
                                else\r
@@ -4487,14 +4472,8 @@ static void process_menus(WORD wCmd)
                        }\r
                        else\r
                        {\r
-#ifdef JP\r
-                               plog_fmt("ヘルプファイル[%s]が見付かりません。", tmp);\r
-                               plog("代わりにオンラインヘルプを使用してください。");\r
-#else\r
-                               plog_fmt("Cannot find help file: %s", tmp);\r
-                               plog("Use the online help files instead.");\r
-#endif\r
-\r
+                               plog_fmt(_("ヘルプファイル[%s]が見付かりません。", "Cannot find help file: %s"), tmp);\r
+                               plog(_("代わりにオンラインヘルプを使用してください。", "Use the online help files instead."));\r
                        }\r
                        break;\r
 #else /* HTML_HELP */\r
@@ -4508,13 +4487,8 @@ static void process_menus(WORD wCmd)
                        }\r
                        else\r
                        {\r
-#ifdef JP\r
-                               plog_fmt("ヘルプファイル[%s]が見付かりません。", tmp);\r
-                               plog("代わりにオンラインヘルプを使用してください。");\r
-#else\r
-                               plog_fmt("Cannot find help file: %s", tmp);\r
-                               plog("Use the online help files instead.");\r
-#endif\r
+                               plog_fmt(_("ヘルプファイル[%s]が見付かりません。", "Cannot find help file: %s"), tmp);\r
+                               plog(_("代わりにオンラインヘルプを使用してください。", "Use the online help files instead."));\r
 \r
                        }\r
                        break;\r
@@ -4621,8 +4595,7 @@ LRESULT FAR PASCAL AngbandWndProc(HWND hWnd, UINT uMsg,
 LRESULT FAR PASCAL AngbandWndProc(HWND hWnd, UINT uMsg,\r
                                  WPARAM wParam, LPARAM lParam)\r
 #else /* __MWERKS__ */\r
-LRESULT FAR PASCAL AngbandWndProc(HWND hWnd, UINT uMsg,\r
-                                         WPARAM wParam, LPARAM lParam)\r
+LRESULT FAR PASCAL AngbandWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)\r
 #endif /* __MWERKS__ */\r
 {\r
        PAINTSTRUCT ps;\r
@@ -4641,14 +4614,12 @@ LRESULT FAR PASCAL AngbandWndProc(HWND hWnd, UINT uMsg,
        /* Handle message */\r
        switch (uMsg)\r
        {\r
-               /* XXX XXX XXX */\r
                case WM_NCCREATE:\r
                {\r
                        SetWindowLong(hWnd, 0, (LONG)(my_td));\r
                        break;\r
                }\r
 \r
-               /* XXX XXX XXX */\r
                case WM_CREATE:\r
                {\r
 #ifdef USE_MUSIC\r
@@ -4936,7 +4907,7 @@ LRESULT FAR PASCAL AngbandWndProc(HWND hWnd, UINT uMsg,
 \r
                                case SIZE_MAXIMIZED:\r
                                {\r
-                                       /* fall through XXX XXX XXX */\r
+                                       /* fall through */\r
                                }\r
 \r
                                case SIZE_RESTORED:\r
@@ -5079,14 +5050,12 @@ LRESULT FAR PASCAL AngbandListProc(HWND hWnd, UINT uMsg,
        /* Process message */\r
        switch (uMsg)\r
        {\r
-               /* XXX XXX XXX */\r
                case WM_NCCREATE:\r
                {\r
                        SetWindowLong(hWnd, 0, (LONG)(my_td));\r
                        break;\r
                }\r
 \r
-               /* XXX XXX XXX */\r
                case WM_CREATE:\r
                {\r
                        return 0;\r
@@ -5260,7 +5229,6 @@ LRESULT FAR PASCAL AngbandSaverProc(HWND hWnd, UINT uMsg,
        /* Process */\r
        switch (uMsg)\r
        {\r
-               /* XXX XXX XXX */\r
                case WM_NCCREATE:\r
                {\r
                        break;\r
@@ -5322,7 +5290,6 @@ LRESULT FAR PASCAL AngbandSaverProc(HWND hWnd, UINT uMsg,
                }\r
        }\r
 \r
-       /* Oops */\r
        return DefWindowProc(hWnd, uMsg, wParam, lParam);\r
 }\r
 \r
@@ -5434,7 +5401,7 @@ static void hook_quit(cptr str)
        save_prefs();\r
 \r
 \r
-       /*** Could use 'Term_nuke_win()' XXX XXX XXX */\r
+       /*** Could use 'Term_nuke_win()' */\r
 \r
        /* Destroy all windows */\r
        for (i = MAX_TERM_DATA - 1; i >= 0; --i)\r
@@ -5489,7 +5456,7 @@ static void init_stuff(void)
        /* Get program name with full path */\r
        GetModuleFileName(hInstance, path, 512);\r
 \r
-       /* Save the "program name" XXX XXX XXX */\r
+       /* Save the "program name" */\r
        argv0 = path;\r
 \r
        /* Get the name of the "*.ini" file */\r
@@ -5667,7 +5634,6 @@ int FAR PASCAL WinMain(HINSTANCE hInst, HINSTANCE hPrevInst,
                return FALSE;\r
        }\r
 \r
-       /* Initialize */\r
        if (hPrevInst == NULL)\r
        {\r
                wc.style         = CS_CLASSDC;\r
@@ -5782,7 +5748,6 @@ int FAR PASCAL WinMain(HINSTANCE hInst, HINSTANCE hPrevInst,
        /* Catch nasty signals */\r
        signals_init();\r
 \r
-       /* Initialize */\r
        Term_activate(term_screen);\r
        init_angband();\r
 \r