/*
* was main window maximized on previous playing
*/
-bool win_maximized = FALSE;
+bool win_maximized = false;
/*
* game in progress
/*
* note when "open"/"new" become valid
*/
-bool initialized = FALSE;
+bool initialized = false;
/*
* Saved instance handle
/*
* Show sub-windows even when Hengband is not in focus
*/
-static bool keep_subwindows = TRUE;
+static bool keep_subwindows = true;
/*
* Full path to ANGBAND.INI
/*
* Flag for macro trigger with dump ASCII
*/
-static bool term_no_press = FALSE;
+static bool term_no_press = false;
/*
* Copy and paste
*/
-static bool mouse_down = FALSE;
-static bool paint_rect = FALSE;
+static bool mouse_down = false;
+static bool paint_rect = false;
static TERM_LEN mousex = 0, mousey = 0;
static TERM_LEN oldx, oldy;
{
bool *result = (bool *)dwDate;
*result = true;
- return FALSE;
+ return false;
}
/*!
static void load_prefs(void)
{
arg_graphics = (byte)GetPrivateProfileIntA("Angband", "Graphics", static_cast<byte>(graphics_mode::GRAPHICS_NONE), ini_file);
- arg_bigtile = (GetPrivateProfileIntA("Angband", "Bigtile", FALSE, ini_file) != 0);
+ arg_bigtile = (GetPrivateProfileIntA("Angband", "Bigtile", false, ini_file) != 0);
use_bigtile = arg_bigtile;
arg_sound = (GetPrivateProfileIntA("Angband", "Sound", 0, ini_file) != 0);
arg_music = (GetPrivateProfileIntA("Angband", "Music", 0, ini_file) != 0);
static void init_music(void)
{
// Flag set once "music" has been initialized
- static bool can_use_music = FALSE;
+ static bool can_use_music = false;
if (!can_use_music) {
main_win_music::load_music_prefs();
- can_use_music = TRUE;
+ can_use_music = true;
}
}
static void init_sound(void)
{
// Flag set once "sound" has been initialized
- static bool can_use_sound = FALSE;
+ static bool can_use_sound = false;
if (!can_use_sound) {
load_sound_prefs();
- can_use_sound = TRUE;
+ can_use_sound = true;
}
}
static void init_background(void)
{
// Flag set once "background" has been initialized
- static bool can_use_background = FALSE;
+ static bool can_use_background = false;
if (!can_use_background) {
load_bg_prefs();
- can_use_background = TRUE;
+ can_use_background = true;
}
}
static HBITMAP WALL;
static HBRUSH myBrush, oldBrush;
static HPEN oldPen;
- static bool init_done = FALSE;
+ static bool init_done = false;
if (!init_done) {
WALL = LoadBitmapW(hInstance, AppName);
myBrush = CreatePatternBrush(WALL);
- init_done = TRUE;
+ init_done = true;
}
RECT rc{ static_cast<LONG>(x * td->tile_wid + td->size_ow1), static_cast<LONG>(y * td->tile_hgt + td->size_oh1),
rc.right += 2 * td->tile_wid;
} else if (iskanji(*(s + i))) /* 2バイト文字 */
{
- const auto *buf = to_wchar(s + i).wc_str();
+ char tmp[] = { *(s + i), *(s + i + 1), '\0' };
+ to_wchar wc(tmp);
+ const auto *buf = wc.wc_str();
rc.right += td->font_wid;
if (buf == NULL)
ExtTextOutA(hdc, rc.left, rc.top, ETO_CLIPPED, &rc, s + i, 2, NULL);
{
term_type *t = &td->t;
term_init(t, td->cols, td->rows, FILE_READ_BUFF_SIZE);
- t->soft_cursor = TRUE;
- t->higher_pict = TRUE;
+ t->soft_cursor = true;
+ t->higher_pict = true;
t->attr_blank = TERM_WHITE;
t->char_blank = ' ';
t->user_hook = term_user_win;
td->rows = 24;
td->cols = 80;
- td->visible = TRUE;
+ td->visible = true;
td->size_ow1 = 2;
td->size_ow2 = 2;
td->size_oh1 = 2;
td->size_oh2 = 2;
td->pos_x = 7 * 30;
td->pos_y = 7 * 20;
- td->posfix = FALSE;
+ td->posfix = false;
for (int i = 1; i < MAX_TERM_DATA; i++) {
td = &data[i];
td->name = win_term_name[i];
td->rows = 24;
td->cols = 80;
- td->visible = FALSE;
+ td->visible = false;
td->size_ow1 = 1;
td->size_ow2 = 1;
td->size_oh1 = 1;
td->size_oh2 = 1;
td->pos_x = (7 - i) * 30;
td->pos_y = (7 - i) * 20;
- td->posfix = FALSE;
+ td->posfix = false;
}
load_prefs();
td = &data[0];
td->dwStyle = (WS_OVERLAPPED | WS_THICKFRAME | WS_SYSMENU | WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_CAPTION | WS_VISIBLE);
td->dwExStyle = 0;
- td->visible = TRUE;
+ td->visible = true;
/* Attributes of sub windows */
for (int i = 1; i < MAX_TERM_DATA; i++) {
if (!td->w)
quit(_("サブウィンドウに作成に失敗しました", "Failed to create sub-window"));
- td->size_hack = TRUE;
+ td->size_hack = true;
term_getsize(td);
term_window_resize(td);
if (td->visible) {
ShowWindow(td->w, SW_SHOW);
}
- td->size_hack = FALSE;
+ td->size_hack = false;
term_data_link(td);
angband_term[i] = &td->t;
quit(_("メインウィンドウの作成に失敗しました", "Failed to create Angband window"));
/* Resize */
- td->size_hack = TRUE;
+ td->size_hack = true;
term_getsize(td);
term_window_resize(td);
- td->size_hack = FALSE;
+ td->size_hack = false;
term_data_link(td);
angband_term[0] = &td->t;
break;
}
- msg_flag = FALSE;
- do_cmd_save_game(player_ptr, FALSE);
+ msg_flag = false;
+ do_cmd_save_game(player_ptr, false);
} else {
plog(_("今、セーブすることは出来ません。", "You may not do that right now."));
}
break;
}
- msg_flag = FALSE;
+ msg_flag = false;
forget_lite(player_ptr->current_floor_ptr);
forget_view(player_ptr->current_floor_ptr);
clear_mon_lite(player_ptr->current_floor_ptr);
td = &data[i];
if (!td->visible) {
- td->visible = TRUE;
+ td->visible = true;
ShowWindow(td->w, SW_SHOW);
term_data_redraw(td);
} else {
- td->visible = FALSE;
- td->posfix = FALSE;
+ td->visible = false;
+ td->posfix = false;
ShowWindow(td->w, SW_HIDE);
}
td = &data[i];
if (!td->posfix && td->visible) {
- td->posfix = TRUE;
+ td->posfix = true;
term_window_pos(td, HWND_TOPMOST);
} else {
- td->posfix = FALSE;
+ td->posfix = false;
term_window_pos(td, data[0].w);
}
*/
static bool process_keydown(WPARAM wParam, LPARAM lParam)
{
- bool mc = FALSE;
- bool ms = FALSE;
- bool ma = FALSE;
+ bool mc = false;
+ bool ms = false;
+ bool ma = false;
if (GetKeyState(VK_CONTROL) & 0x8000)
- mc = TRUE;
+ mc = true;
if (GetKeyState(VK_SHIFT) & 0x8000)
- ms = TRUE;
+ ms = true;
if (GetKeyState(VK_MENU) & 0x8000)
- ma = TRUE;
+ ma = true;
- term_no_press = (ma) ? TRUE : FALSE;
+ term_no_press = (ma) ? true : false;
if (special_key[(byte)(wParam)] || (ma && !ignore_key[(byte)(wParam)])) {
- bool ext_key = (lParam & 0x1000000L) ? TRUE : FALSE;
- bool numpad = FALSE;
+ bool ext_key = (lParam & 0x1000000L) ? true : false;
+ bool numpad = false;
term_keypress(31);
if (mc)
term_keypress('x');
switch (wParam) {
case VK_DIVIDE:
- term_no_press = TRUE;
+ term_no_press = true;
[[fallthrough]]; /* Fall through */
case VK_RETURN:
numpad = ext_key;
case VK_SUBTRACT:
case VK_SEPARATOR:
case VK_DECIMAL:
- term_no_press = TRUE;
+ term_no_press = true;
[[fallthrough]]; /* Fall through */
case VK_CLEAR:
case VK_HOME:
case SIZE_RESTORED: {
fit_term_size_to_window(td);
- td->size_hack = TRUE;
+ td->size_hack = true;
for (int i = 1; i < MAX_TERM_DATA; i++) {
if (data[i].visible)
ShowWindow(data[i].w, SW_SHOWNA);
}
- td->size_hack = FALSE;
+ td->size_hack = false;
return true;
}
case WM_CHAR: {
// wParam is WCHAR because using RegisterClassW
if (term_no_press)
- term_no_press = FALSE;
+ term_no_press = false;
else {
WCHAR wc[2] = { (WCHAR)wParam, '\0' };
term_keypress(to_multibyte(wc).c_str());
return 0;
mousex = MIN(LOWORD(lParam) / td->tile_wid, td->cols - 1);
mousey = MIN(HIWORD(lParam) / td->tile_hgt, td->rows - 1);
- mouse_down = TRUE;
+ mouse_down = true;
oldx = mousex;
oldy = mousey;
return 0;
TERM_LEN ox = (oldx > mousex) ? mousex : oldx;
TERM_LEN oy = (oldy > mousey) ? mousey : oldy;
- mouse_down = FALSE;
- paint_rect = FALSE;
+ mouse_down = false;
+ paint_rect = false;
#ifdef JP
int sz = (dx + 3) * dy;
oy = (oldy > mousey) ? mousey : oldy;
term_inversed_area(hWnd, ox, oy, dx, dy);
} else {
- paint_rect = TRUE;
+ paint_rect = true;
}
dx = abs(cx - mousex) + 1;
return 0;
}
- msg_flag = FALSE;
+ msg_flag = false;
forget_lite(p_ptr->current_floor_ptr);
forget_view(p_ptr->current_floor_ptr);
clear_mon_lite(p_ptr->current_floor_ptr);
return 0;
}
- msg_flag = FALSE;
+ msg_flag = false;
if (p_ptr->chp < 0)
- p_ptr->is_dead = FALSE;
+ p_ptr->is_dead = false;
exe_write_diary(p_ptr, DIARY_GAMESTART, 0, _("----ゲーム中断----", "---- Save and Exit Game ----"));
p_ptr->panic_save = 1;
for (int i = 1; i < MAX_TERM_DATA; i++) {
if (data[i].visible) {
- if (wParam == TRUE) {
+ if (wParam == 1) {
ShowWindow(data[i].w, SW_SHOWNA);
} else {
ShowWindow(data[i].w, SW_HIDE);
case WM_CHAR: {
// wParam is WCHAR because using RegisterClassW
if (term_no_press)
- term_no_press = FALSE;
+ term_no_press = false;
else {
WCHAR wc[2] = { (WCHAR)wParam, '\0' };
term_keypress(to_multibyte(wc).c_str());
if (wParam == HTSYSMENU) {
if (td->visible) {
- td->visible = FALSE;
+ td->visible = false;
ShowWindow(td->w, SW_HIDE);
}
}
strcpy(path + i + 1, "lib\\");
- validate_dir(path, TRUE);
+ validate_dir(path, true);
init_file_paths(path, path);
- validate_dir(ANGBAND_DIR_APEX, FALSE);
- validate_dir(ANGBAND_DIR_BONE, FALSE);
+ validate_dir(ANGBAND_DIR_APEX, false);
+ validate_dir(ANGBAND_DIR_BONE, false);
if (!check_dir(ANGBAND_DIR_EDIT)) {
- validate_dir(ANGBAND_DIR_DATA, TRUE);
+ validate_dir(ANGBAND_DIR_DATA, true);
} else {
- validate_dir(ANGBAND_DIR_DATA, FALSE);
+ validate_dir(ANGBAND_DIR_DATA, false);
}
- validate_dir(ANGBAND_DIR_FILE, TRUE);
- validate_dir(ANGBAND_DIR_HELP, FALSE);
- validate_dir(ANGBAND_DIR_INFO, FALSE);
- validate_dir(ANGBAND_DIR_PREF, TRUE);
- validate_dir(ANGBAND_DIR_SAVE, FALSE);
- validate_dir(ANGBAND_DIR_DEBUG_SAVE, FALSE);
- validate_dir(ANGBAND_DIR_USER, TRUE);
- validate_dir(ANGBAND_DIR_XTRA, TRUE);
+ validate_dir(ANGBAND_DIR_FILE, true);
+ validate_dir(ANGBAND_DIR_HELP, false);
+ validate_dir(ANGBAND_DIR_INFO, false);
+ validate_dir(ANGBAND_DIR_PREF, true);
+ validate_dir(ANGBAND_DIR_SAVE, false);
+ validate_dir(ANGBAND_DIR_DEBUG_SAVE, false);
+ validate_dir(ANGBAND_DIR_USER, true);
+ validate_dir(ANGBAND_DIR_XTRA, true);
path_build(path, sizeof(path), ANGBAND_DIR_FILE, _("news_j.txt", "news.txt"));
validate_file(path);
path_build(path, sizeof(path), ANGBAND_DIR_XTRA, "graf");
ANGBAND_DIR_XTRA_GRAF = string_make(path);
- validate_dir(ANGBAND_DIR_XTRA_GRAF, TRUE);
+ validate_dir(ANGBAND_DIR_XTRA_GRAF, true);
path_build(path, sizeof(path), ANGBAND_DIR_XTRA, "sound");
ANGBAND_DIR_XTRA_SOUND = string_make(path);
- validate_dir(ANGBAND_DIR_XTRA_SOUND, FALSE);
+ validate_dir(ANGBAND_DIR_XTRA_SOUND, false);
path_build(path, sizeof(path), ANGBAND_DIR_XTRA, "music");
ANGBAND_DIR_XTRA_MUSIC = string_make(path);
- validate_dir(ANGBAND_DIR_XTRA_MUSIC, FALSE);
+ validate_dir(ANGBAND_DIR_XTRA_MUSIC, false);
for (i = 0; special_key_list[i]; ++i) {
- special_key[special_key_list[i]] = TRUE;
+ special_key[special_key_list[i]] = true;
}
for (i = 0; ignore_key_list[i]; ++i) {
- ignore_key[ignore_key_list[i]] = TRUE;
+ ignore_key[ignore_key_list[i]] = true;
}
ANGBAND_SYS = "win";
void create_debug_spoiler(void)
{
init_stuff();
- init_angband(p_ptr, TRUE);
+ init_angband(p_ptr, true);
switch (output_all_spoilers()) {
case spoiler_output_status::SPOILER_OUTPUT_SUCCESS:
if (is_already_running()) {
MessageBoxW(
NULL, _(L"変愚蛮怒はすでに起動しています。", L"Hengband is already running."), _(L"エラー!", L"Error"), MB_ICONEXCLAMATION | MB_OK | MB_ICONSTOP);
- return FALSE;
+ return 0;
}
command_line.handle();
signals_init();
term_activate(term_screen);
- init_angband(p_ptr, FALSE);
- initialized = TRUE;
+ init_angband(p_ptr, false);
+ initialized = true;
check_for_save_file(command_line.get_savefile_option());
prt(_("[ファイル] メニューの [新規] または [開く] を選択してください。", "[Choose 'New' or 'Open' from the 'File' menu]"), 23, _(8, 17));
term_flush();
if (movie_in_progress) {
// selected movie
- play_game(p_ptr, FALSE, TRUE);
+ play_game(p_ptr, false, true);
} else if (savefile[0] == '\0') {
// new game
- play_game(p_ptr, TRUE, FALSE);
+ play_game(p_ptr, true, false);
} else {
// selected savefile
- play_game(p_ptr, FALSE, FALSE);
+ play_game(p_ptr, false, false);
}
quit(NULL);