[Scummvm-cvs-logs] SF.net SVN: scummvm: [22605] scummvm/trunk/engines/agi

aquadran at users.sourceforge.net aquadran at users.sourceforge.net
Wed May 24 04:41:06 CEST 2006


Revision: 22605
Author:   aquadran
Date:     2006-05-24 04:39:29 -0700 (Wed, 24 May 2006)
ViewCVS:  http://svn.sourceforge.net/scummvm/?rev=22605&view=rev

Log Message:
-----------
include mouse support always

Modified Paths:
--------------
    scummvm/trunk/engines/agi/agi.h
    scummvm/trunk/engines/agi/console.cpp
    scummvm/trunk/engines/agi/cycle.cpp
    scummvm/trunk/engines/agi/graphics.cpp
    scummvm/trunk/engines/agi/id.cpp
    scummvm/trunk/engines/agi/inv.cpp
    scummvm/trunk/engines/agi/keyboard.cpp
    scummvm/trunk/engines/agi/keyboard.h
    scummvm/trunk/engines/agi/menu.cpp
    scummvm/trunk/engines/agi/op_cmd.cpp
    scummvm/trunk/engines/agi/savegame.cpp
    scummvm/trunk/engines/agi/text.cpp
Modified: scummvm/trunk/engines/agi/agi.h
===================================================================
--- scummvm/trunk/engines/agi/agi.h	2006-05-24 10:37:45 UTC (rev 22604)
+++ scummvm/trunk/engines/agi/agi.h	2006-05-24 11:39:29 UTC (rev 22605)
@@ -50,7 +50,6 @@
 #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 @@
 	char *switches;
 };
 
-#ifdef USE_MOUSE
 struct mouse {
 	int button;
 	unsigned int x;
 	unsigned int y;
 };
-#endif
 
 /**
  * Command-line options.
@@ -221,9 +218,7 @@
 	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 struct agi_debug debug_;
 #endif
 
-#ifdef USE_MOUSE
 extern struct mouse mouse;
-#endif
 
 int console_keyhandler(int);
 int console_init(void);

Modified: scummvm/trunk/engines/agi/console.cpp
===================================================================
--- scummvm/trunk/engines/agi/console.cpp	2006-05-24 10:37:45 UTC (rev 22604)
+++ scummvm/trunk/engines/agi/console.cpp	2006-05-24 11:39:29 UTC (rev 22605)
@@ -674,12 +674,10 @@
 	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 @@
 	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?

Modified: scummvm/trunk/engines/agi/cycle.cpp
===================================================================
--- scummvm/trunk/engines/agi/cycle.cpp	2006-05-24 10:37:45 UTC (rev 22604)
+++ scummvm/trunk/engines/agi/cycle.cpp	2006-05-24 11:39:29 UTC (rev 22605)
@@ -36,9 +36,7 @@
 
 #define TICK_SECONDS	20
 
-#ifdef USE_MOUSE
 struct mouse mouse;
-#endif
 
 volatile uint32 clock_ticks;
 volatile uint32 clock_count;
@@ -211,7 +209,6 @@
 
 	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 @@
 		game.vars[28] = mouse.x / 2;
 		game.vars[29] = mouse.y;
 	}
-#endif
 
 #ifdef USE_CONSOLE
 	if (key == KEY_PRIORITY) {
@@ -326,10 +322,8 @@
 	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");
 

Modified: scummvm/trunk/engines/agi/graphics.cpp
===================================================================
--- scummvm/trunk/engines/agi/graphics.cpp	2006-05-24 10:37:45 UTC (rev 22604)
+++ scummvm/trunk/engines/agi/graphics.cpp	2006-05-24 11:39:29 UTC (rev 22605)
@@ -360,7 +360,6 @@
 	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 @@
 
 	return false;
 }
-#endif
 
 void put_block(int x1, int y1, int x2, int y2) {
 	gfx_putblock(x1, y1, x2, y2);

Modified: scummvm/trunk/engines/agi/id.cpp
===================================================================
--- scummvm/trunk/engines/agi/id.cpp	2006-05-24 10:37:45 UTC (rev 22604)
+++ scummvm/trunk/engines/agi/id.cpp	2006-05-24 11:39:29 UTC (rev 22605)
@@ -276,11 +276,9 @@
 					case 'a':
 						opt.agds = true;
 						break;
-#ifdef USE_MOUSE
 					case 'm':
 						opt.agimouse = true;
 						break;
-#endif
 					}
 				}
 				t++;

Modified: scummvm/trunk/engines/agi/inv.cpp
===================================================================
--- scummvm/trunk/engines/agi/inv.cpp	2006-05-24 10:37:45 UTC (rev 22604)
+++ scummvm/trunk/engines/agi/inv.cpp	2006-05-24 11:39:29 UTC (rev 22605)
@@ -61,7 +61,6 @@
 			(n / 2) + 2, 40, fg, bg);
 }
 
-#ifdef USE_MOUSE
 static int find_item() {
 	int r, c;
 
@@ -75,7 +74,6 @@
 
 	return (r - 2) * 2 + (c > 20);
 }
-#endif
 
 static int show_items() {
 	unsigned int x, i;
@@ -126,7 +124,6 @@
 			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 @@
 				}
 				break;
 			}
-#endif
 		default:
 			break;
 		}

Modified: scummvm/trunk/engines/agi/keyboard.cpp
===================================================================
--- scummvm/trunk/engines/agi/keyboard.cpp	2006-05-24 10:37:45 UTC (rev 22604)
+++ scummvm/trunk/engines/agi/keyboard.cpp	2006-05-24 11:39:29 UTC (rev 22605)
@@ -136,14 +136,12 @@
 		}
 	}
 
-#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 @@
 				break;
 			}
 		}
-#ifdef USE_MOUSE
 		if (!opt.agimouse) {
 			/* Handle mouse button events */
 			if (key == BUTTON_LEFT) {
@@ -186,7 +183,6 @@
 				return true;
 			}
 		}
