From 691ae72a591f761af458882a9ae5c5b945948921 Mon Sep 17 00:00:00 2001 From: Paweł Kołodziejski Date: Wed, 24 May 2006 11:39:29 +0000 Subject: include mouse support always svn-id: r22605 --- engines/agi/agi.h | 7 ------- engines/agi/console.cpp | 4 ---- engines/agi/cycle.cpp | 6 ------ engines/agi/graphics.cpp | 2 -- engines/agi/id.cpp | 2 -- engines/agi/inv.cpp | 4 ---- engines/agi/keyboard.cpp | 10 +--------- engines/agi/keyboard.h | 2 -- engines/agi/menu.cpp | 4 ---- engines/agi/op_cmd.cpp | 6 ------ engines/agi/savegame.cpp | 2 -- engines/agi/text.cpp | 8 -------- 12 files changed, 1 insertion(+), 56 deletions(-) (limited to 'engines/agi') diff --git a/engines/agi/agi.h b/engines/agi/agi.h index f6d890c80c..3f1b46bae8 100644 --- a/engines/agi/agi.h +++ b/engines/agi/agi.h @@ -50,7 +50,6 @@ typedef signed int Err; #define USE_PCM_SOUND #define USE_IIGS_SOUND #define USE_HIRES -#define USE_MOUSE #define AGDS_SUPPORT #define TITLE "AGI engine" @@ -191,13 +190,11 @@ struct game_id_list { char *switches; }; -#ifdef USE_MOUSE struct mouse { int button; unsigned int x; unsigned int y; }; -#endif /** * Command-line options. @@ -221,9 +218,7 @@ struct agi_options { int hires; /**< use hi-res pictures */ #endif int soundemu; /**< sound emulation mode */ -#ifdef USE_MOUSE int agimouse; /**< AGI Mouse 1.0 emulation */ -#endif }; extern struct agi_options opt; @@ -237,9 +232,7 @@ extern volatile uint32 msg_box_secs2; extern struct agi_debug debug_; #endif -#ifdef USE_MOUSE extern struct mouse mouse; -#endif int console_keyhandler(int); int console_init(void); diff --git a/engines/agi/console.cpp b/engines/agi/console.cpp index cbfa8b2b08..7b83842d34 100644 --- a/engines/agi/console.cpp +++ b/engines/agi/console.cpp @@ -674,12 +674,10 @@ int console_keyhandler(int k) { int16 y1, y2; char m[2]; -#ifdef USE_MOUSE /* Right button switches console on/off */ if (!opt.agimouse) /* AGI Mouse uses right button */ if (k == BUTTON_RIGHT) k = CONSOLE_ACTIVATE_KEY; -#endif if (!console.active) { if (k == CONSOLE_ACTIVATE_KEY) { @@ -709,11 +707,9 @@ int console_keyhandler(int k) { if (y2 < 0) y2 = 0; -#ifdef USE_MOUSE /* Ignore left button in console */ if (k == BUTTON_LEFT) return true; -#endif /* this code breaks scrolling up, maybe it shoud only be executed * in the default case? diff --git a/engines/agi/cycle.cpp b/engines/agi/cycle.cpp index 1c5365e4d1..08aea83410 100644 --- a/engines/agi/cycle.cpp +++ b/engines/agi/cycle.cpp @@ -36,9 +36,7 @@ namespace Agi { #define TICK_SECONDS 20 -#ifdef USE_MOUSE struct mouse mouse; -#endif volatile uint32 clock_ticks; volatile uint32 clock_count; @@ -211,7 +209,6 @@ int main_cycle() { key = do_poll_keyboard(); -#ifdef USE_MOUSE /* In AGI Mouse emulation mode we must update the mouse-related * vars in every interpreter cycle. */ @@ -219,7 +216,6 @@ int main_cycle() { game.vars[28] = mouse.x / 2; game.vars[29] = mouse.y; } -#endif #ifdef USE_CONSOLE if (key == KEY_PRIORITY) { @@ -326,10 +322,8 @@ static int play_game() { game.clock_enabled = true; game.line_user_input = 22; -#ifdef USE_MOUSE if (opt.agimouse) report("Using AGI Mouse 1.0 protocol\n"); -#endif report("Running AGI script.\n"); diff --git a/engines/agi/graphics.cpp b/engines/agi/graphics.cpp index d7ec377517..32b3a9aa22 100644 --- a/engines/agi/graphics.cpp +++ b/engines/agi/graphics.cpp @@ -360,7 +360,6 @@ void draw_button(int x, int y, char *s, int a, int p) { flush_block(x1, y1, x2, y2); } -#ifdef USE_MOUSE int test_button(int x, int y, char *s) { int len = strlen(s); int x1, y1, x2, y2; @@ -375,7 +374,6 @@ int test_button(int x, int y, char *s) { return false; } -#endif void put_block(int x1, int y1, int x2, int y2) { gfx_putblock(x1, y1, x2, y2); diff --git a/engines/agi/id.cpp b/engines/agi/id.cpp index 28c1c00200..70a1a9e098 100644 --- a/engines/agi/id.cpp +++ b/engines/agi/id.cpp @@ -276,11 +276,9 @@ uint32 match_crc(uint32 crc, char *name, int len) { case 'a': opt.agds = true; break; -#ifdef USE_MOUSE case 'm': opt.agimouse = true; break; -#endif } } t++; diff --git a/engines/agi/inv.cpp b/engines/agi/inv.cpp index 4d4014027e..bf9de04d74 100644 --- a/engines/agi/inv.cpp +++ b/engines/agi/inv.cpp @@ -61,7 +61,6 @@ static void print_item(int n, int fg, int bg) (n / 2) + 2, 40, fg, bg); } -#ifdef USE_MOUSE static int find_item() { int r, c; @@ -75,7 +74,6 @@ static int find_item() { return (r - 2) * 2 + (c > 20); } -#endif static int show_items() { unsigned int x, i; @@ -126,7 +124,6 @@ static void select_items(int n) { if (fsel % 2 == 0 && fsel + 1 < n) fsel++; break; -#ifdef USE_MOUSE case BUTTON_LEFT:{ int i = find_item(); if (i >= 0 && i < n) { @@ -139,7 +136,6 @@ static void select_items(int n) { } break; } -#endif default: break; } diff --git a/engines/agi/keyboard.cpp b/engines/agi/keyboard.cpp index 998b95f1cd..540d188bba 100644 --- a/engines/agi/keyboard.cpp +++ b/engines/agi/keyboard.cpp @@ -136,14 +136,12 @@ int handle_controller(int key) { } } -#ifdef USE_MOUSE if (key == BUTTON_LEFT) { if (getflag(F_menus_work) && mouse.y <= CHAR_LINES) { new_input_mode(INPUT_MENU); return true; } } -#endif if (game.player_control) { int d = 0; @@ -176,7 +174,6 @@ int handle_controller(int key) { break; } } -#ifdef USE_MOUSE if (!opt.agimouse) { /* Handle mouse button events */ if (key == BUTTON_LEFT) { @@ -186,7 +183,6 @@ int handle_controller(int key) { return true; } } -#endif v->flags &= ~ADJ_EGO_XY; @@ -354,11 +350,7 @@ int wait_key() { poll_timer(); /* msdos driver -> does nothing */ key = do_poll_keyboard(); if (!console_keyhandler(key)) { - if (key == KEY_ENTER || key == KEY_ESCAPE -#ifdef USE_MOUSE - || key == BUTTON_LEFT -#endif - ) + if (key == KEY_ENTER || key == KEY_ESCAPE || key == BUTTON_LEFT) break; } console_cycle(); diff --git a/engines/agi/keyboard.h b/engines/agi/keyboard.h index 7e507e5f97..d121b5012f 100644 --- a/engines/agi/keyboard.h +++ b/engines/agi/keyboard.h @@ -67,10 +67,8 @@ namespace Agi { #define KEY_HOME 0x4700 /* Home */ #define KEY_END 0x4f00 /* End * */ -#ifdef USE_MOUSE #define BUTTON_LEFT 0xF101 /* Left mouse button */ #define BUTTON_RIGHT 0xF202 /* Right mouse button */ -#endif #define KEY_SCAN(k) (k >> 8) #define KEY_ASCII(k) (k & 0xff) diff --git a/engines/agi/menu.cpp b/engines/agi/menu.cpp index 950b054cb3..3d4cb76bfe 100644 --- a/engines/agi/menu.cpp +++ b/engines/agi/menu.cpp @@ -146,7 +146,6 @@ static void new_menu_selected(int i) { draw_menu_option(i); } -#ifdef USE_MOUSE static int mouse_over_text(unsigned int line, unsigned int col, char *s) { if (mouse.x < col * CHAR_COLS) return false; @@ -162,7 +161,6 @@ static int mouse_over_text(unsigned int line, unsigned int col, char *s) { return true; } -#endif static int h_index; static int v_index; @@ -312,7 +310,6 @@ int menu_keyhandler(int key) { game.clock_enabled = false; draw_menu_bar(); } -#ifdef USE_MOUSE /* * Mouse handling */ @@ -396,7 +393,6 @@ int menu_keyhandler(int key) { goto exit_menu; } } -#endif /* USE_MOUSE */ if (!menu_active) { if (h_cur_menu >= 0) { diff --git a/engines/agi/op_cmd.cpp b/engines/agi/op_cmd.cpp index 042556b09e..e15152be55 100644 --- a/engines/agi/op_cmd.cpp +++ b/engines/agi/op_cmd.cpp @@ -1183,13 +1183,11 @@ cmd(print_at_v) { } cmd(push_script) { -#ifdef USE_MOUSE if (opt.agimouse) { game.vars[27] = mouse.button; game.vars[28] = mouse.x / 2; game.vars[29] = mouse.y; } else -#endif report("push.script\n"); } @@ -1210,16 +1208,13 @@ cmd(set_pri_base) { } cmd(mouse_posn) { -#ifdef USE_MOUSE _v[p0] = WIN_TO_PIC_X(mouse.x); _v[p1] = WIN_TO_PIC_Y(mouse.y); -#endif } cmd(shake_screen) { int i; -#ifdef USE_MOUSE /* AGI Mouse 1.1 uses shake.screen values between 100 and 109 to * set the palette. */ @@ -1227,7 +1222,6 @@ cmd(shake_screen) { report("not implemented: AGI Mouse palettes\n"); return; } else -#endif shake_start(); commit_both(); /* Fixes SQ1 demo */ diff --git a/engines/agi/savegame.cpp b/engines/agi/savegame.cpp index e4efc4402f..0eb5a27da6 100644 --- a/engines/agi/savegame.cpp +++ b/engines/agi/savegame.cpp @@ -623,10 +623,8 @@ static int select_slot() { case KEY_ESCAPE: rc = -1; goto getout; -#ifdef USE_MOUSE case BUTTON_LEFT: break; -#endif case KEY_DOWN: active++; active %= NUM_SLOTS; diff --git a/engines/agi/text.cpp b/engines/agi/text.cpp index 5619e1cf02..73d9dc1f1c 100644 --- a/engines/agi/text.cpp +++ b/engines/agi/text.cpp @@ -364,7 +364,6 @@ int selection_box(char *m, char **b) { case KEY_ESCAPE: rc = -1; goto getout; -#ifdef USE_MOUSE case BUTTON_LEFT: for (i = 0; b[i]; i++) { if (test_button(bx[i], by[i], b[i])) { @@ -373,7 +372,6 @@ int selection_box(char *m, char **b) { } } break; -#endif case 0x09: /* Tab */ debugC(3, kDebugLevelText, "Focus change"); active++; @@ -577,16 +575,10 @@ void write_status() { #ifdef USE_CONSOLE if (debug_.statusline) { -#ifdef USE_MOUSE print_status("%3d(%03d) %3d,%3d(%3d,%3d) ", getvar(0), getvar(1), game.view_table[0].x_pos, game.view_table[0].y_pos, WIN_TO_PIC_X(mouse.x), WIN_TO_PIC_Y(mouse.y)); -#else - print_status("%3d(%03d) %3d,%3d ", - getvar(0), getvar(1), game.view_table[0].x_pos, - game.view_table[0].y_pos); -#endif return; } #endif /* USE_CONSOLE */ -- cgit v1.2.3