[Scummvm-cvs-logs] scummvm master -> 0012390f2ad1c417d68e7db74717a6d996ce41ee

wjp wjp at usecode.org
Tue Mar 1 20:18:47 CET 2016


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

Summary:
0012390f2a SCI32: Fix index/offset mixup in updateInfoFlagViewVisible


Commit: 0012390f2ad1c417d68e7db74717a6d996ce41ee
    https://github.com/scummvm/scummvm/commit/0012390f2ad1c417d68e7db74717a6d996ce41ee
Author: Willem Jan Palenstijn (wjp at usecode.org)
Date: 2016-03-01T20:18:29+01:00

Commit Message:
SCI32: Fix index/offset mixup in updateInfoFlagViewVisible

Changed paths:
    engines/sci/engine/selector.cpp
    engines/sci/engine/selector.h
    engines/sci/engine/vm.cpp



diff --git a/engines/sci/engine/selector.cpp b/engines/sci/engine/selector.cpp
index 320f2c0..1393e96 100644
--- a/engines/sci/engine/selector.cpp
+++ b/engines/sci/engine/selector.cpp
@@ -207,10 +207,10 @@ reg_t readSelector(SegManager *segMan, reg_t object, Selector selectorId) {
 }
 
 #ifdef ENABLE_SCI32
-void updateInfoFlagViewVisible(Object *obj, int offset) {
+void updateInfoFlagViewVisible(Object *obj, int index) {
 	// TODO: Make this correct for all SCI versions
 	// Selectors 26 through 44 are selectors for View script objects in SQ6
-	if (offset >= 26 && offset <= 44 && getSciVersion() >= SCI_VERSION_2) {
+	if (index >= 26 && index <= 44 && getSciVersion() >= SCI_VERSION_2) {
 		obj->setInfoSelectorFlag(kInfoFlagViewVisible);
 	}
 }
diff --git a/engines/sci/engine/selector.h b/engines/sci/engine/selector.h
index 1952ca0..a8bbbe7 100644
--- a/engines/sci/engine/selector.h
+++ b/engines/sci/engine/selector.h
@@ -201,10 +201,10 @@ void invokeSelector(EngineState *s, reg_t object, int selectorId,
 /**
  * SCI32 set kInfoFlagViewVisible in the -info- selector if a certain
  * range of properties was written to.
- * This function checks if offset is in the right range, and sets the flag
+ * This function checks if index is in the right range, and sets the flag
  * on obj.-info- if it is.
  */
-void updateInfoFlagViewVisible(Object *obj, int offset);
+void updateInfoFlagViewVisible(Object *obj, int index);
 #endif
 
 } // End of namespace Sci
diff --git a/engines/sci/engine/vm.cpp b/engines/sci/engine/vm.cpp
index 66d9fee..64e6c04 100644
--- a/engines/sci/engine/vm.cpp
+++ b/engines/sci/engine/vm.cpp
@@ -1100,7 +1100,7 @@ void run_vm(EngineState *s) {
 			// Accumulator To Property
 			validate_property(s, obj, opparams[0]) = s->r_acc;
 #ifdef ENABLE_SCI32
-			updateInfoFlagViewVisible(obj, opparams[0]);
+			updateInfoFlagViewVisible(obj, opparams[0]>>1);
 #endif
 			break;
 
@@ -1113,7 +1113,7 @@ void run_vm(EngineState *s) {
 			// Stack To Property
 			validate_property(s, obj, opparams[0]) = POP32();
 #ifdef ENABLE_SCI32
-			updateInfoFlagViewVisible(obj, opparams[0]);
+			updateInfoFlagViewVisible(obj, opparams[0]>>1);
 #endif
 			break;
 
@@ -1130,7 +1130,7 @@ void run_vm(EngineState *s) {
 			else
 				opProperty -= 1;
 #ifdef ENABLE_SCI32
-			updateInfoFlagViewVisible(obj, opparams[0]);
+			updateInfoFlagViewVisible(obj, opparams[0]>>1);
 #endif
 			if (opcode == op_ipToa || opcode == op_dpToa)
 				s->r_acc = opProperty;






More information about the Scummvm-git-logs mailing list