[Scummvm-cvs-logs] CVS: scummvm/simon simon.cpp,1.140,1.141 simon.h,1.44,1.45

Oliver Kiehl olki at users.sourceforge.net
Sun Jan 12 07:19:03 CET 2003


Update of /cvsroot/scummvm/scummvm/simon
In directory sc8-pr-cvs1:/tmp/cvs-serv1796

Modified Files:
	simon.cpp simon.h 
Log Message:
added F10 support (Hitareas are indicated when F10 is pressed)


Index: simon.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/simon.cpp,v
retrieving revision 1.140
retrieving revision 1.141
diff -u -d -r1.140 -r1.141
--- simon.cpp	12 Jan 2003 02:42:59 -0000	1.140
+++ simon.cpp	12 Jan 2003 15:17:58 -0000	1.141
@@ -1522,6 +1522,85 @@
 	return ha - _hit_areas;
 }
 
+void SimonState::f10_key()
+{
+	HitArea *ha;
+	uint count;
+	uint y_, x_;
+	byte *dst;
+	uint b;
+
+	_lock_word |= 0x8000;
+	
+	for (int i = 0; i < 5; i++) {
+		ha = _hit_areas;
+		count = ARRAYSIZE(_hit_areas);
+
+		timer_vga_sprites();
+
+		do {
+			if (ha->id != 0 && ha->flags & 0x20 && !(ha->flags & 0x40)) {
+				if (ha->y >= 0xc8 || ha->y >= _vga_var8)
+					continue;
+
+				y_ = (ha->height >> 1) - 4 + ha->y;
+
+				x_ = (ha->width >> 1) - 4 + ha->x - (_x_scroll << 3);
+
+				if (x_ < 0 || x_ >= 0x137)
+					continue;
+
+				dst = dx_lock_attached();
+
+				dst += (((_dx_surface_pitch >> 2) * y_) << 2) + x_;
+
+				b = _dx_surface_pitch;
+				dst[4] = 0xec;
+				dst[b+1] = 0xec;
+				dst[b+4] = 0xec;
+				dst[b+7] = 0xec;
+				b += _dx_surface_pitch;
+				dst[b+2] = 0xec;
+				dst[b+4] = 0xec;
+				dst[b+6] = 0xec;
+				b += _dx_surface_pitch;
+				dst[b+3] = 0xec;
+				dst[b+5] = 0xec;
+				b += _dx_surface_pitch;
+				dst[b] = 0xec;
+				dst[b+1] = 0xec;
+				dst[b+2] = 0xec;
+				dst[b+6] = 0xec;
+				dst[b+7] = 0xec;
+				dst[b+8] = 0xec;
+				b += _dx_surface_pitch;
+				dst[b+3] = 0xec;
+				dst[b+5] = 0xec;
+				b += _dx_surface_pitch;
+				dst[b+2] = 0xec;
+				dst[b+4] = 0xec;
+				dst[b+6] = 0xec;
+				b += _dx_surface_pitch;
+				dst[b+1] = 0xec;
+				dst[b+4] = 0xec;
+				dst[b+7] = 0xec;
+				b += _dx_surface_pitch;
+				dst[b+4] = 0xec;
+
+				dx_unlock_attached();
+			}
+		} while (ha++, --count);
+
+		dx_update_screen_and_palette();
+		delay(100);
+		timer_vga_sprites();
+		dx_update_screen_and_palette();
+		delay(100);
+	}
+
+	_lock_word &= ~0x8000;
+}
+
 void SimonState::hitarea_stuff()
 {
 	HitArea *ha;
@@ -1540,6 +1619,8 @@
 		_last_hitarea = NULL;
 		_last_hitarea_3 = NULL;
 		for (;;) {
+			if (_game & GAME_SIMON2 && _key_pressed == 35)
+				f10_key();
 			processSpecialKeys();
 			if (_last_hitarea_3 == (HitArea *) 0xFFFFFFFF)
 				goto startOver;

Index: simon.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/simon.h,v
retrieving revision 1.44
retrieving revision 1.45
diff -u -d -r1.44 -r1.45
--- simon.h	5 Jan 2003 00:47:49 -0000	1.44
+++ simon.h	12 Jan 2003 15:17:58 -0000	1.45
@@ -540,6 +540,7 @@
 	void new_current_hitarea(HitArea * ha);
 	bool hitarea_proc_2(uint a);
 	bool hitarea_proc_3(Item *item);
+	void f10_key();
 	void hitarea_stuff();
 
 	void handle_mouse_moved();





More information about the Scummvm-git-logs mailing list