[Scummvm-cvs-logs] scummvm master -> f5e8b3257e5c32c02561e4d26298775fa5547df2

wjp wjp at usecode.org
Tue Dec 20 00:07:40 CET 2011


This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
d2375c86eb SKY: Fix warning
f5e8b3257e DREAMWEB: Fix regressions in intoInv, outOfInv; cleanup selectOb


Commit: d2375c86eb9afbc7f14273f5c377533a1b10fce5
    https://github.com/scummvm/scummvm/commit/d2375c86eb9afbc7f14273f5c377533a1b10fce5
Author: Willem Jan Palenstijn (wjp at usecode.org)
Date: 2011-12-19T14:58:55-08:00

Commit Message:
SKY: Fix warning

Changed paths:
    engines/sky/logic.cpp



diff --git a/engines/sky/logic.cpp b/engines/sky/logic.cpp
index 86c8828..18fb4f7 100644
--- a/engines/sky/logic.cpp
+++ b/engines/sky/logic.cpp
@@ -1232,10 +1232,8 @@ uint16 Logic::mouseScript(uint32 scrNum, Compact *scriptComp) {
  * @return 0 if script finished. Else offset where to continue.
  */
 uint16 Logic::script(uint16 scriptNo, uint16 offset) {
-	bool restartScript;
-
 	do {
-		restartScript = false;
+		bool restartScript = false;
 
 		/// process a script
 		/// low level interface to interpreter
@@ -1422,7 +1420,7 @@ uint16 Logic::script(uint16 scriptNo, uint16 offset) {
 				error("Unknown script command: %d", command);
 			}
 		}
-	} while (restartScript);
+	} while (true);
 }
 
 bool Logic::fnCacheChip(uint32 a, uint32 b, uint32 c) {


Commit: f5e8b3257e5c32c02561e4d26298775fa5547df2
    https://github.com/scummvm/scummvm/commit/f5e8b3257e5c32c02561e4d26298775fa5547df2
Author: Willem Jan Palenstijn (wjp at usecode.org)
Date: 2011-12-19T15:06:49-08:00

Commit Message:
DREAMWEB: Fix regressions in intoInv, outOfInv; cleanup selectOb

Changed paths:
    engines/dreamweb/object.cpp



diff --git a/engines/dreamweb/object.cpp b/engines/dreamweb/object.cpp
index 1cdbca0..7048140 100644
--- a/engines/dreamweb/object.cpp
+++ b/engines/dreamweb/object.cpp
@@ -393,9 +393,7 @@ void DreamGenContext::findInvPos() {
 }
 
 void DreamGenContext::selectOb() {
-	es = data.word(kBuffers);
-
-	uint16 objectId = es.word(findInvPosCPP());
+	uint16 objectId = getSegment(data.word(kBuffers)).word(findInvPosCPP());
 	if ((objectId & 0xFF) == 255) {
 		blank();
 		return;
@@ -404,28 +402,19 @@ void DreamGenContext::selectOb() {
 	data.byte(kWithobject) = objectId & 0x00FF;
 	data.byte(kWithtype)   = objectId >> 8;
 
-	if (objectId == data.word(kOldsubject)) {
-		if (data.byte(kCommandtype) == 221) {
-			// Object already selected
-			if (data.word(kMousebutton) != data.word(kOldbutton) && (data.word(kMousebutton) & 1)) {
-				delPointer();
-				data.byte(kInvopen) = 0;
-				useRoutine();
-			}
-			return;
-		} else {
+	if (objectId != data.word(kOldsubject) || data.byte(kCommandtype) != 221) {
+		if (objectId == data.word(kOldsubject))
 			data.byte(kCommandtype) = 221;
-		}
+		data.word(kOldsubject) = objectId;
+		commandWithOb(0, data.byte(kWithtype), data.byte(kWithobject));
 	}
 
-	data.word(kOldsubject) = objectId;
-	commandWithOb(0, data.byte(kWithtype), data.byte(kWithobject));
+	if (data.word(kMousebutton) == data.word(kOldbutton) || !(data.word(kMousebutton) & 1))
+		return;
 
-	if (data.word(kMousebutton) != data.word(kOldbutton) && (data.word(kMousebutton) & 1)) {
-		delPointer();
-		data.byte(kInvopen) = 0;
-		useRoutine();
-	}
+	delPointer();
+	data.byte(kInvopen) = 0;
+	useRoutine();
 }
 
 void DreamGenContext::setPickup() {
@@ -577,11 +566,12 @@ void DreamGenContext::inToInv() {
 
 	subject = (data.byte(kObjecttype) << 8) | data.byte(kItemframe);
 
-	if (subject == data.word(kOldsubject) && data.byte(kCommandtype) != 220)
-		data.byte(kCommandtype) = 220;
-
-	data.word(kOldsubject) = subject;
-	commandWithOb(35, data.byte(kObjecttype), data.byte(kItemframe));
+	if (subject != data.word(kOldsubject) || data.byte(kCommandtype) != 220) {
+		if (subject == data.word(kOldsubject))
+			data.byte(kCommandtype) = 220;
+		data.word(kOldsubject) = subject;
+		commandWithOb(35, data.byte(kObjecttype), data.byte(kItemframe));
+	}
 
 	if (data.word(kMousebutton) == data.word(kOldbutton) || !(data.word(kMousebutton) & 1))
 		return; // notletgo2
@@ -613,18 +603,16 @@ void DreamGenContext::outOfInv() {
 		return;
 	}
 
-	if (subject == data.word(kOldsubject) && data.byte(kCommandtype) != 221)
-		data.byte(kCommandtype) = 221;
-
-	data.word(kOldsubject) = subject;
-	byte type = subject >> 8;
-	byte frame = subject & 0xFF;
-	commandWithOb(36, type, frame);
-
-	if (data.word(kMousebutton) == data.word(kOldbutton))
-		return; // notletgo
+	if (subject != data.word(kOldsubject) || data.byte(kCommandtype) != 221) {
+		if (subject == data.word(kOldsubject))
+			data.byte(kCommandtype) = 221;
+		data.word(kOldsubject) = subject;
+		byte type = subject >> 8;
+		byte frame = subject & 0xFF;
+		commandWithOb(36, type, frame);
+	}
 
-	if (!(data.word(kMousebutton) & 1))
+	if (data.word(kMousebutton) == data.word(kOldbutton) || !(data.word(kMousebutton) & 1))
 		return;
 
 	delPointer();






More information about the Scummvm-git-logs mailing list