* <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
\r
#define IDM_HELP_CONTENTS 901\r
\r
-\r
-\r
-/*\r
- * This may need to be removed for some compilers XXX XXX XXX\r
- */\r
-#if 0\r
-#define STRICT\r
-#endif\r
-\r
/*\r
* Exclude parts of WINDOWS.H that are not needed\r
*/\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
struct _term_data\r
{\r
term t;\r
-\r
cptr s;\r
-\r
HWND w;\r
-\r
DWORD dwStyle;\r
DWORD dwExStyle;\r
\r
uint keys;\r
-\r
- TERM_POSITION rows; /* int -> uint */\r
- TERM_POSITION cols;\r
+ TERM_LEN rows; /* int -> uint */\r
+ TERM_LEN cols;\r
\r
uint pos_x; //!< タームの左上X座標\r
uint pos_y; //!< タームの左上Y座標\r
uint size_oh2;\r
\r
bool size_hack;\r
-\r
bool xtra_hack;\r
-\r
bool visible;\r
-\r
bool bizarre;\r
-\r
cptr font_want;\r
-\r
cptr font_file;\r
-\r
HFONT font_id;\r
-\r
int font_wid; //!< フォント横幅\r
int font_hgt; //!< フォント縦幅\r
-\r
int tile_wid; //!< タイル横幅\r
int tile_hgt; //!< タイル縦幅\r
\r
\r
bool posfix;\r
\r
-/* bg */\r
-#if 0\r
- char *bgfile;\r
- int use_bg;\r
-#endif\r
};\r
\r
+#define MAX_TERM_DATA 8 //!< Maximum number of windows \r
\r
-/*\r
- * Maximum number of windows XXX XXX XXX\r
- */\r
-#define MAX_TERM_DATA 8\r
-\r
-/*\r
- * An array of term_data's\r
- */\r
-static term_data data[MAX_TERM_DATA];\r
-\r
-/*\r
- * Hack -- global "window creation" pointer\r
- */\r
-static term_data *my_td;\r
-\r
-/*\r
- * Remember normal size of main window when maxmized\r
- */\r
-POINT normsize;\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
+POINT normsize; //!< Remember normal size of main window when maxmized\r
\r
/*\r
* was main window maximized on previous playing\r
*/\r
static bool mouse_down = FALSE;\r
static bool paint_rect = FALSE;\r
-static TERM_POSITION mousex = 0, mousey = 0;\r
-static TERM_POSITION oldx, oldy;\r
+static TERM_LEN mousex = 0, mousey = 0;\r
+static TERM_LEN oldx, oldy;\r
\r
\r
-/*\r
- * The "simple" color values\r
- *\r
+/*!\r
+ * @brief The "simple" color values\r
+ * @details\r
* See "main-ibm.c" for original table information\r
- *\r
* The entries below are taken from the "color bits" defined above.\r
- *\r
* Note that many of the choices below suck, but so do crappy monitors.\r
*/\r
static BYTE win_pal[256] =\r
/* Save results */\r
(*wp) = wid;\r
(*hp) = hgt;\r
-\r
- /* Result */\r
return (p);\r
}\r
#endif\r
}\r
\r
\r
-/*\r
- * Get the "size" for a window\r
+/*!\r
+ * @brief (Windows版固有実装)Get the "size" for a window\r
*/\r
static void term_getsize(term_data *td)\r
{\r
RECT rc;\r
-\r
- int wid, hgt;\r
+ TERM_LEN wid, hgt;\r
\r
/* Paranoia */\r
if (td->cols < 1) td->cols = 1;\r
rc.top = 0;\r
rc.bottom = rc.top + hgt;\r
\r
- /* XXX XXX XXX */\r
/* rc.right += 1; */\r
/* rc.bottom += 1; */\r
\r
\r
/*\r
* Write the "prefs"\r
- *\r
* We assume that the windows have all been initialized\r
*/\r
static void save_prefs(void)\r
#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
/* 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
/* Sound available */\r
can_use_music = TRUE;\r
}\r
-\r
- /* Result */\r
return (can_use_music);\r
}\r
\r
/* Sound available */\r
can_use_sound = TRUE;\r
}\r
-\r
- /* Result */\r
return (can_use_sound);\r
}\r
#endif /* USE_SOUND */\r
#endif\r
\r
\r
-/*\r
- * Interact with the User\r
+/*!\r
+ * @brief //!< Windows版ユーザ設定項目実装部(実装必須) /Interact with the User\r
*/\r
static errr Term_user_win(int n)\r
{\r
{\r
int i;\r
\r
-\r
/* Simple color */\r
if (colors16)\r
{\r
/*\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
\r
#else /* USE_SOUND */\r
\r
- /* Oops */\r
return (1);\r
\r
#endif /* USE_SOUND */\r
}\r
}\r
\r
- /* Oops */\r
return 1;\r
}\r
\r
*\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, byte a, const char *s)\r
+static errr Term_text_win(int x, int y, int n, TERM_COLOR a, const char *s)\r
{\r
term_data *td = (term_data*)(Term->data);\r
RECT rc;\r
*\r
* If "graphics" is not available, we simply "wipe" the given grids.\r
*/\r
-static errr Term_pict_win(int x, int y, int n, const byte *ap, const char *cp, const byte *tap, const char *tcp)\r
+static errr Term_pict_win(TERM_LEN x, TERM_LEN y, int n, const TERM_COLOR *ap, const char *cp, const TERM_COLOR *tap, const char *tcp)\r
{\r
term_data *td = (term_data*)(Term->data);\r
\r
#ifdef USE_GRAPHICS\r
\r
int i;\r
- int x1, y1, w1, h1, tw1, th1;\r
- int x2, y2, w2, h2, tw2 = 0;\r
- int x3, y3;\r
+ TERM_LEN x1, y1, w1, h1, tw1, th1;\r
+ TERM_LEN x2, y2, w2, h2, tw2 = 0;\r
+ TERM_LEN x3, y3;\r
\r
HDC hdcMask = NULL;\r
\r
/* 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
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
* 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
/* 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
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
}\r
else\r
{\r
- /* Save Screen */\r
screen_save();\r
\r
/* Clear screen */\r
\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
}\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
}\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
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
/* 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
HGLOBAL hGlobal;\r
LPSTR lpStr;\r
int j, sz;\r
- TERM_POSITION dx = abs(oldx - mousex) + 1;\r
- TERM_POSITION dy = abs(oldy - mousey) + 1;\r
- TERM_POSITION ox = (oldx > mousex) ? mousex : oldx;\r
- TERM_POSITION oy = (oldy > mousey) ? mousey : oldy;\r
+ TERM_LEN dx = abs(oldx - mousex) + 1;\r
+ TERM_LEN dy = abs(oldy - mousey) + 1;\r
+ TERM_LEN ox = (oldx > mousex) ? mousex : oldx;\r
+ TERM_LEN oy = (oldy > mousey) ? mousey : oldy;\r
\r
mouse_down = FALSE;\r
paint_rect = FALSE;\r
\r
case SIZE_MAXIMIZED:\r
{\r
- /* fall through XXX XXX XXX */\r
+ /* fall through */\r
}\r
\r
case SIZE_RESTORED:\r
{\r
- TERM_POSITION cols = (LOWORD(lParam) - td->size_ow1) / td->tile_wid;\r
- TERM_POSITION rows = (HIWORD(lParam) - td->size_oh1) / td->tile_hgt;\r
+ TERM_LEN cols = (LOWORD(lParam) - td->size_ow1) / td->tile_wid;\r
+ TERM_LEN rows = (HIWORD(lParam) - td->size_oh1) / td->tile_hgt;\r
\r
/* New size */\r
if ((td->cols != cols) || (td->rows != rows))\r
/* 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
\r
case WM_SIZE:\r
{\r
- TERM_POSITION cols;\r
- TERM_POSITION rows;\r
+ TERM_LEN cols;\r
+ TERM_LEN rows;\r
\r
/* this message was sent before WM_NCCREATE */\r
if (!td) return 1;\r
/* Process */\r
switch (uMsg)\r
{\r
- /* XXX XXX XXX */\r
case WM_NCCREATE:\r
{\r
break;\r
}\r
}\r
\r
- /* Oops */\r
return DefWindowProc(hWnd, uMsg, wParam, lParam);\r
}\r
\r
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
/* 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
/* validate_dir(ANGBAND_DIR_XTRA_HELP); */\r
}\r
\r
+/*!\r
+ * @brief (Windows固有)変愚蛮怒が起動済かどうかのチェック\r
+ */\r
static bool is_already_running(void)\r
{\r
bool result = FALSE;\r
}\r
\r
\r
+/*!\r
+ * @brief (Windows固有)Windowsアプリケーションとしてのエントリポイント\r
+ */\r
int FAR PASCAL WinMain(HINSTANCE hInst, HINSTANCE hPrevInst,\r
LPSTR lpCmdLine, int nCmdShow)\r
{\r
return FALSE;\r
}\r
\r
- /* Initialize */\r
if (hPrevInst == NULL)\r
{\r
wc.style = CS_CLASSDC;\r
/* Catch nasty signals */\r
signals_init();\r
\r
- /* Initialize */\r
Term_activate(term_screen);\r
init_angband();\r
\r