diff options
-rw-r--r-- | src/cave.c | 12 | ||||
-rw-r--r-- | src/dungeon.c | 4 | ||||
-rw-r--r-- | src/generate.c | 17 | ||||
-rw-r--r-- | src/main-gtk2.c | 118 | ||||
-rw-r--r-- | src/main-win.c | 83 |
5 files changed, 1 insertions, 233 deletions
@@ -501,21 +501,11 @@ static void image_random(byte *ap, char *cp) /* * The 16x16 tile of the terrain supports lighting */ -#if 1 - -#define feat_supports_lighting(F) \ -((f_info[F].flags1 & FF1_SUPPORT_LIGHT) != 0) - -#else - static bool_ feat_supports_lighting(byte feat) { - if (f_info[feat].flags1 & FF1_SUPPORT_LIGHT) return TRUE; - else return FALSE; + return (f_info[feat].flags1 & FF1_SUPPORT_LIGHT) != 0; } -#endif - char get_shimmer_color() { diff --git a/src/dungeon.c b/src/dungeon.c index 3bf40690..43db5b29 100644 --- a/src/dungeon.c +++ b/src/dungeon.c @@ -5486,8 +5486,6 @@ void play_game(bool_ new_game) } } -#if 1 - /* Process old character */ if (!new_game) { @@ -5495,8 +5493,6 @@ void play_game(bool_ new_game) process_player_name(FALSE); } -#endif - /* Init the RNG */ if (Rand_quick) { diff --git a/src/generate.c b/src/generate.c index bedd169d..313d9498 100644 --- a/src/generate.c +++ b/src/generate.c @@ -586,8 +586,6 @@ void place_new_way(int *y, int *x) /* Check if it connects to current dungeon */ while (in_bounds(yy, xx)) { -#if 1 - /* Check grids ahead */ if (is_safe_floor(yy + y0, xx + x0)) ok = TRUE; @@ -595,21 +593,6 @@ void place_new_way(int *y, int *x) if (is_safe_floor(yy + y1, xx + x1)) ok = TRUE; if (is_safe_floor(yy + y2, xx + x2)) ok = TRUE; -#else - - /* - * This can create unconnected sections if it bumps into a - * non-penetrating streamer - */ - /* Check grids ahead */ - if (cave_floor_bold(yy + y0, xx + x0)) ok = TRUE; - - /* Check side grids */ - if (cave_floor_bold(yy + y1, xx + x1)) ok = TRUE; - if (cave_floor_bold(yy + y2, xx + x2)) ok = TRUE; - -#endif - /* Connected */ if (ok) break; diff --git a/src/main-gtk2.c b/src/main-gtk2.c index 4830638a..e55b038e 100644 --- a/src/main-gtk2.c +++ b/src/main-gtk2.c @@ -3586,7 +3586,6 @@ static gboolean keypress_event_handler( GdkEventKey *event, gpointer user_data) { -#if 1 int i, mc, ms, mo, mx; char msg[128]; @@ -3703,123 +3702,6 @@ static gboolean keypress_event_handler( } return (TRUE); - -#else - int i, mc, ms, mo, mx; - - char msg[128]; - - - /* Extract four "modifier flags" */ - mc = (event->state & GDK_CONTROL_MASK) ? TRUE : FALSE; - ms = (event->state & GDK_SHIFT_MASK) ? TRUE : FALSE; - mo = (event->state & GDK_MOD1_MASK) ? TRUE : FALSE; - mx = (event->state & GDK_MOD3_MASK) ? TRUE : FALSE; - printf("0=%d 9=%d;; keyval=%d; mc=%d, ms=%d ::=:: ", GDK_KP_0, GDK_KP_9, event->keyval, mc, ms); - /* Enqueue the normal key(s) */ - for (i = 0; i < event->length; i++) printf("%d;", event->string[i]); - printf("\n"); - - /* - * Hack XXX - * Parse shifted numeric (keypad) keys specially. - */ - if ((event->state & GDK_SHIFT_MASK) - && (event->keyval >= GDK_KP_Left) && (event->keyval <= GDK_KP_Delete)) - { - /* Build the macro trigger string */ - strnfmt(msg, 128, "%cS_%X%c", 31, event->keyval, 13); - printf("%cS_%X%c", 31, event->keyval, 13); - - /* Enqueue the "macro trigger" string */ - for (i = 0; msg[i]; i++) Term_keypress(msg[i]); - - /* Hack -- auto-define macros as needed */ - if (event->length && (macro_find_exact(msg) < 0)) - { - /* Create a macro */ - macro_add(msg, event->string); - } - - return (TRUE); - } - - /* Normal keys with no modifiers */ - if (event->length && !mo && !mx) - { - /* Enqueue the normal key(s) */ - for (i = 0; i < event->length; i++) Term_keypress(event->string[i]); - - /* All done */ - return (TRUE); - } - - /* Handle a few standard keys (bypass modifiers) XXX XXX XXX */ - switch ((uint) event->keyval) - { - case GDK_Escape: - { - Term_keypress(ESCAPE); - return (TRUE); - } - - case GDK_Return: - { - Term_keypress('\r'); - return (TRUE); - } - - case GDK_Tab: - { - Term_keypress('\t'); - return (TRUE); - } - - case GDK_Delete: - case GDK_BackSpace: - { - Term_keypress('\010'); - return (TRUE); - } - - case GDK_Shift_L: - case GDK_Shift_R: - case GDK_Control_L: - case GDK_Control_R: - case GDK_Caps_Lock: - case GDK_Shift_Lock: - case GDK_Meta_L: - case GDK_Meta_R: - case GDK_Alt_L: - case GDK_Alt_R: - case GDK_Super_L: - case GDK_Super_R: - case GDK_Hyper_L: - case GDK_Hyper_R: - { - /* Hack - do nothing to control characters */ - return (TRUE); - } - } - - /* Build the macro trigger string */ - strnfmt(msg, 128, "%c%s%s%s%s_%X%c", 31, - mc ? "N" : "", ms ? "S" : "", - mo ? "O" : "", mx ? "M" : "", - event->keyval, 13); - - /* Enqueue the "macro trigger" string */ - for (i = 0; msg[i]; i++) Term_keypress(msg[i]); - - /* Hack -- auto-define macros as needed */ - if (event->length && (macro_find_exact(msg) < 0)) - { - /* Create a macro */ - macro_add(msg, event->string); - } - - return (TRUE); -#endif } diff --git a/src/main-win.c b/src/main-win.c index 3674c88d..fdde5e87 100644 --- a/src/main-win.c +++ b/src/main-win.c @@ -548,7 +548,6 @@ static BYTE win_pal[256] = static bool_ special_key[256]; static bool_ ignore_key[256]; -#if 1 /* * Hack -- initialization list for "special_key" */ @@ -574,88 +573,6 @@ static byte ignore_key_list[] = { VK_LSHIFT, VK_RSHIFT, VK_LCONTROL, VK_RCONTROL, VK_LMENU, VK_RMENU, 0 }; -#else -/* -* Hack -- initialization list for "special_key" -* -* We ignore the modifier keys (shift, control, alt, num lock, scroll lock), -* and the normal keys (escape, tab, return, letters, numbers, etc), but we -* catch the keypad keys (with and without numlock set, including keypad 5), -* the function keys (including the "menu" key which maps to F10), and the -* "pause" key (between scroll lock and numlock). We also catch a few odd -* keys which I do not recognize, but which are listed among keys which we -* do catch, so they should be harmless to catch. -*/ -static byte special_key_list[] = -{ - VK_CLEAR, /* 0x0C (KP<5>) */ - - VK_PAUSE, /* 0x13 (pause) */ - - VK_PRIOR, /* 0x21 (KP<9>) */ - VK_NEXT, /* 0x22 (KP<3>) */ - VK_END, /* 0x23 (KP<1>) */ - VK_HOME, /* 0x24 (KP<7>) */ - VK_LEFT, /* 0x25 (KP<4>) */ - VK_UP, /* 0x26 (KP<8>) */ - VK_RIGHT, /* 0x27 (KP<6>) */ - VK_DOWN, /* 0x28 (KP<2>) */ - VK_SELECT, /* 0x29 (?????) */ - VK_PRINT, /* 0x2A (?????) */ - VK_EXECUTE, /* 0x2B (?????) */ - VK_SNAPSHOT, /* 0x2C (?????) */ - VK_INSERT, /* 0x2D (KP<0>) */ - VK_DELETE, /* 0x2E (KP<.>) */ - VK_HELP, /* 0x2F (?????) */ - -#if 0 - VK_NUMPAD0, /* 0x60 (KP<0>) */ - VK_NUMPAD1, /* 0x61 (KP<1>) */ - VK_NUMPAD2, /* 0x62 (KP<2>) */ - VK_NUMPAD3, /* 0x63 (KP<3>) */ - VK_NUMPAD4, /* 0x64 (KP<4>) */ - VK_NUMPAD5, /* 0x65 (KP<5>) */ - VK_NUMPAD6, /* 0x66 (KP<6>) */ - VK_NUMPAD7, /* 0x67 (KP<7>) */ - VK_NUMPAD8, /* 0x68 (KP<8>) */ - VK_NUMPAD9, /* 0x69 (KP<9>) */ - VK_MULTIPLY, /* 0x6A (KP<*>) */ - VK_ADD, /* 0x6B (KP<+>) */ - VK_SEPARATOR, /* 0x6C (?????) */ - VK_SUBTRACT, /* 0x6D (KP<->) */ - VK_DECIMAL, /* 0x6E (KP<.>) */ - VK_DIVIDE, /* 0x6F (KP</>) */ -#endif - - VK_F1, /* 0x70 */ - VK_F2, /* 0x71 */ - VK_F3, /* 0x72 */ - VK_F4, /* 0x73 */ - VK_F5, /* 0x74 */ - VK_F6, /* 0x75 */ - VK_F7, /* 0x76 */ - VK_F8, /* 0x77 */ - VK_F9, /* 0x78 */ - VK_F10, /* 0x79 */ - VK_F11, /* 0x7A */ - VK_F12, /* 0x7B */ - VK_F13, /* 0x7C */ - VK_F14, /* 0x7D */ - VK_F15, /* 0x7E */ - VK_F16, /* 0x7F */ - VK_F17, /* 0x80 */ - VK_F18, /* 0x81 */ - VK_F19, /* 0x82 */ - VK_F20, /* 0x83 */ - VK_F21, /* 0x84 */ - VK_F22, /* 0x85 */ - VK_F23, /* 0x86 */ - VK_F24, /* 0x87 */ - - 0 -}; -#endif - /* * Hack -- given a pathname, point at the filename |