-#endif
 
 		v->flags &= ~ADJ_EGO_XY;
 
@@ -354,11 +350,7 @@
 		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();

Modified: scummvm/trunk/engines/agi/keyboard.h
===================================================================
--- scummvm/trunk/engines/agi/keyboard.h	2006-05-24 10:37:45 UTC (rev 22604)
+++ scummvm/trunk/engines/agi/keyboard.h	2006-05-24 11:39:29 UTC (rev 22605)
@@ -67,10 +67,8 @@
 #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)

Modified: scummvm/trunk/engines/agi/menu.cpp
===================================================================
--- scummvm/trunk/engines/agi/menu.cpp	2006-05-24 10:37:45 UTC (rev 22604)
+++ scummvm/trunk/engines/agi/menu.cpp	2006-05-24 11:39:29 UTC (rev 22605)
@@ -146,7 +146,6 @@
 	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 @@
 
 	return true;
 }
-#endif
 
 static int h_index;
 static int v_index;
@@ -312,7 +310,6 @@
 		game.clock_enabled = false;
 		draw_menu_bar();
 	}
-#ifdef USE_MOUSE
 	/*
 	 * Mouse handling
 	 */
@@ -396,7 +393,6 @@
 			goto exit_menu;
 		}
 	}
-#endif				/* USE_MOUSE */
 
 	if (!menu_active) {
 		if (h_cur_menu >= 0) {

Modified: scummvm/trunk/engines/agi/op_cmd.cpp
===================================================================
--- scummvm/trunk/engines/agi/op_cmd.cpp	2006-05-24 10:37:45 UTC (rev 22604)
+++ scummvm/trunk/engines/agi/op_cmd.cpp	2006-05-24 11:39:29 UTC (rev 22605)
@@ -1183,13 +1183,11 @@
 }
 
 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(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 @@
 		report("not implemented: AGI Mouse palettes\n");
 		return;
 	} else
-#endif
 		shake_start();
 
 	commit_both();		/* Fixes SQ1 demo */

Modified: scummvm/trunk/engines/agi/savegame.cpp
===================================================================
--- scummvm/trunk/engines/agi/savegame.cpp	2006-05-24 10:37:45 UTC (rev 22604)
+++ scummvm/trunk/engines/agi/savegame.cpp	2006-05-24 11:39:29 UTC (rev 22605)
@@ -623,10 +623,8 @@
 			case KEY_ESCAPE:
 				rc = -1;
 				goto getout;
-#ifdef USE_MOUSE
 			case BUTTON_LEFT:
 				break;
-#endif
 			case KEY_DOWN:
 				active++;
 				active %= NUM_SLOTS;

Modified: scummvm/trunk/engines/agi/text.cpp
===================================================================
--- scummvm/trunk/engines/agi/text.cpp	2006-05-24 10:37:45 UTC (rev 22604)
+++ scummvm/trunk/engines/agi/text.cpp	2006-05-24 11:39:29 UTC (rev 22605)
@@ -364,7 +364,6 @@
 			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 @@
 					}
 				}
 				break;
-#endif
 			case 0x09:	/* Tab */
 				debugC(3, kDebugLevelText, "Focus change");
 				active++;
@@ -577,16 +575,10 @@
 
 #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 */


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.





More information about the Scummvm-git-logs mailing list