[Scummvm-cvs-logs] CVS: scummvm/simon res.cpp,1.7,1.8 simon.cpp,1.37,1.38 verb.cpp,1.3,1.4

Max Horn fingolfin at users.sourceforge.net
Wed Oct 30 17:28:08 CET 2002


Update of /cvsroot/scummvm/scummvm/simon
In directory usw-pr-cvs1:/tmp/cvs-serv23661

Modified Files:
	res.cpp simon.cpp verb.cpp 
Log Message:
some more cleanup

Index: res.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/res.cpp,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- res.cpp	24 Oct 2002 09:40:20 -0000	1.7
+++ res.cpp	31 Oct 2002 01:27:05 -0000	1.8
@@ -263,8 +263,6 @@
 		table = opcode_arg_table_simon2win;
 		break;
 	case GAME_SIMON1DOS:
-		table = opcode_arg_table_simon1dos;
-		break;
 	case GAME_SIMON1DEMO:
 		table = opcode_arg_table_simon1dos;
 		break;

Index: simon.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/simon.cpp,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -d -r1.37 -r1.38
--- simon.cpp	30 Oct 2002 23:52:19 -0000	1.37
+++ simon.cpp	31 Oct 2002 01:27:05 -0000	1.38
@@ -4936,42 +4936,32 @@
 		
 		if (_game & GAME_WIN) {
 			_game_file->seek(_game_offsets_ptr[gss->MUSIC_INDEX_BASE + music], SEEK_SET);
-			File *f = _game_file;
-			midi.read_all_songs(f);
+			midi.read_all_songs(_game_file);
 		}
 	
 		midi.initialize();
 		midi.play();
 	} else {
-		if (_game == GAME_SIMON1DOS) {
-
 		midi.shutdown();
 
-		char buf[50];
-		File *f = new File();
-		sprintf(buf, "MOD%d.MUS", music);
-		f->open(buf, _gameDataPath);
-		if (f->isOpen() == false) {
-			warning("Cannot load music from '%s'", buf);
-			return;
-		}
-		midi.read_all_songs_old(f);
-		delete f;
-
-		midi.initialize();
-		midi.play();
+		if (_game == GAME_SIMON1DOS) {
+			char buf[50];
+			File *f = new File();
+			sprintf(buf, "MOD%d.MUS", music);
+			f->open(buf, _gameDataPath);
+			if (f->isOpen() == false) {
+				warning("Cannot load music from '%s'", buf);
+				return;
+			}
+			midi.read_all_songs_old(f);
+			delete f;
+		} else if (_game == GAME_SIMON1WIN) {
+			_game_file->seek(_game_offsets_ptr[gss->MUSIC_INDEX_BASE + music], SEEK_SET);
+			midi.read_all_songs_old(_game_file);
 		}
-		if (_game == GAME_SIMON1WIN) {
-
-		midi.shutdown();
-
-		_game_file->seek(_game_offsets_ptr[gss->MUSIC_INDEX_BASE + music], SEEK_SET);
-		File *f = _game_file;
-		midi.read_all_songs_old(f);
 
 		midi.initialize();
 		midi.play();
-		}
 	}
 }
 

Index: verb.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/simon/verb.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- verb.cpp	30 Oct 2002 23:52:19 -0000	1.3
+++ verb.cpp	31 Oct 2002 01:27:05 -0000	1.4
@@ -24,6 +24,30 @@
 #include "simon/simon.h"
 #include "simon/intern.h"
 
+static const char *const verb_names[] = {
+	"Walk to",
+	"Look at",
+	"Open",
+	"Move",
+
+	"Consume",
+	"Pick up",
+	"Close",
+	"Use",
+
+	"Talk to",
+	"Remove",
+	"Wear",
+	"Give"
+};
+
+static const char *const verb_prep_names[] = {
+	"", "", "", "",
+	"", "", "", "with what ?",
+	"", "", "", "to whom ?"
+};
+
+
 void SimonState::defocusHitarea()
 {
 	HitArea *last;
@@ -50,29 +74,6 @@
 		focusVerb(last->id);
 }
 
-static const char *const verb_names[] = {
-	"Walk to",
-	"Look at",
-	"Open",
-	"Move",
-
-	"Consume",
-	"Pick up",
-	"Close",
-	"Use",
-
-	"Talk to",
-	"Remove",
-	"Wear",
-	"Give"
-};
-
-static const char *const verb_prep_names[] = {
-	"", "", "", "",
-	"", "", "", "with what ?",
-	"", "", "", "to whom ?"
-};
-
 void SimonState::focusVerb(uint hitarea_id)
 {
 	uint x;
@@ -318,42 +319,39 @@
 
 void SimonState::setup_hitarea_from_pos(uint x, uint y, uint mode)
 {
-	HitArea *best_ha;
-
 	if (_game & GAME_SIMON2) {
 		if (_bit_array[4] & 0x8000 || y < 134) {
 			x += _x_scroll * 8;
 		}
 	}
 
-	{
-		HitArea *ha = _hit_areas;
-		uint count = ARRAYSIZE(_hit_areas);
-		uint16 layer = 0;
-		const uint16 x_ = x;
-		const uint16 y_ = y;
+	HitArea *best_ha;
+	HitArea *ha = _hit_areas;
+	uint count = ARRAYSIZE(_hit_areas);
+	uint16 layer = 0;
+	const uint16 x_ = x;
+	const uint16 y_ = y;
 
-		best_ha = NULL;
+	best_ha = NULL;
 
-		do {
-			if (ha->flags & 0x20) {
-				if (!(ha->flags & 0x40)) {
-					if (x_ >= ha->x && y_ >= ha->y &&
-							x_ - ha->x < ha->width && y_ - ha->y < ha->height && layer <= ha->layer) {
-						layer = ha->layer;
-						best_ha = ha;
-					} else {
-						if (ha->flags & 2) {
-							hitarea_leave(ha);
-							ha->flags &= ~2;
-						}
-					}
+	do {
+		if (ha->flags & 0x20) {
+			if (!(ha->flags & 0x40)) {
+				if (x_ >= ha->x && y_ >= ha->y &&
+						x_ - ha->x < ha->width && y_ - ha->y < ha->height && layer <= ha->layer) {
+					layer = ha->layer;
+					best_ha = ha;
 				} else {
-					ha->flags &= ~2;
+					if (ha->flags & 2) {
+						hitarea_leave(ha);
+						ha->flags &= ~2;
+					}
 				}
+			} else {
+				ha->flags &= ~2;
 			}
-		} while (ha++, --count);
-	}
+		}
+	} while (ha++, --count);
 
 	if (best_ha == NULL) {
 		defocusHitarea();
@@ -445,5 +443,6 @@
 	else
 		x = 0;
 	showActionString(x, string_ptr);
+	
 	return true;
 }





More information about the Scummvm-git-logs mailing list