[Scummvm-cvs-logs] SF.net SVN: scummvm:[47921] scummvm/trunk/engines/sci/graphics/compare.cpp

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Fri Feb 5 23:56:28 CET 2010


Revision: 47921
          http://scummvm.svn.sourceforge.net/scummvm/?rev=47921&view=rev
Author:   fingolfin
Date:     2010-02-05 22:56:27 +0000 (Fri, 05 Feb 2010)

Log Message:
-----------
SCI: Get rid of the mysterious sign_extend_byte() and replace it by a simple cast ;)

Modified Paths:
--------------
    scummvm/trunk/engines/sci/graphics/compare.cpp

Modified: scummvm/trunk/engines/sci/graphics/compare.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/compare.cpp	2010-02-05 22:56:05 UTC (rev 47920)
+++ scummvm/trunk/engines/sci/graphics/compare.cpp	2010-02-05 22:56:27 UTC (rev 47921)
@@ -69,13 +69,6 @@
 	return result;
 }
 
-static inline int sign_extend_byte(int value) {
-	if (value & 0x80)
-		return value - 256;
-	else
-		return value;
-}
-
 bool GfxCompare::canBeHereCheckRectList(reg_t checkObject, const Common::Rect &checkRect, List *list) {
 	reg_t curAddress = list->first;
 	Node *curNode = _segMan->lookupNode(curAddress);
@@ -123,8 +116,8 @@
 	GfxView *view = NULL;
 	Common::Rect celRect(0, 0);
 	GuiResourceId viewId = (GuiResourceId)GET_SEL32V(_segMan, objectReference, SELECTOR(view));
-	int16 loopNo = sign_extend_byte((int16)GET_SEL32V(_segMan, objectReference, SELECTOR(loop)));
-	int16 celNo = sign_extend_byte((int16)GET_SEL32V(_segMan, objectReference, SELECTOR(cel)));
+	int8 loopNo = (int8)GET_SEL32V(_segMan, objectReference, SELECTOR(loop));
+	int8 celNo = (int8)GET_SEL32V(_segMan, objectReference, SELECTOR(cel));
 	int16 x = (int16)GET_SEL32V(_segMan, objectReference, SELECTOR(x));
 	int16 y = (int16)GET_SEL32V(_segMan, objectReference, SELECTOR(y));
 	int16 z = 0;


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