-/* File: main-win.c */
-
-/*
- * Copyright (c) 1997 Ben Harrison, Skirmantas Kligys, and others
- *
- * This software may be copied and distributed for educational, research,
- * and not for profit purposes provided that this copyright and statement
- * are included in all such copies.
- */
-
-
-/*
- * This file helps Angband work with Windows computers.
- *
- * To use this file, use an appropriate "Makefile" or "Project File",
- * make sure that "WINDOWS" and/or "WIN32" are defined somewhere, and
- * make sure to obtain various extra files as described below.
- *
- * The official compilation uses the CodeWarrior Pro compiler, which
- * includes a special project file and precompilable header file.
- *
- *
- * See also "main-dos.c" and "main-ibm.c".
- *
- *
- * The "lib/user/pref-win.prf" file contains keymaps, macro definitions,
- * and/or color redefinitions.
- *
- * The "lib/user/font-win.prf" contains attr/char mappings for use with the
- * normal "lib/xtra/font/*.fon" font files.
- *
- * The "lib/user/graf-win.prf" contains attr/char mappings for use with the
- * special "lib/xtra/graf/*.bmp" bitmap files, which are activated by a menu
- * item.
- *
- *
- * Compiling this file, and using the resulting executable, requires
- * several extra files not distributed with the standard Angband code.
- * If "USE_GRAPHICS" is defined, then "readdib.h" and "readdib.c" must
- * be placed into "src/", and the "8X8.BMP" bitmap file must be placed
- * into "lib/xtra/graf". In any case, some "*.fon" files (including
- * "8X13.FON" if nothing else) must be placed into "lib/xtra/font/".
- * If "USE_SOUND" is defined, then some special library (for example,
- * "winmm.lib") may need to be linked in, and desired "*.WAV" sound
- * files must be placed into "lib/xtra/sound/". All of these extra
- * files can be found in the "ext-win" archive.
- *
- *
- * The "Term_xtra_win_clear()" function should probably do a low-level
- * clear of the current window, and redraw the borders and other things,
- * if only for efficiency. XXX XXX XXX
- *
- * A simpler method is needed for selecting the "tile size" for windows.
- * XXX XXX XXX
- *
- * The various "warning" messages assume the existance of the "screen.w"
- * window, I think, and only a few calls actually check for its existance,
- * this may be okay since "NULL" means "on top of all windows". (?) The
- * user must never be allowed to "hide" the main window, or the "menubar"
- * will disappear. XXX XXX XXX
- *
- * Special "Windows Help Files" can be placed into "lib/xtra/help/" for
- * use with the "winhelp.exe" program. These files *may* be available
- * at the ftp site somewhere, but I have not seen them. XXX XXX XXX
- *
- *
- * Initial framework (and most code) by Ben Harrison (benh@phial.com).
- *
- * Original code by Skirmantas Kligys (kligys@scf.usc.edu).
- *
- * Additional code by Ross E Becker (beckerr@cis.ohio-state.edu),
- * and Chris R. Martin (crm7479@tam2000.tamu.edu).
- */
+/*!
+* @file main-win.c
+* @brief Windows版固有実装(メインエントリポイント含む)
+* @date 2018/03/16
+* @author Hengband Team
+* @detail
+*
+* <h3>概要</h3>
+* Windows98かその前後の頃を起点としたAPI実装。
+* 各種のゲームエンジンは無論、
+* DirectXといった昨今描画に標準的となったライブラリも用いていない。
+* タイルの描画処理などについては、現在動作の詳細を検証中。
+*
+* <h3>フォーク元の概要</h3>
+* <p>
+* Copyright (c) 1997 Ben Harrison, Skirmantas Kligys, and others
+*
+* This software may be copied and distributed for educational, research,
+* and not for profit purposes provided that this copyright and statement
+* are included in all such copies.
+* </p>
+* <p>
+* This file helps Angband work with Windows computers.
+*
+* To use this file, use an appropriate "Makefile" or "Project File",
+* make sure that "WINDOWS" and/or "WIN32" are defined somewhere, and
+* make sure to obtain various extra files as described below.
+*
+* The official compilation uses the CodeWarrior Pro compiler, which
+* includes a special project file and precompilable header file.
+* </p>
+*
+* <p>
+* <del>See also "main-dos.c" and "main-ibm.c".</del>
+* </p>
+*
+* <p>
+* The "lib/user/pref-win.prf" file contains keymaps, macro definitions,
+* and/or color redefinitions.
+* </p>
+*
+* <p>
+* The "lib/user/font-win.prf" contains attr/char mappings for use with the
+* normal "lib/xtra/font/*.fon" font files.
+* </p>
+*
+* <p>
+* The "lib/user/graf-win.prf" contains attr/char mappings for use with the
+* special "lib/xtra/graf/*.bmp" bitmap files, which are activated by a menu
+* item.
+* </p>
+*
+* <p>
+* Compiling this file, and using the resulting executable, requires
+* several extra files not distributed with the standard Angband code.
+* If "USE_GRAPHICS" is defined, then "readdib.h" and "readdib.c" must
+* be placed into "src/", and the "8X8.BMP" bitmap file must be placed
+* into "lib/xtra/graf". In any case, some "*.fon" files (including
+* "8X13.FON" if nothing else) must be placed into "lib/xtra/font/".
+* If "USE_SOUND" is defined, then some special library (for example,
+* "winmm.lib") may need to be linked in, and desired "*.WAV" sound
+* files must be placed into "lib/xtra/sound/". All of these extra
+* files can be found in the "ext-win" archive.
+* </p>
+*
+* <p>
+* The "Term_xtra_win_clear()" function should probably do a low-level
+* clear of the current window, and redraw the borders and other things,
+* if only for efficiency.
+* </p>
+*
+* <p>
+* A simpler method is needed for selecting the "tile size" for windows.
+* </p>
+*
+* <p>
+* The various "warning" messages assume the existance of the "screen.w"
+* window, I think, and only a few calls actually check for its existance,
+* this may be okay since "NULL" means "on top of all windows". (?) The
+* user must never be allowed to "hide" the main window, or the "menubar"
+* will disappear.
+* </p>
+*
+* <p>
+* Special "Windows Help Files" can be placed into "lib/xtra/help/" for
+* use with the "winhelp.exe" program. These files *may* be available
+* at the ftp site somewhere, but I have not seen them.
+* </p>
+*
+* <p>
+* Initial framework (and most code) by Ben Harrison (benh@phial.com).
+*
+* Original code by Skirmantas Kligys (kligys@scf.usc.edu).
+*
+* Additional code by Ross E Becker (beckerr@cis.ohio-state.edu),
+* and Chris R. Martin (crm7479@tam2000.tamu.edu).
+* </p>
+*/
#include "angband.h"
+#include "view-mainwindow.h"
#ifdef WINDOWS
#include <windows.h>
#define IDM_HELP_CONTENTS 901
-
-
-/*
- * This may need to be removed for some compilers XXX XXX XXX
- */
-#if 0
-#define STRICT
-#endif
-
/*
* Exclude parts of WINDOWS.H that are not needed
*/
#endif
/*
- * Hack -- Fake declarations from "dos.h" XXX XXX XXX
+ * Hack -- Fake declarations from "dos.h"
*/
#ifdef WIN32
#define INVALID_FILE_NAME (DWORD)0xFFFFFFFF
#else /* WIN32 */
#define FA_LABEL 0x08 /* Volume label */
#define FA_DIREC 0x10 /* Directory */
-unsigned _cdecl _dos_getfileattr(const char *, unsigned *);
+unsigned _cdecl _dos_getfileattr(concptr , unsigned *);
#endif /* WIN32 */
/*
*/
typedef struct _term_data term_data;
-/*
- * Extra "term" data
- *
+/*!
+ * @struct _term_data
+ * @brief ターム情報構造体 / Extra "term" data
+ * @details
+ * <p>
+ * pos_x / pos_y は各タームの左上点座標を指す。
+ * </p>
+ * <p>
+ * tile_wid / tile_hgt は[ウィンドウ]メニューのタイルの幅/高さを~を
+ * 1ドットずつ調整するステータスを指す。
+ * また、フォントを変更すると都度自動調整される。
+ * </p>
+ * <p>
* Note the use of "font_want" for the names of the font file requested by
* the user, and the use of "font_file" for the currently active font file.
*
* The "font_file" is uppercased, and takes the form "8X13.FON", while
* "font_want" can be in almost any form as long as it could be construed
* as attempting to represent the name of a font.
+ * </p>
*/
struct _term_data
{
term t;
-
- cptr s;
-
+ concptr s;
HWND w;
-
DWORD dwStyle;
DWORD dwExStyle;
uint keys;
+ TERM_LEN rows; /* int -> uint */
+ TERM_LEN cols;
- uint rows; /* int -> uint */
- uint cols;
-
- uint pos_x;
- uint pos_y;
+ uint pos_x; //!< タームの左上X座標
+ uint pos_y; //!< タームの左上Y座標
uint size_wid;
uint size_hgt;
uint size_ow1;
uint size_oh2;
bool size_hack;
-
bool xtra_hack;
-
bool visible;
-
bool bizarre;
-
- cptr font_want;
-
- cptr font_file;
-
+ concptr font_want;
+ concptr font_file;
HFONT font_id;
-
- uint font_wid;
- uint font_hgt;
-
- uint tile_wid;
- uint tile_hgt;
+ int font_wid; //!< フォント横幅
+ int font_hgt; //!< フォント縦幅
+ int tile_wid; //!< タイル横幅
+ int tile_hgt; //!< タイル縦幅
uint map_tile_wid;
uint map_tile_hgt;
bool posfix;
-/* bg */
-#if 0
- char *bgfile;
- int use_bg;
-#endif
};
+#define MAX_TERM_DATA 8 //!< Maximum number of windows
-/*
- * Maximum number of windows XXX XXX XXX
- */
-#define MAX_TERM_DATA 8
-
-/*
- * An array of term_data's
- */
-static term_data data[MAX_TERM_DATA];
-
-/*
- * Hack -- global "window creation" pointer
- */
-static term_data *my_td;
-
-/*
- * Remember normal size of main window when maxmized
- */
-POINT normsize;
+static term_data data[MAX_TERM_DATA]; //!< An array of term_data's
+static term_data *my_td; //!< Hack -- global "window creation" pointer
+POINT normsize; //!< Remember normal size of main window when maxmized
/*
* was main window maximized on previous playing
/* bg */
static HBITMAP hBG = NULL;
-static int use_bg = 0;
-static char bg_bitmap_file[1024] = "bg.bmp";
+static int use_bg = 0; //!< 背景使用フラグ、1なら私用。
+static char bg_bitmap_file[1024] = "bg.bmp"; //!< 現在の背景ビットマップファイル名。
#ifdef USE_SAVER
#ifdef USE_GRAPHICS
-/*
+/*!
+ * 現在使用中のタイルID(0ならば未使用)
* Flag set once "graphics" has been initialized
*/
-static bool can_use_graphics = FALSE;
+static byte_hack current_graphics_mode = 0;
/*
* The global bitmap
/*
* An array of sound file names
*/
-static cptr sound_file[SOUND_MAX][SAMPLE_MAX];
+static concptr sound_file[SOUND_MAX][SAMPLE_MAX];
#endif /* USE_SOUND */
#ifdef USE_MUSIC
#define SAMPLE_MUSIC_MAX 16
-static cptr music_file[MUSIC_BASIC_MAX][SAMPLE_MUSIC_MAX];
-static cptr dungeon_music_file[1000][SAMPLE_MUSIC_MAX];
-static cptr town_music_file[1000][SAMPLE_MUSIC_MAX];
-static cptr quest_music_file[1000][SAMPLE_MUSIC_MAX];
+static concptr music_file[MUSIC_BASIC_MAX][SAMPLE_MUSIC_MAX];
+static concptr dungeon_music_file[1000][SAMPLE_MUSIC_MAX];
+static concptr town_music_file[1000][SAMPLE_MUSIC_MAX];
+static concptr quest_music_file[1000][SAMPLE_MUSIC_MAX];
static bool can_use_music = FALSE;
static MCI_OPEN_PARMS mop;
static char mci_device_type[256];
+int current_music_type = 0;
+int current_music_id = 0;
+
#endif /* USE_MUSIC */
/*
* Full path to ANGBAND.INI
*/
-static cptr ini_file = NULL;
+static concptr ini_file = NULL;
/*
* Name of application
*/
-static cptr AppName = "ANGBAND";
+static concptr AppName = "ANGBAND";
/*
* Name of sub-window type
*/
-static cptr AngList = "AngList";
+static concptr AngList = "AngList";
/*
* Directory names
*/
-static cptr ANGBAND_DIR_XTRA_GRAF;
-static cptr ANGBAND_DIR_XTRA_SOUND;
-static cptr ANGBAND_DIR_XTRA_MUSIC;
-static cptr ANGBAND_DIR_XTRA_HELP;
+static concptr ANGBAND_DIR_XTRA_GRAF;
+static concptr ANGBAND_DIR_XTRA_SOUND;
+static concptr ANGBAND_DIR_XTRA_MUSIC;
+static concptr ANGBAND_DIR_XTRA_HELP;
#if 0 /* #ifndef JP */
-static cptr ANGBAND_DIR_XTRA_FONT;
+static concptr ANGBAND_DIR_XTRA_FONT;
#endif
#ifdef USE_MUSIC
-static cptr ANGBAND_DIR_XTRA_MUSIC;
+static concptr ANGBAND_DIR_XTRA_MUSIC;
#endif
*/
static bool mouse_down = FALSE;
static bool paint_rect = FALSE;
-static int mousex = 0, mousey = 0;
-static int oldx, oldy;
+static TERM_LEN mousex = 0, mousey = 0;
+static TERM_LEN oldx, oldy;
-/*
- * The "simple" color values
- *
+/*!
+ * @brief The "simple" color values
+ * @details
* See "main-ibm.c" for original table information
- *
* The entries below are taken from the "color bits" defined above.
- *
* Note that many of the choices below suck, but so do crappy monitors.
*/
static BYTE win_pal[256] =
};
#endif
+
+/* Function prototype */
+
+static bool is_already_running(void);
+
+
/* bg */
static void delete_bg(void)
{
hBG = LoadImage(NULL, bmfile, IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);
if (!hBG) {
-#ifdef JP
- plog_fmt("ÊÉ»æÍÑ¥Ó¥Ã¥È¥Þ¥Ã¥× '%s' ¤òÆɤ߹þ¤á¤Þ¤»¤ó¡£", bmfile);
-#else
- plog_fmt("Can't load the bitmap file '%s'.", bmfile);
-#endif
+ plog_fmt(_("壁紙用ビットマップ '%s' を読み込めません。", "Can't load the bitmap file '%s'."), bmfile);
use_bg = 0;
return 0;
}
-#if 0 /* gomi */
- HDC wnddc, dcimage, dcbg;
- HBITMAP bmimage, bmimage_old, bmbg_old;
- int i, j;
-
- delete_bg();
-
- wnddc = GetDC(hwnd);
- dcimage = CreateCompatibleDC(wnddc);
- dcbg = CreateCompatibleDC(wnddc);
-
- bmimage = LoadImage(NULL, "bg.bmp", LR_LOADFROMFILE, 0, 0, 0);
- if (!bmimage) quit("bg.bmp¤¬Æɤߤ³¤á¤Ê¤¤¡ª");
- bmimage_old = SelectObject(dcimage, bmimage);
-
- CreateCompatibleBitmap();
-
- ReleaseDC(hwnd, wnddc);
-#endif
use_bg = 1;
return 1;
}
/*
* Hack -- given a pathname, point at the filename
*/
-static cptr extract_file_name(cptr s)
+static concptr extract_file_name(concptr s)
{
- cptr p;
+ concptr p;
/* Start at the end */
p = s + strlen(s) - 1;
/* Save results */
(*wp) = wid;
(*hp) = hgt;
-
- /* Result */
return (p);
}
#endif
/*
* Check for existance of a file
*/
-static bool check_file(cptr s)
+static bool check_file(concptr s)
{
char path[1024];
/*
* Check for existance of a directory
*/
-static bool check_dir(cptr s)
+static bool check_dir(concptr s)
{
int i;
/*
* Validate a file
*/
-static void validate_file(cptr s)
+static void validate_file(concptr s)
{
/* Verify or fail */
if (!check_file(s))
{
-#ifdef JP
- quit_fmt("ɬÍפʥե¡¥¤¥ë[%s]¤¬¸«¤¢¤¿¤ê¤Þ¤»¤ó¡£", s);
-#else
- quit_fmt("Cannot find required file:\n%s", s);
-#endif
-
+ quit_fmt(_("必要なファイル[%s]が見あたりません。", "Cannot find required file:\n%s"), s);
}
}
/*
* Validate a directory
*/
-static void validate_dir(cptr s, bool vital)
+static void validate_dir(concptr s, bool vital)
{
/* Verify or fail */
if (!check_dir(s))
/* This directory contains needed data */
if (vital)
{
-#ifdef JP
- quit_fmt("ɬÍפʥǥ£¥ì¥¯¥È¥ê[%s]¤¬¸«¤¢¤¿¤ê¤Þ¤»¤ó¡£", s);
-#else
- quit_fmt("Cannot find required directory:\n%s", s);
-#endif
-
+ quit_fmt(_("必要なディレクトリ[%s]が見あたりません。", "Cannot find required directory:\n%s"), s);
}
/* Attempt to create this directory */
else if (mkdir(s))
}
-/*
- * Get the "size" for a window
+/*!
+ * @brief (Windows版固有実装)Get the "size" for a window
*/
static void term_getsize(term_data *td)
{
RECT rc;
-
- int wid, hgt;
-
- /* Paranoia */
+ TERM_LEN wid, hgt;
if (td->cols < 1) td->cols = 1;
if (td->rows < 1) td->rows = 1;
rc.top = 0;
rc.bottom = rc.top + hgt;
- /* XXX XXX XXX */
/* rc.right += 1; */
/* rc.bottom += 1; */
static void save_prefs_aux(int i)
{
term_data *td = &data[i];
- char sec_name[128];
+ GAME_TEXT sec_name[128];
char buf[1024];
RECT rc;
WINDOWPLACEMENT lpwndpl;
-
- /* Paranoia */
if (!td->w) return;
/* Make section name */
/* Font */
#ifdef JP
- strcpy(buf, td->lf.lfFaceName[0]!='\0' ? td->lf.lfFaceName : "£Í£Ó ¥´¥·¥Ã¥¯");
+ strcpy(buf, td->lf.lfFaceName[0]!='\0' ? td->lf.lfFaceName : "ï¼ï¼³ ã\82´ã\82·ã\83\83ã\82¯");
#else
#if 0
strcpy(buf, td->font_file ? td->font_file : "8X13.FON");
/*
* Write the "prefs"
- *
* We assume that the windows have all been initialized
*/
static void save_prefs(void)
static void load_prefs_aux(int i)
{
term_data *td = &data[i];
- char sec_name[128];
+ GAME_TEXT sec_name[128];
char tmp[1024];
int wid, hgt, posx, posy;
/* Desired font, with default */
#ifdef JP
- GetPrivateProfileString(sec_name, "Font", "£Í£Ó ¥´¥·¥Ã¥¯", tmp, 127, ini_file);
+ GetPrivateProfileString(sec_name, "Font", "ï¼ï¼³ ã\82´ã\82·ã\83\83ã\82¯", tmp, 127, ini_file);
#else
#if 0
GetPrivateProfileString(sec_name, "Font", "8X13.FON", tmp, 127, ini_file);
/* Window size */
if (i == 0)
{
- win_maximized = GetPrivateProfileInt(sec_name, "Maximized", win_maximized, ini_file);
+ win_maximized = (GetPrivateProfileInt(sec_name, "Maximized", win_maximized, ini_file) != 0);
}
/* Window position */
/* Window Z position */
if (i > 0)
{
- td->posfix = GetPrivateProfileInt(sec_name, "PositionFix", td->posfix, ini_file);
+ td->posfix = (GetPrivateProfileInt(sec_name, "PositionFix", td->posfix, ini_file) != 0);
}
}
int i;
/* Extract the "arg_graphics" flag */
- arg_graphics = GetPrivateProfileInt("Angband", "Graphics", GRAPHICS_NONE, ini_file);
+ arg_graphics = (byte_hack)GetPrivateProfileInt("Angband", "Graphics", GRAPHICS_NONE, ini_file);
/* Extract the "arg_bigtile" flag */
- arg_bigtile = GetPrivateProfileInt("Angband", "Bigtile", FALSE, ini_file);
+ arg_bigtile = (GetPrivateProfileInt("Angband", "Bigtile", FALSE, ini_file) != 0);
use_bigtile = arg_bigtile;
/* Extract the "arg_sound" flag */
#if defined(USE_SOUND) || defined(USE_MUSIC)
/*
- * XXX XXX XXX - Taken from files.c.
+ * - Taken from files.c.
*
* Extract "tokens" from a buffer
*
*/
static s16b tokenize_whitespace(char *buf, s16b num, char **tokens)
{
- int k = 0;
-
+ s16b k = 0;
char *s = buf;
-
/* Process */
while (k < num)
{
}
}
- for (i = 0; i < 1000; i++) /*!< @todo ¥¯¥¨¥¹¥ÈºÇÂç¿ô»ØÄê */
+ for (i = 0; i < max_q_idx; i++)
{
sprintf(key, "quest%03d", i);
GetPrivateProfileString("Quest", key, "", tmp, 1024, ini_path);
}
}
- for (i = 0; i < 1000; i++) /*!< @todo Ä®ºÇÂç¿ô»ØÄê */
+ for (i = 0; i < 1000; i++) /*!< @todo 町最大数指定 */
{
sprintf(key, "town%03d", i);
GetPrivateProfileString("Town", key, "", tmp, 1024, ini_path);
if ((nEntries == 0) || (nEntries > 220))
{
/* Warn the user */
-#ifdef JP
- plog("²èÌ̤ò16¥Ó¥Ã¥È¤«24¥Ó¥Ã¥È¥«¥é¡¼¥â¡¼¥É¤Ë¤·¤Æ²¼¤µ¤¤¡£");
-#else
- plog("Please switch to high- or true-color mode.");
-#endif
-
+ plog(_("画面を16ビットか24ビットカラーモードにして下さい。", "Please switch to high- or true-color mode."));
/* Cleanup */
rnfree(lppe, lppeSize);
/* Create a new palette, or fail */
hNewPal = CreatePalette(pLogPal);
-#ifdef JP
- if (!hNewPal) quit("¥Ñ¥ì¥Ã¥È¤òºîÀ®¤Ç¤¤Þ¤»¤ó¡ª");
-#else
- if (!hNewPal) quit("Cannot create palette!");
-#endif
-
+ if (!hNewPal) quit(_("パレットを作成できません!", "Cannot create palette!"));
/* Free the palette */
rnfree(pLogPal, pLogPalSize);
SelectPalette(hdc, hNewPal, 0);
i = RealizePalette(hdc);
ReleaseDC(td->w, hdc);
-#ifdef JP
- if (i == 0) quit("¥Ñ¥ì¥Ã¥È¤ò¥·¥¹¥Æ¥à¥¨¥ó¥È¥ê¤Ë¥Þ¥Ã¥×¤Ç¤¤Þ¤»¤ó¡ª");
-#else
- if (i == 0) quit("Cannot realize palette!");
-#endif
+ if (i == 0) quit(_("パレットをシステムエントリにマップできません!", "Cannot realize palette!"));
/* Sub-windows */
#ifdef USE_GRAPHICS
-/*
- * Initialize graphics
+/*!
+ * @brief グラフィクスを初期化する / Initialize graphics
+ * @details
+ * <ul>
+ * <li>メニュー[オプション]>[グラフィクス]が「なし」以外の時に描画処理を初期化する。</li>
+ * <li>呼び出されるタイミングはロード時、及び同メニューで「なし」以外に変更される毎になる。</li>
+ * </ul>
*/
static bool init_graphics(void)
{
/* Initialize once */
- /* if (can_use_graphics != arg_graphics) */
- {
- char buf[1024];
- int wid, hgt, twid, thgt, ox, oy;
- cptr name;
-
- if (arg_graphics == GRAPHICS_ADAM_BOLT)
- {
- wid = 16;
- hgt = 16;
- twid = 16;
- thgt = 16;
- ox = 0;
- oy = 0;
- name = "16X16.BMP";
-
- ANGBAND_GRAF = "new";
- }
- else if (arg_graphics == GRAPHICS_HENGBAND)
- {
- /*! @todo redraw
- wid = 64;
- hgt = 64;
- twid = 32;
- thgt = 32;
- ox = -16;
- oy = -24;
- name = "64X64.BMP";
- */
-
- wid = 32;
- hgt = 32;
- twid = 32;
- thgt = 32;
- ox = 0;
- oy = 0;
- name = "32X32.BMP";
-
- ANGBAND_GRAF = "ne2";
- }
- else
- {
- wid = 8;
- hgt = 8;
- twid = 8;
- thgt = 8;
- ox = 0;
- oy = 0;
- name = "8X8.BMP";
- ANGBAND_GRAF = "old";
- }
+ char buf[1024];
+ BYTE wid, hgt, twid, thgt, ox, oy;
+ concptr name;
- /* Access the bitmap file */
- path_build(buf, sizeof(buf), ANGBAND_DIR_XTRA_GRAF, name);
+ if (arg_graphics == GRAPHICS_ADAM_BOLT)
+ {
+ wid = 16;
+ hgt = 16;
+ twid = 16;
+ thgt = 16;
+ ox = 0;
+ oy = 0;
+ name = "16X16.BMP";
+
+ ANGBAND_GRAF = "new";
+ }
+ else if (arg_graphics == GRAPHICS_HENGBAND)
+ {
+ /*! @todo redraw
+ wid = 64;
+ hgt = 64;
+ twid = 32;
+ thgt = 32;
+ ox = -16;
+ oy = -24;
+ name = "64X64.BMP";
+ */
+
+ wid = 32;
+ hgt = 32;
+ twid = 32;
+ thgt = 32;
+ ox = 0;
+ oy = 0;
+ name = "32X32.BMP";
+
+ ANGBAND_GRAF = "ne2";
+ }
+ else
+ {
+ wid = 8;
+ hgt = 8;
+ twid = 8;
+ thgt = 8;
+ ox = 0;
+ oy = 0;
+ name = "8X8.BMP";
+ ANGBAND_GRAF = "old";
+ }
- /* Load the bitmap or quit */
- if (!ReadDIB(data[0].w, buf, &infGraph))
- {
-#ifdef JP
- plog_fmt("¥Ó¥Ã¥È¥Þ¥Ã¥× '%s' ¤òÆɤ߹þ¤á¤Þ¤»¤ó¡£", name);
-#else
- plog_fmt("Cannot read bitmap file '%s'", name);
-#endif
+ /* Access the bitmap file */
+ path_build(buf, sizeof(buf), ANGBAND_DIR_XTRA_GRAF, name);
- return (FALSE);
- }
+ /* Load the bitmap or quit */
+ if (!ReadDIB(data[0].w, buf, &infGraph))
+ {
+ plog_fmt(_("ビットマップ '%s' を読み込めません。", "Cannot read bitmap file '%s'"), name);
+ return (FALSE);
+ }
- /* Save the new sizes */
- infGraph.CellWidth = wid;
- infGraph.CellHeight = hgt;
- infGraph.TileWidth = twid;
- infGraph.TileHeight = thgt;
- infGraph.OffsetX = ox;
- infGraph.OffsetY = oy;
+ /* Save the new sizes */
+ infGraph.CellWidth = wid;
+ infGraph.CellHeight = hgt;
+ infGraph.TileWidth = twid;
+ infGraph.TileHeight = thgt;
+ infGraph.OffsetX = ox;
+ infGraph.OffsetY = oy;
- if (arg_graphics == GRAPHICS_ADAM_BOLT)
- {
- /* Access the mask file */
- path_build(buf, sizeof(buf), ANGBAND_DIR_XTRA_GRAF, "mask.bmp");
+ if (arg_graphics == GRAPHICS_ADAM_BOLT)
+ {
+ /* Access the mask file */
+ path_build(buf, sizeof(buf), ANGBAND_DIR_XTRA_GRAF, "mask.bmp");
- /* Load the bitmap or quit */
- if (!ReadDIB(data[0].w, buf, &infMask))
- {
- plog_fmt("Cannot read bitmap file '%s'", buf);
- return (FALSE);
- }
- }
- if (arg_graphics == GRAPHICS_HENGBAND)
+ /* Load the bitmap or quit */
+ if (!ReadDIB(data[0].w, buf, &infMask))
{
- /* Access the mask file */
- path_build(buf, sizeof(buf), ANGBAND_DIR_XTRA_GRAF, "mask32.bmp");
-
- /* Load the bitmap or quit */
- if (!ReadDIB(data[0].w, buf, &infMask))
- {
- plog_fmt("Cannot read bitmap file '%s'", buf);
- return (FALSE);
- }
+ plog_fmt("Cannot read bitmap file '%s'", buf);
+ return (FALSE);
}
+ }
+ if (arg_graphics == GRAPHICS_HENGBAND)
+ {
+ /* Access the mask file */
+ path_build(buf, sizeof(buf), ANGBAND_DIR_XTRA_GRAF, "mask32.bmp");
- /* Activate a palette */
- if (!new_palette())
+ /* Load the bitmap or quit */
+ if (!ReadDIB(data[0].w, buf, &infMask))
{
- /* Free bitmap XXX XXX XXX */
-
- /* Oops */
-#ifdef JP
- plog("¥Ñ¥ì¥Ã¥È¤ò¼Â¸½¤Ç¤¤Þ¤»¤ó¡ª");
-#else
- plog("Cannot activate palette!");
-#endif
-
+ plog_fmt("Cannot read bitmap file '%s'", buf);
return (FALSE);
}
+ }
- /* Graphics available */
- can_use_graphics = arg_graphics;
+ /* Activate a palette */
+ if (!new_palette())
+ {
+ /* Free bitmap */
+
+ plog(_("パレットを実現できません!", "Cannot activate palette!"));
+ return (FALSE);
}
- /* Result */
- return (can_use_graphics);
+ /* Graphics available */
+ current_graphics_mode = arg_graphics;
+ return (current_graphics_mode);
}
#endif /* USE_GRAPHICS */
/* Sound available */
can_use_music = TRUE;
}
-
- /* Result */
return (can_use_music);
}
/* Sound available */
can_use_sound = TRUE;
}
-
- /* Result */
return (can_use_sound);
}
#endif /* USE_SOUND */
*
* Note that the "font name" must be capitalized!!!
*/
-static errr term_force_font(term_data *td, cptr path)
+static errr term_force_font(term_data *td, concptr path)
{
int wid, hgt;
#endif
-/*
- * Interact with the User
+/*!
+ * @brief //!< Windows版ユーザ設定項目実装部(実装必須) /Interact with the User
*/
static errr Term_user_win(int n)
{
{
int i;
-
/* Simple color */
if (colors16)
{
if (arg_sound && !init_sound())
{
/* Warning */
-#ifdef JP
- plog("¥µ¥¦¥ó¥É¤ò½é´ü²½¤Ç¤¤Þ¤»¤ó¡ª");
-#else
- plog("Cannot initialize sound!");
-#endif
-
+ plog(_("サウンドを初期化できません!", "Cannot initialize sound!"));
/* Cannot enable */
arg_sound = FALSE;
if (arg_music && !init_music())
{
/* Warning */
-#ifdef JP
- plog("BGM¤ò½é´ü²½¤Ç¤¤Þ¤»¤ó¡ª");
-#else
- plog("Cannot initialize BGM!");
-#endif
+ plog(_("BGMを初期化できません!", "Cannot initialize BGM!"));
/* Cannot enable */
arg_music = FALSE;
}
if (arg_graphics && !init_graphics())
{
/* Warning */
-#ifdef JP
- plog("¥°¥é¥Õ¥£¥Ã¥¯¥¹¤ò½é´ü²½¤Ç¤¤Þ¤»¤ó!");
-#else
- plog("Cannot initialize graphics!");
-#endif
-
+ plog(_("グラフィックスを初期化できません!", "Cannot initialize graphics!"));
/* Cannot enable */
arg_graphics = GRAPHICS_NONE;
term_data *td = &data[i];
/* Update resized windows */
- if ((td->cols != (uint)td->t.wid) || (td->rows != (uint)td->t.hgt))
+ if ((td->cols != td->t.wid) || (td->rows != td->t.hgt))
{
/* Activate */
Term_activate(&td->t);
/* Redraw the contents */
Term_redraw();
-
- /* Restore */
Term_activate(old);
}
}
/*
* Hack -- clear the screen
*
- * Make this more efficient XXX XXX XXX
+ * Make this more efficient
*/
static errr Term_xtra_win_clear(void)
{
#else /* USE_SOUND */
- /* Oops */
return (1);
#endif /* USE_SOUND */
static errr Term_xtra_win_music(int n, int v)
{
#ifdef USE_MUSIC
- int i;
+ int i = 0;
char buf[1024];
#endif /* USE_MUSIC */
/* Sound disabled */
+
if(!use_music) return (1);
/* Illegal sound */
/* No sample */
if (i == 0)
{
- mciSendCommand(mop.wDeviceID, MCI_STOP, 0, 0);
- mciSendCommand(mop.wDeviceID, MCI_CLOSE, 0, 0);
+ //mciSendCommand(mop.wDeviceID, MCI_STOP, 0, 0);
+ //mciSendCommand(mop.wDeviceID, MCI_CLOSE, 0, 0);
return (1);
}
break;
}
+ if(current_music_type == n && current_music_id == v)
+ {
+ return (0);
+ }
+ current_music_type = n;
+ current_music_id = v;
+
#ifdef WIN32
mop.lpstrDeviceType = mci_device_type;
}
}
- /* Oops */
return 1;
}
*
* One would think there is a more efficient method for telling a window
* what color it should be using to draw with, but perhaps simply changing
- * it every time is not too inefficient. XXX XXX XXX
+ * it every time is not too inefficient.
*/
-static errr Term_text_win(int x, int y, int n, byte a, const char *s)
+static errr Term_text_win(int x, int y, int n, TERM_COLOR a, concptr s)
{
term_data *td = (term_data*)(Term->data);
RECT rc;
for (i = 0; i < n; i++)
{
#ifdef JP
- if (use_bigtile && *(s+i)=="¢£"[0] && *(s+i+1)=="¢£"[1])
+ if (use_bigtile && *(s+i)=="■"[0] && *(s+i+1)=="■"[1])
{
rc.right += td->font_wid;
rc.left += 2 * td->tile_wid;
rc.right += 2 * td->tile_wid;
}
- else if ( iskanji(*(s+i)) ) /* £²¥Ð¥¤¥Èʸ»ú */
+ else if ( iskanji(*(s+i)) ) /* 2バイト文字 */
{
rc.right += td->font_wid;
/* Dump the text */
*
* If "graphics" is not available, we simply "wipe" the given grids.
*/
-static errr Term_pict_win(int x, int y, int n, const byte *ap, const char *cp, const byte *tap, const char *tcp)
+static errr Term_pict_win(TERM_LEN x, TERM_LEN y, int n, const TERM_COLOR *ap, concptr cp, const TERM_COLOR *tap, concptr tcp)
{
term_data *td = (term_data*)(Term->data);
#ifdef USE_GRAPHICS
int i;
- int x1, y1, w1, h1, tw1, th1;
- int x2, y2, w2, h2, tw2;
- int x3, y3;
+ TERM_LEN x1, y1, w1, h1, tw1, th1;
+ TERM_LEN x2, y2, w2, h2, tw2 = 0;
+ TERM_LEN x3, y3;
- HDC hdcMask;
+ HDC hdcMask = NULL;
HDC hdc;
HDC hdcSrc;
HBITMAP hbmSrcOld;
-
- /* Paranoia */
if (!use_graphics)
{
/* Erase the grids */
/* Draw attr/char pairs */
for (i = 0; i < n; i++, x2 += w2)
{
- byte a = ap[i];
+ TERM_COLOR a = ap[i];
char c = cp[i];
static void windows_map(void)
{
term_data *td = &data[0];
- byte a, c;
- int x, min_x, max_x;
- int y, min_y, max_y;
+ TERM_COLOR a;
+ char c;
+ TERM_LEN x, min_x, max_x;
+ TERM_LEN y, min_y, max_y;
- byte ta, tc;
+ TERM_COLOR ta;
+ char tc;
/* Only in graphics mode */
if (!use_graphics) return;
-
- /* Clear screen */
Term_xtra_win_clear();
td->map_tile_wid = (td->tile_wid * td->cols) / MAX_WID;
{
min_x = 0;
min_y = 0;
- max_x = cur_wid;
- max_y = cur_hgt;
+ max_x = current_floor_ptr->width;
+ max_y = current_floor_ptr->height;
}
/* Draw the map */
}
/* Hilite the player */
- Term_curs_win(px - min_x, py - min_y);
+ Term_curs_win(p_ptr->x - min_x, p_ptr->y - min_y);
/* Wait for a keypress, flush key buffer */
Term_inkey(&c, TRUE, TRUE);
* to over-ride selected values, then create the windows, and fonts.
*
* Must use SW_SHOW not SW_SHOWNA, since on 256 color display
- * must make active to realize the palette. XXX XXX XXX
+ * must make active to realize the palette.
*/
static void init_windows(void)
{
td = &data[0];
WIPE(td, term_data);
#ifdef JP
- td->s = "ÊѶòÈÚÅÜ";
+ td->s = "変愚蛮怒";
#else
td->s = angband_term_name[0];
#endif
td->lf.lfPitchAndFamily = FIXED_PITCH | FF_DONTCARE;
/* Activate the chosen font */
term_force_font(td, NULL);
- td->tile_wid = td->font_wid;
- td->tile_hgt = td->font_hgt;
+ if(!td->tile_wid) td->tile_wid = td->font_wid;
+ if(!td->tile_hgt) td->tile_hgt = td->font_hgt;
#else
/* Access the standard font file */
path_build(buf, sizeof(buf), ANGBAND_DIR_XTRA_FONT, td->font_want);
/* Force the use of that font */
(void)term_force_font(td, buf);
- /* Oops */
td->tile_wid = 8;
td->tile_hgt = 13;
td->size_wid, td->size_hgt,
HWND_DESKTOP, NULL, hInstance, NULL);
my_td = NULL;
-#ifdef JP
- if (!td->w) quit("¥µ¥Ö¥¦¥£¥ó¥É¥¦¤ËºîÀ®¤Ë¼ºÇÔ¤·¤Þ¤·¤¿");
-#else
- if (!td->w) quit("Failed to create sub-window");
-#endif
-
+ if (!td->w) quit(_("サブウィンドウに作成に失敗しました", "Failed to create sub-window"));
if (td->visible)
{
td->size_wid, td->size_hgt,
HWND_DESKTOP, NULL, hInstance, NULL);
my_td = NULL;
-#ifdef JP
- if (!td->w) quit("¥á¥¤¥ó¥¦¥£¥ó¥É¥¦¤ÎºîÀ®¤Ë¼ºÇÔ¤·¤Þ¤·¤¿");
-#else
- if (!td->w) quit("Failed to create Angband window");
-#endif
-
+ if (!td->w) quit(_("メインウィンドウの作成に失敗しました", "Failed to create Angband window"));
term_data_link(td);
angband_term[0] = &td->t;
SetWindowPos(td->w, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
- /* New palette XXX XXX XXX */
+ /* New palette */
(void)new_palette();
{
if (!initialized)
{
-#ifdef JP
- plog("¤Þ¤À½é´ü²½Ãæ¤Ç¤¹...");
-#else
- plog("You cannot do that yet...");
-#endif
-
+ plog(_("まだ初期化中です...", "You cannot do that yet..."));
}
else if (game_in_progress)
{
-#ifdef JP
- plog("¥×¥ì¥¤Ãæ¤Ï¿·¤·¤¤¥²¡¼¥à¤ò»Ï¤á¤ë¤³¤È¤¬¤Ç¤¤Þ¤»¤ó¡ª");
-#else
- plog("You can't start a new game while you're still playing!");
-#endif
-
+ plog(_("プレイ中は新しいゲームを始めることができません!", "You can't start a new game while you're still playing!"));
}
else
{
{
if (!initialized)
{
-#ifdef JP
- plog("¤Þ¤À½é´ü²½Ãæ¤Ç¤¹...");
-#else
- plog("You cannot do that yet...");
-#endif
-
+ plog(_("まだ初期化中です...", "You cannot do that yet..."));
}
else if (game_in_progress)
{
-#ifdef JP
- plog("¥×¥ì¥¤Ãæ¤Ï¥²¡¼¥à¤ò¥í¡¼¥É¤¹¤ë¤³¤È¤¬¤Ç¤¤Þ¤»¤ó¡ª");
-#else
- plog("You can't open a new game while you're still playing!");
-#endif
-
+ plog(_("プレイ中はゲームをロードすることができません!", "You can't open a new game while you're still playing!"));
}
else
{
{
if (game_in_progress && character_generated)
{
- /* Paranoia */
if (!can_save)
{
-#ifdef JP
- plog("º£¤Ï¥»¡¼¥Ö¤¹¤ë¤³¤È¤Ï½ÐÍè¤Þ¤»¤ó¡£");
-#else
- plog("You may not do that right now.");
-#endif
-
+ plog(_("今はセーブすることは出来ません。", "You may not do that right now."));
break;
}
}
else
{
-#ifdef JP
- plog("º£¡¢¥»¡¼¥Ö¤¹¤ë¤³¤È¤Ï½ÐÍè¤Þ¤»¤ó¡£");
-#else
- plog("You may not do that right now.");
-#endif
-
+ plog(_("今、セーブすることは出来ません。", "You may not do that right now."));
}
break;
}
{
if (game_in_progress && character_generated)
{
- /* Paranoia */
if (!can_save)
{
-#ifdef JP
- plog("º£¤Ï½ªÎ»¤Ç¤¤Þ¤»¤ó¡£");
-#else
- plog("You may not do that right now.");
-#endif
-
+ plog(_("今は終了できません。", "You may not do that right now."));
break;
}
}
else
{
- /* Save Screen */
screen_save();
-
- /* Clear screen */
Term_clear();
/* Display the scores */
/* Forget the high score fd */
highscore_fd = -1;
-
- /* Load screen */
screen_load();
/* Hack - Flush it */
{
if (!initialized)
{
-#ifdef JP
- plog("¤Þ¤À½é´ü²½Ãæ¤Ç¤¹...");
-#else
- plog("You cannot do that yet...");
-#endif
+ plog(_("まだ初期化中です...", "You cannot do that yet..."));
}
else if (game_in_progress)
{
-#ifdef JP
- plog("¥×¥ì¥¤Ãæ¤Ï¥à¡¼¥Ó¡¼¤ò¥í¡¼¥É¤¹¤ë¤³¤È¤¬¤Ç¤¤Þ¤»¤ó¡ª");
-#else
- plog("You can't open a movie while you're playing!");
-#endif
+ plog(_("プレイ中はムービーをロードすることができません!", "You can't open a movie while you're playing!"));
}
else
{
case IDM_WINDOW_VIS_0:
{
-#ifdef JP
- plog("¥á¥¤¥ó¥¦¥£¥ó¥É¥¦¤ÏÈóɽ¼¨¤Ë¤Ç¤¤Þ¤»¤ó¡ª");
-#else
- plog("You are not allowed to do that!");
-#endif
-
-
+ plog(_("メインウィンドウは非表示にできません!", "You are not allowed to do that!"));
break;
}
case IDM_OPTIONS_NO_GRAPHICS:
{
- /* Paranoia */
if (!inkey_flag)
{
plog("You may not do that right now.");
case IDM_OPTIONS_OLD_GRAPHICS:
{
- /* Paranoia */
if (!inkey_flag)
{
plog("You may not do that right now.");
case IDM_OPTIONS_NEW_GRAPHICS:
{
- /* Paranoia */
if (!inkey_flag)
{
plog("You may not do that right now.");
case IDM_OPTIONS_NEW2_GRAPHICS:
{
- /* Paranoia */
if (!inkey_flag)
{
plog("You may not do that right now.");
case IDM_OPTIONS_BIGTILE:
{
- term_data *td = &data[0];
-
- /* Paranoia */
+ td = &data[0];
if (!inkey_flag)
{
plog("You may not do that right now.");
case IDM_OPTIONS_MUSIC:
{
- /* Paranoia */
if (!inkey_flag)
{
plog("You may not do that right now.");
case IDM_OPTIONS_SOUND:
{
- /* Paranoia */
if (!inkey_flag)
{
plog("You may not do that right now.");
/* bg */
case IDM_OPTIONS_BG:
{
- /* Paranoia */
if (!inkey_flag)
{
plog("You may not do that right now.");
/* bg */
case IDM_OPTIONS_OPEN_BG:
{
- /* Paranoia */
if (!inkey_flag)
{
plog("You may not do that right now.");
ofn.lpstrFile = bg_bitmap_file;
ofn.nMaxFile = 1023;
ofn.lpstrInitialDir = NULL;
-#ifdef JP
- ofn.lpstrTitle = "ÊÉ»æ¤òÁª¤ó¤Ç¤Í¡£";
-#else
- ofn.lpstrTitle = "Choose wall paper.";
-#endif
+ ofn.lpstrTitle = _("壁紙を選んでね。", "Choose wall paper.");
ofn.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY;
if (GetOpenFileName(&ofn))
ofn.nMaxFile = 1023;
ofn.lpstrDefExt = "html";
ofn.lpstrInitialDir = NULL;
-#ifdef JP
- ofn.lpstrTitle = "HTML¤Ç¥¹¥¯¥ê¡¼¥ó¥À¥ó¥×¤òÊݸ";
-#else
- ofn.lpstrTitle = "Save screen dump as HTML.";
-#endif
+ ofn.lpstrTitle = _("HTMLでスクリーンダンプを保存", "Save screen dump as HTML.");
ofn.Flags = OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT;
if (GetSaveFileName(&ofn))
if (hwndSaver)
{
- /* Push the window to the bottom XXX XXX XXX */
+ /* Push the window to the bottom */
SetWindowPos(hwndSaver, HWND_BOTTOM, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE);
}
else
{
-#ifdef JP
- plog("¥¦¥£¥ó¥É¥¦¤òºîÀ®½ÐÍè¤Þ¤»¤ó");
-#else
- plog("Failed to create saver window");
-#endif
-
+ plog(_("ウィンドウを作成出来ません", "Failed to create saver window"));
}
}
break;
}
else
{
-#ifdef JP
- plog_fmt("¥Ø¥ë¥×¥Õ¥¡¥¤¥ë[%s]¤¬¸«ÉÕ¤«¤ê¤Þ¤»¤ó¡£", tmp);
- plog("Âå¤ï¤ê¤Ë¥ª¥ó¥é¥¤¥ó¥Ø¥ë¥×¤ò»ÈÍѤ·¤Æ¤¯¤À¤µ¤¤¡£");
-#else
- plog_fmt("Cannot find help file: %s", tmp);
- plog("Use the online help files instead.");
-#endif
-
+ plog_fmt(_("ヘルプファイル[%s]が見付かりません。", "Cannot find help file: %s"), tmp);
+ plog(_("代わりにオンラインヘルプを使用してください。", "Use the online help files instead."));
}
break;
#else /* HTML_HELP */
}
else
{
-#ifdef JP
- plog_fmt("¥Ø¥ë¥×¥Õ¥¡¥¤¥ë[%s]¤¬¸«ÉÕ¤«¤ê¤Þ¤»¤ó¡£", tmp);
- plog("Âå¤ï¤ê¤Ë¥ª¥ó¥é¥¤¥ó¥Ø¥ë¥×¤ò»ÈÍѤ·¤Æ¤¯¤À¤µ¤¤¡£");
-#else
- plog_fmt("Cannot find help file: %s", tmp);
- plog("Use the online help files instead.");
-#endif
+ plog_fmt(_("ヘルプファイル[%s]が見付かりません。", "Cannot find help file: %s"), tmp);
+ plog(_("代わりにオンラインヘルプを使用してください。", "Use the online help files instead."));
}
break;
LRESULT FAR PASCAL AngbandWndProc(HWND hWnd, UINT uMsg,
WPARAM wParam, LPARAM lParam)
#else /* __MWERKS__ */
-LRESULT FAR PASCAL AngbandWndProc(HWND hWnd, UINT uMsg,
- WPARAM wParam, LPARAM lParam)
+LRESULT FAR PASCAL AngbandWndProc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
#endif /* __MWERKS__ */
{
PAINTSTRUCT ps;
/* Handle message */
switch (uMsg)
{
- /* XXX XXX XXX */
case WM_NCCREATE:
{
SetWindowLong(hWnd, 0, (LONG)(my_td));
break;
}
- /* XXX XXX XXX */
case WM_CREATE:
{
#ifdef USE_MUSIC
{
HGLOBAL hGlobal;
LPSTR lpStr;
- int i, j, sz;
- int dx = abs(oldx - mousex) + 1;
- int dy = abs(oldy - mousey) + 1;
- int ox = (oldx > mousex) ? mousex : oldx;
- int oy = (oldy > mousey) ? mousey : oldy;
+ int j, sz;
+ TERM_LEN dx = abs(oldx - mousex) + 1;
+ TERM_LEN dy = abs(oldy - mousey) + 1;
+ TERM_LEN ox = (oldx > mousex) ? mousex : oldx;
+ TERM_LEN oy = (oldy > mousey) ? mousey : oldy;
mouse_down = FALSE;
paint_rect = FALSE;
{
if (!can_save)
{
-#ifdef JP
- plog("º£¤Ï½ªÎ»¤Ç¤¤Þ¤»¤ó¡£");
-#else
- plog("You may not do that right now.");
-#endif
+ plog(_("今は終了できません。", "You may not do that right now."));
return 0;
}
/* Mega-Hack -- Delay death */
if (p_ptr->chp < 0) p_ptr->is_dead = FALSE;
-
-#ifdef JP
- do_cmd_write_nikki(NIKKI_GAMESTART, 0, "----¥²¡¼¥àÃæÃÇ----");
-#else
- do_cmd_write_nikki(NIKKI_GAMESTART, 0, "---- Save and Exit Game ----");
-#endif
+ do_cmd_write_nikki(NIKKI_GAMESTART, 0, _("----ゲーム中断----", "---- Save and Exit Game ----"));
/* Hardcode panic save */
p_ptr->panic_save = 1;
signals_ignore_tstp();
/* Indicate panic save */
-#ifdef JP
- (void)strcpy(p_ptr->died_from, "(¶ÛµÞ¥»¡¼¥Ö)");
-#else
- (void)strcpy(p_ptr->died_from, "(panic save)");
-#endif
+ (void)strcpy(p_ptr->died_from, _("(緊急セーブ)", "(panic save)"));
/* Panic save */
(void)save_player();
case SIZE_MAXIMIZED:
{
- /* fall through XXX XXX XXX */
+ /* fall through */
}
case SIZE_RESTORED:
{
- uint cols = (LOWORD(lParam) - td->size_ow1) / td->tile_wid;
- uint rows = (HIWORD(lParam) - td->size_oh1) / td->tile_hgt;
+ TERM_LEN cols = (LOWORD(lParam) - td->size_ow1) / td->tile_wid;
+ TERM_LEN rows = (HIWORD(lParam) - td->size_oh1) / td->tile_hgt;
/* New size */
if ((td->cols != cols) || (td->rows != rows))
/* Process message */
switch (uMsg)
{
- /* XXX XXX XXX */
case WM_NCCREATE:
{
SetWindowLong(hWnd, 0, (LONG)(my_td));
break;
}
- /* XXX XXX XXX */
case WM_CREATE:
{
return 0;
case WM_SIZE:
{
- uint cols;
- uint rows;
+ TERM_LEN cols;
+ TERM_LEN rows;
/* this message was sent before WM_NCCREATE */
if (!td) return 1;
/* HACK - Redraw all windows */
p_ptr->window = 0xFFFFFFFF;
- window_stuff();
+ handle_stuff();
}
td->size_hack = FALSE;
/* Process */
switch (uMsg)
{
- /* XXX XXX XXX */
case WM_NCCREATE:
{
break;
}
}
- /* Oops */
return DefWindowProc(hWnd, uMsg, wParam, lParam);
}
/*
* Display warning message (see "z-util.c")
*/
-static void hack_plog(cptr str)
+static void hack_plog(concptr str)
{
/* Give a warning */
if (str)
{
#ifdef JP
- MessageBox(NULL, str, "·Ù¹ð¡ª",
+ MessageBox(NULL, str, "警告!",
MB_ICONEXCLAMATION | MB_OK);
#else
MessageBox(NULL, str, "Warning",
/*
* Display error message and quit (see "z-util.c")
*/
-static void hack_quit(cptr str)
+static void hack_quit(concptr str)
{
/* Give a warning */
if (str)
{
#ifdef JP
- MessageBox(NULL, str, "¥¨¥é¡¼¡ª",
+ MessageBox(NULL, str, "エラー!",
MB_ICONEXCLAMATION | MB_OK | MB_ICONSTOP);
#else
MessageBox(NULL, str, "Error",
/*
* Display warning message (see "z-util.c")
*/
-static void hook_plog(cptr str)
+static void hook_plog(concptr str)
{
/* Warning */
if (str)
{
#ifdef JP
- MessageBox(data[0].w, str, "·Ù¹ð¡ª",
+ MessageBox(data[0].w, str, "警告!",
MB_ICONEXCLAMATION | MB_OK);
#else
MessageBox(data[0].w, str, "Warning",
/*
* Display error message and quit (see "z-util.c")
*/
-static void hook_quit(cptr str)
+static void hook_quit(concptr str)
{
int i;
if (str)
{
#ifdef JP
- MessageBox(data[0].w, str, "¥¨¥é¡¼¡ª",
+ MessageBox(data[0].w, str, "エラー!",
MB_ICONEXCLAMATION | MB_OK | MB_ICONSTOP);
#else
MessageBox(data[0].w, str, "Error",
save_prefs();
- /*** Could use 'Term_nuke_win()' XXX XXX XXX */
+ /*** Could use 'Term_nuke_win()' */
/* Destroy all windows */
for (i = MAX_TERM_DATA - 1; i >= 0; --i)
/* Get program name with full path */
GetModuleFileName(hInstance, path, 512);
- /* Save the "program name" XXX XXX XXX */
+ /* Save the "program name" */
argv0 = path;
/* Get the name of the "*.ini" file */
validate_dir(ANGBAND_DIR_XTRA, TRUE);
/* Build the filename */
-#ifdef JP
- path_build(path, sizeof(path), ANGBAND_DIR_FILE, "news_j.txt");
-#else
- path_build(path, sizeof(path), ANGBAND_DIR_FILE, "news.txt");
-#endif
-
+ path_build(path, sizeof(path), ANGBAND_DIR_FILE, _("news_j.txt", "news.txt"));
/* Hack -- Validate the "news.txt" file */
validate_file(path);
/* validate_dir(ANGBAND_DIR_XTRA_HELP); */
}
-bool is_already_running()
+/*!
+ * @brief (Windows固有)変愚蛮怒が起動済かどうかのチェック
+ */
+static bool is_already_running(void)
{
bool result = FALSE;
HANDLE hMutex;
}
+/*!
+ * @brief (Windows固有)Windowsアプリケーションとしてのエントリポイント
+ */
int FAR PASCAL WinMain(HINSTANCE hInst, HINSTANCE hPrevInst,
LPSTR lpCmdLine, int nCmdShow)
{
HDC hdc;
MSG msg;
- setlocale( LC_ALL, "ja_JP" );
+ setlocale(LC_ALL, "ja_JP.utf8");
/* Unused */
(void)nCmdShow;
if (is_already_running())
{
MessageBox(NULL,
- _("ÊѶòÈÚÅܤϤ¹¤Ç¤Ëµ¯Æ°¤·¤Æ¤¤¤Þ¤¹¡£", "Hengband is already running."),
- _("¥¨¥é¡¼¡ª", "Error") ,
+ _("変愚蛮怒はすでに起動しています。", "Hengband is already running."),
+ _("エラー!", "Error") ,
MB_ICONEXCLAMATION | MB_OK | MB_ICONSTOP);
return FALSE;
}
- /* Initialize */
if (hPrevInst == NULL)
{
wc.style = CS_CLASSDC;
/* Catch nasty signals */
signals_init();
- /* Initialize */
+ Term_activate(term_screen);
init_angband();
/* We are now initialized */
#endif
/* Prompt the user */
-#ifdef JP
- prt("[¥Õ¥¡¥¤¥ë] ¥á¥Ë¥å¡¼¤Î [¿·µ¬] ¤Þ¤¿¤Ï [³«¤¯] ¤òÁªÂò¤·¤Æ¤¯¤À¤µ¤¤¡£", 23, 8);
-#else
- prt("[Choose 'New' or 'Open' from the 'File' menu]", 23, 17);
-#endif
+ prt(_("[ファイル] メニューの [新規] または [開く] を選択してください。", "[Choose 'New' or 'Open' from the 'File' menu]"), 23, _(8, 17));
Term_fresh();
TranslateMessage(&msg);
DispatchMessage(&msg);
}
-
- /* Paranoia */
quit(NULL);
-
- /* Paranoia */
return (0);
}