[Scummvm-cvs-logs] SF.net SVN: scummvm:[47087] scummvm/trunk/engines/sci

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Wed Jan 6 18:25:54 CET 2010


Revision: 47087
          http://scummvm.svn.sourceforge.net/scummvm/?rev=47087&view=rev
Author:   thebluegr
Date:     2010-01-06 17:25:54 +0000 (Wed, 06 Jan 2010)

Log Message:
-----------
- Some work on kLocalToGlobal and kGlobalToLocal for SCI2+
- Removed the custom types MemoryHandle, LoopNo, CelNo (cause we ended up having code like LoopNo loopNo = ...)
- Improved the sanity checks in frameOut()

Modified Paths:
--------------
    scummvm/trunk/engines/sci/engine/kevent.cpp
    scummvm/trunk/engines/sci/engine/kgraphics.cpp
    scummvm/trunk/engines/sci/graphics/animate.cpp
    scummvm/trunk/engines/sci/graphics/animate.h
    scummvm/trunk/engines/sci/graphics/gfx.cpp
    scummvm/trunk/engines/sci/graphics/gfx.h
    scummvm/trunk/engines/sci/graphics/gui.cpp
    scummvm/trunk/engines/sci/graphics/gui.h
    scummvm/trunk/engines/sci/graphics/helpers.h
    scummvm/trunk/engines/sci/graphics/menu.h
    scummvm/trunk/engines/sci/graphics/view.cpp
    scummvm/trunk/engines/sci/graphics/view.h
    scummvm/trunk/engines/sci/graphics/windowmgr.cpp

Modified: scummvm/trunk/engines/sci/engine/kevent.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kevent.cpp	2010-01-06 16:39:48 UTC (rev 47086)
+++ scummvm/trunk/engines/sci/engine/kevent.cpp	2010-01-06 17:25:54 UTC (rev 47087)
@@ -205,12 +205,6 @@
 }
 
 reg_t kGlobalToLocal(EngineState *s, int argc, reg_t *argv) {
-#ifdef ENABLE_SCI32
-	// SCI32 has an extra argument for a plane here
-	if (argc > 1)
-		warning("kGlobalToLocal Plane: %04x:%04x", PRINT_REG(argv[1]));
-#endif
-
 	reg_t obj = argc ? argv[0] : NULL_REG; // Can this really happen? Lars
 	SegManager *segMan = s->_segMan;
 
@@ -218,7 +212,12 @@
 		int16 x = GET_SEL32V(segMan, obj, x);
 		int16 y = GET_SEL32V(segMan, obj, y);
 
-		s->_gui->globalToLocal(&x, &y);
+#ifdef ENABLE_SCI32
+		if (argc > 1)
+			s->_gui->globalToLocal(&x, &y, argv[1]);
+		else
+#endif
+			s->_gui->globalToLocal(&x, &y);
 
 		PUT_SEL32V(segMan, obj, x, x);
 		PUT_SEL32V(segMan, obj, y, y);
@@ -229,12 +228,6 @@
 }
 
 reg_t kLocalToGlobal(EngineState *s, int argc, reg_t *argv) {
-#ifdef ENABLE_SCI32
-	// SCI32 has an extra argument for a plane here
-	if (argc > 1)
-		warning("kLocalToGlobal Plane: %04x:%04x", PRINT_REG(argv[1]));
-#endif
-
 	reg_t obj = argc ? argv[0] : NULL_REG; // Can this really happen? Lars
 	SegManager *segMan = s->_segMan;
 
@@ -242,6 +235,11 @@
 		int16 x = GET_SEL32V(segMan, obj, x);
 		int16 y = GET_SEL32V(segMan, obj, y);
 
+#ifdef ENABLE_SCI32
+		if (argc > 1)
+			s->_gui->localToGlobal(&x, &y, argv[1]);
+		else
+#endif
 		s->_gui->localToGlobal(&x, &y);
 
 		PUT_SEL32V(segMan, obj, x, x);

Modified: scummvm/trunk/engines/sci/engine/kgraphics.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/kgraphics.cpp	2010-01-06 16:39:48 UTC (rev 47086)
+++ scummvm/trunk/engines/sci/engine/kgraphics.cpp	2010-01-06 17:25:54 UTC (rev 47087)
@@ -705,8 +705,8 @@
 	int16 mode, maxChars, cursorPos, upperPos, listCount, i;
 	int16 upperOffset, cursorOffset;
 	GuiResourceId viewId;
-	LoopNo loopNo;
-	CelNo celNo;
+	int16 loopNo;
+	int16 celNo;
 	reg_t listSeeker;
 	Common::String *listStrings = NULL;
 	const char **listEntries = NULL;
@@ -842,8 +842,8 @@
 
 reg_t kAddToPic(EngineState *s, int argc, reg_t *argv) {
 	GuiResourceId viewId;
-	LoopNo loopNo;
-	CelNo celNo;
+	int16 loopNo;
+	int16 celNo;
 	int16 leftPos, topPos, priority, control;
 
 	switch (argc) {
@@ -909,8 +909,8 @@
 
 reg_t kDrawCel(EngineState *s, int argc, reg_t *argv) {
 	GuiResourceId viewId = argv[0].toSint16();
-	LoopNo loopNo = argv[1].toSint16();
-	CelNo celNo = argv[2].toSint16();
+	int16 loopNo = argv[1].toSint16();
+	int16 celNo = argv[2].toSint16();
 	uint16 x = argv[3].toUint16();
 	uint16 y = argv[4].toUint16();
 	int16 priority = (argc > 5) ? argv[5].toSint16()  : -1;

Modified: scummvm/trunk/engines/sci/graphics/animate.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/animate.cpp	2010-01-06 16:39:48 UTC (rev 47086)
+++ scummvm/trunk/engines/sci/graphics/animate.cpp	2010-01-06 17:25:54 UTC (rev 47087)
@@ -553,7 +553,7 @@
 	}
 }
 
-void SciGuiAnimate::addToPicDrawView(GuiResourceId viewId, LoopNo loopNo, CelNo celNo, int16 leftPos, int16 topPos, int16 priority, int16 control) {
+void SciGuiAnimate::addToPicDrawView(GuiResourceId viewId, int16 loopNo, int16 celNo, int16 leftPos, int16 topPos, int16 priority, int16 control) {
 	View *view = _gfx->getView(viewId);
 	Common::Rect celRect;
 

Modified: scummvm/trunk/engines/sci/graphics/animate.h
===================================================================
--- scummvm/trunk/engines/sci/graphics/animate.h	2010-01-06 16:39:48 UTC (rev 47086)
+++ scummvm/trunk/engines/sci/graphics/animate.h	2010-01-06 17:25:54 UTC (rev 47087)
@@ -72,7 +72,7 @@
 	void restoreAndDelete(int argc, reg_t *argv);
 	void reAnimate(Common::Rect rect);
 	void addToPicDrawCels();
-	void addToPicDrawView(GuiResourceId viewId, LoopNo loopNo, CelNo celNo, int16 leftPos, int16 topPos, int16 priority, int16 control);
+	void addToPicDrawView(GuiResourceId viewId, int16 loopNo, int16 celNo, int16 leftPos, int16 topPos, int16 priority, int16 control);
 
 private:
 	void init();

Modified: scummvm/trunk/engines/sci/graphics/gfx.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/gfx.cpp	2010-01-06 16:39:48 UTC (rev 47086)
+++ scummvm/trunk/engines/sci/graphics/gfx.cpp	2010-01-06 17:25:54 UTC (rev 47087)
@@ -265,8 +265,8 @@
 	_screen->copyRectToScreen(workerRect);
 }
 
-MemoryHandle Gfx::BitsSave(const Common::Rect &rect, byte screenMask) {
-	MemoryHandle memoryId;
+reg_t Gfx::BitsSave(const Common::Rect &rect, byte screenMask) {
+	reg_t memoryId;
 	byte *memoryPtr;
 	int size;
 
@@ -286,7 +286,7 @@
 	return memoryId;
 }
 
-void Gfx::BitsGetRect(MemoryHandle memoryHandle, Common::Rect *destRect) {
+void Gfx::BitsGetRect(reg_t memoryHandle, Common::Rect *destRect) {
 	byte *memoryPtr = NULL;
 
 	if (!memoryHandle.isNull()) {
@@ -298,7 +298,7 @@
 	}
 }
 
-void Gfx::BitsRestore(MemoryHandle memoryHandle) {
+void Gfx::BitsRestore(reg_t memoryHandle) {
 	byte *memoryPtr = NULL;
 
 	if (!memoryHandle.isNull()) {
@@ -311,7 +311,7 @@
 	}
 }
 
-void Gfx::BitsFree(MemoryHandle memoryHandle) {
+void Gfx::BitsFree(reg_t memoryHandle) {
 	if (!memoryHandle.isNull()) {
 		kfree(_segMan, memoryHandle);
 	}
@@ -329,7 +329,7 @@
 }
 
 // This one is the only one that updates screen!
-void Gfx::drawCelAndShow(GuiResourceId viewId, LoopNo loopNo, CelNo celNo, uint16 leftPos, uint16 topPos, byte priority, uint16 paletteNo, int16 origHeight, uint16 scaleX, uint16 scaleY) {
+void Gfx::drawCelAndShow(GuiResourceId viewId, int16 loopNo, int16 celNo, uint16 leftPos, uint16 topPos, byte priority, uint16 paletteNo, int16 origHeight, uint16 scaleX, uint16 scaleY) {
 	View *view = getView(viewId);
 	Common::Rect rect;
 	
@@ -352,12 +352,12 @@
 }
 
 // This version of drawCel is not supposed to call BitsShow()!
-void Gfx::drawCel(GuiResourceId viewId, LoopNo loopNo, CelNo celNo, Common::Rect celRect, byte priority, uint16 paletteNo, int16 origHeight, uint16 scaleX, uint16 scaleY) {
+void Gfx::drawCel(GuiResourceId viewId, int16 loopNo, int16 celNo, Common::Rect celRect, byte priority, uint16 paletteNo, int16 origHeight, uint16 scaleX, uint16 scaleY) {
 	drawCel(getView(viewId), loopNo, celNo, celRect, priority, paletteNo, origHeight, scaleX, scaleY);
 }
 
 // This version of drawCel is not supposed to call BitsShow()!
-void Gfx::drawCel(View *view, LoopNo loopNo, CelNo celNo, Common::Rect celRect, byte priority, uint16 paletteNo, int16 origHeight, uint16 scaleX, uint16 scaleY) {
+void Gfx::drawCel(View *view, int16 loopNo, int16 celNo, Common::Rect celRect, byte priority, uint16 paletteNo, int16 origHeight, uint16 scaleX, uint16 scaleY) {
 	Common::Rect clipRect = celRect;
 	clipRect.clip(_curPort->rect);
 	if (clipRect.isEmpty()) // nothing to draw
@@ -497,8 +497,8 @@
 	View *view = NULL;
 	Common::Rect celRect(0, 0);
 	GuiResourceId viewId = (GuiResourceId)GET_SEL32V(_segMan, objectReference, view);
-	LoopNo loopNo = sign_extend_byte((LoopNo)GET_SEL32V(_segMan, objectReference, loop));
-	CelNo celNo = sign_extend_byte((CelNo)GET_SEL32V(_segMan, objectReference, cel));
+	int16 loopNo = sign_extend_byte((int16)GET_SEL32V(_segMan, objectReference, loop));
+	int16 celNo = sign_extend_byte((int16)GET_SEL32V(_segMan, objectReference, cel));
 	int16 x = (int16)GET_SEL32V(_segMan, objectReference, x);
 	int16 y = (int16)GET_SEL32V(_segMan, objectReference, y);
 	int16 z = 0;

Modified: scummvm/trunk/engines/sci/graphics/gfx.h
===================================================================
--- scummvm/trunk/engines/sci/graphics/gfx.h	2010-01-06 16:39:48 UTC (rev 47086)
+++ scummvm/trunk/engines/sci/graphics/gfx.h	2010-01-06 17:25:54 UTC (rev 47087)
@@ -78,15 +78,15 @@
 	void OffsetLine(Common::Point &start, Common::Point &end);
 
 	void BitsShow(const Common::Rect &r);
-	MemoryHandle BitsSave(const Common::Rect &rect, byte screenFlags);
-	void BitsGetRect(MemoryHandle memoryHandle, Common::Rect *destRect);
-	void BitsRestore(MemoryHandle memoryHandle);
-	void BitsFree(MemoryHandle memoryHandle);
+	reg_t BitsSave(const Common::Rect &rect, byte screenFlags);
+	void BitsGetRect(reg_t memoryHandle, Common::Rect *destRect);
+	void BitsRestore(reg_t memoryHandle);
+	void BitsFree(reg_t memoryHandle);
 
 	void drawPicture(GuiResourceId pictureId, int16 animationNr, bool mirroredFlag, bool addToFlag, GuiResourceId paletteId);
-	void drawCelAndShow(GuiResourceId viewId, LoopNo loopNo, CelNo celNo, uint16 leftPos, uint16 topPos, byte priority, uint16 paletteNo, int16 origHeight = -1, uint16 scaleX = 128, uint16 scaleY = 128);
-	void drawCel(GuiResourceId viewId, LoopNo loopNo, CelNo celNo, Common::Rect celRect, byte priority, uint16 paletteNo, int16 origHeight = -1, uint16 scaleX = 128, uint16 scaleY = 128);
-	void drawCel(View *view, LoopNo loopNo, CelNo celNo, Common::Rect celRect, byte priority, uint16 paletteNo, int16 origHeight = -1, uint16 scaleX = 128, uint16 scaleY = 128);
+	void drawCelAndShow(GuiResourceId viewId, int16 loopNo, int16 celNo, uint16 leftPos, uint16 topPos, byte priority, uint16 paletteNo, int16 origHeight = -1, uint16 scaleX = 128, uint16 scaleY = 128);
+	void drawCel(GuiResourceId viewId, int16 loopNo, int16 celNo, Common::Rect celRect, byte priority, uint16 paletteNo, int16 origHeight = -1, uint16 scaleX = 128, uint16 scaleY = 128);
+	void drawCel(View *view, int16 loopNo, int16 celNo, Common::Rect celRect, byte priority, uint16 paletteNo, int16 origHeight = -1, uint16 scaleX = 128, uint16 scaleY = 128);
 
 	uint16 onControl(uint16 screenMask, Common::Rect rect);
 

Modified: scummvm/trunk/engines/sci/graphics/gui.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/gui.cpp	2010-01-06 16:39:48 UTC (rev 47086)
+++ scummvm/trunk/engines/sci/graphics/gui.cpp	2010-01-06 17:25:54 UTC (rev 47087)
@@ -145,6 +145,20 @@
 	*y = *y + curPort->top;
 }
 
+#ifdef ENABLE_SCI32
+
+void SciGui::globalToLocal(int16 *x, int16 *y, reg_t planeObj) {
+	*x = *x - GET_SEL32V(_s->_segMan, planeObj, left);
+	*y = *y - GET_SEL32V(_s->_segMan, planeObj, top);
+}
+
+void SciGui::localToGlobal(int16 *x, int16 *y, reg_t planeObj) {
+	*x = *x + GET_SEL32V(_s->_segMan, planeObj, left);
+	*y = *y + GET_SEL32V(_s->_segMan, planeObj, top);
+}
+
+#endif
+
 int16 SciGui::coordinateToPriority(int16 y) {
 	return _gfx->CoordinateToPriority(y);
 }
@@ -351,7 +365,7 @@
 	_gfx->SetPort(oldPort);
 }
 
-void SciGui::drawCel(GuiResourceId viewId, LoopNo loopNo, CelNo celNo, uint16 leftPos, uint16 topPos, int16 priority, uint16 paletteNo, int16 origHeight) {
+void SciGui::drawCel(GuiResourceId viewId, int16 loopNo, int16 celNo, uint16 leftPos, uint16 topPos, int16 priority, uint16 paletteNo, int16 origHeight) {
 	_gfx->drawCelAndShow(viewId, loopNo, celNo, leftPos, topPos, priority, paletteNo, origHeight);
 	_palette->setOnScreen();
 }
@@ -422,7 +436,7 @@
 		_gfx->BitsShow(rect);
 }
 
-void SciGui::drawControlIcon(Common::Rect rect, reg_t obj, GuiResourceId viewId, LoopNo loopNo, CelNo celNo, int16 style, bool hilite) {
+void SciGui::drawControlIcon(Common::Rect rect, reg_t obj, GuiResourceId viewId, int16 loopNo, int16 celNo, int16 style, bool hilite) {
 	if (!hilite) {
 		_gfx->drawCelAndShow(viewId, loopNo, celNo, rect.left, rect.top, 255, 0);
 		if (style & 0x20) {
@@ -674,7 +688,7 @@
 	addToPicSetPicNotValid();
 }
 
-void SciGui::addToPicView(GuiResourceId viewId, LoopNo loopNo, CelNo celNo, int16 leftPos, int16 topPos, int16 priority, int16 control) {
+void SciGui::addToPicView(GuiResourceId viewId, int16 loopNo, int16 celNo, int16 leftPos, int16 topPos, int16 priority, int16 control) {
 	_gfx->SetPort((Port *)_windowMgr->_picWind);
 	_animate->addToPicDrawView(viewId, loopNo, celNo, leftPos, topPos, priority, control);
 	addToPicSetPicNotValid();
@@ -725,8 +739,8 @@
 		int16 z = (_s->_kernel->_selectorCache.z > -1) ? GET_SEL32V(_s->_segMan, object, z) : 0;
 		int16 yStep = GET_SEL32V(_s->_segMan, object, yStep);
 		GuiResourceId viewId = GET_SEL32V(_s->_segMan, object, view);
-		LoopNo loopNo = GET_SEL32V(_s->_segMan, object, loop);
-		CelNo celNo = GET_SEL32V(_s->_segMan, object, cel);
+		int16 loopNo = GET_SEL32V(_s->_segMan, object, loop);
+		int16 celNo = GET_SEL32V(_s->_segMan, object, cel);
 
 		View *tmpView = _gfx->getView(viewId);
 		Common::Rect celRect;
@@ -888,16 +902,13 @@
 				// Apparently, sometimes they're not, therefore I'm adding some sanity checks here so that 
 				// the hack underneath does not try and draw cels outside the screen coordinates
 				if (leftPos >= _screen->getWidth()) {
-					warning("kAddScreenItem: invalid left position (%d), resetting to 0", leftPos);
-					leftPos = 0;
+					continue;
 				}
 	
 				if (topPos >= _screen->getHeight()) {
-					warning("kAddScreenItem: invalid top position (%d), resetting to 0", topPos);
-					topPos = 0;
+					continue;
 				}
 	
-				// HACK: just draw the view on screen
 				if (viewId != 0xffff)
 					drawCel(viewId, loopNo, celNo, leftPos, topPos, priority, 0);
 			}

Modified: scummvm/trunk/engines/sci/graphics/gui.h
===================================================================
--- scummvm/trunk/engines/sci/graphics/gui.h	2010-01-06 16:39:48 UTC (rev 47086)
+++ scummvm/trunk/engines/sci/graphics/gui.h	2010-01-06 17:25:54 UTC (rev 47087)
@@ -88,11 +88,11 @@
 	virtual reg_t menuSelect(reg_t eventObject);
 
 	virtual void drawPicture(GuiResourceId pictureId, int16 animationNr, bool animationBlackoutFlag, bool mirroredFlag, bool addToFlag, int16 EGApaletteNo);
-	virtual void drawCel(GuiResourceId viewId, LoopNo loopNo, CelNo celNo, uint16 leftPos, uint16 topPos, int16 priority, uint16 paletteNo, int16 origHeight = -1);
+	virtual void drawCel(GuiResourceId viewId, int16 loopNo, int16 celNo, uint16 leftPos, uint16 topPos, int16 priority, uint16 paletteNo, int16 origHeight = -1);
 	virtual void drawControlButton(Common::Rect rect, reg_t obj, const char *text, int16 fontId, int16 style, bool hilite);
 	virtual void drawControlText(Common::Rect rect, reg_t obj, const char *text, int16 fontId, int16 alignment, int16 style, bool hilite);
 	virtual void drawControlTextEdit(Common::Rect rect, reg_t obj, const char *text, int16 fontId, int16 mode, int16 style, int16 cursorPos, int16 maxChars, bool hilite);
-	virtual void drawControlIcon(Common::Rect rect, reg_t obj, GuiResourceId viewId, LoopNo loopNo, CelNo celNo, int16 style, bool hilite);
+	virtual void drawControlIcon(Common::Rect rect, reg_t obj, GuiResourceId viewId, int16 loopNo, int16 celNo, int16 style, bool hilite);
 	virtual void drawControlList(Common::Rect rect, reg_t obj, int16 maxChars, int16 count, const char **entries, GuiResourceId fontId, int16 style, int16 upperPos, int16 cursorPos, bool isAlias, bool hilite);
 	virtual void editControl(reg_t controlObject, reg_t eventObject);
 
@@ -124,7 +124,7 @@
 	virtual void animateShowPic();
 	virtual void animate(reg_t listReference, bool cycle, int argc, reg_t *argv);
 	virtual void addToPicList(reg_t listReference, int argc, reg_t *argv);
-	virtual void addToPicView(GuiResourceId viewId, LoopNo loopNo, CelNo celNo, int16 leftPos, int16 topPos, int16 priority, int16 control);
+	virtual void addToPicView(GuiResourceId viewId, int16 loopNo, int16 celNo, int16 leftPos, int16 topPos, int16 priority, int16 control);
 	virtual void setNowSeen(reg_t objectReference);
 	virtual bool canBeHere(reg_t curObject, reg_t listReference);
 	virtual bool isItSkip(GuiResourceId viewId, int16 loopNo, int16 celNo, Common::Point position);
@@ -157,6 +157,8 @@
 	virtual void updatePlane(reg_t object);
 	virtual void deletePlane(reg_t object);
 	virtual void frameOut();
+	virtual void globalToLocal(int16 *x, int16 *y, reg_t planeObj);
+	virtual void localToGlobal(int16 *x, int16 *y, reg_t planeObj);
 #endif
 
 	virtual bool debugUndither(bool flag);

Modified: scummvm/trunk/engines/sci/graphics/helpers.h
===================================================================
--- scummvm/trunk/engines/sci/graphics/helpers.h	2010-01-06 16:39:48 UTC (rev 47086)
+++ scummvm/trunk/engines/sci/graphics/helpers.h	2010-01-06 17:25:54 UTC (rev 47087)
@@ -36,9 +36,6 @@
 #define SCI_SHAKE_DIRECTION_HORIZONTAL 2
 
 typedef int GuiResourceId; // is a resource-number and -1 means no parameter given
-typedef reg_t MemoryHandle;
-typedef int16 LoopNo;
-typedef int16 CelNo;
 
 typedef int16 TextAlignment;
 
@@ -80,15 +77,15 @@
 struct AnimateEntry {
 	reg_t object;
 	GuiResourceId viewId;
-	LoopNo loopNo;
-	CelNo celNo;
+	int16 loopNo;
+	int16 celNo;
 	int16 paletteNo;
 	int16 x, y, z;
 	int16 priority;
 	uint16 signal;
 	Common::Rect celRect;
 	bool showBitsFlag;
-	MemoryHandle castHandle;
+	reg_t castHandle;
 };
 typedef Common::List<AnimateEntry *> AnimateList;
 

Modified: scummvm/trunk/engines/sci/graphics/menu.h
===================================================================
--- scummvm/trunk/engines/sci/graphics/menu.h	2010-01-06 16:39:48 UTC (rev 47086)
+++ scummvm/trunk/engines/sci/graphics/menu.h	2010-01-06 17:25:54 UTC (rev 47087)
@@ -113,8 +113,8 @@
 	uint16 _curItemId;
 
 	Port *_oldPort;
-	MemoryHandle _barSaveHandle;
-	MemoryHandle _menuSaveHandle;
+	reg_t _barSaveHandle;
+	reg_t _menuSaveHandle;
 	Common::Rect _menuRect;
 };
 

Modified: scummvm/trunk/engines/sci/graphics/view.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/view.cpp	2010-01-06 16:39:48 UTC (rev 47086)
+++ scummvm/trunk/engines/sci/graphics/view.cpp	2010-01-06 17:25:54 UTC (rev 47087)
@@ -233,30 +233,30 @@
 	return _resourceId;
 }
 
-int16 View::getWidth(LoopNo loopNo, CelNo celNo) {
+int16 View::getWidth(int16 loopNo, int16 celNo) {
 	loopNo = CLIP<int16>(loopNo, 0, _loopCount - 1);
 	celNo = CLIP<int16>(celNo, 0, _loop[loopNo].celCount - 1);
 	return _loopCount ? _loop[loopNo].cel[celNo].width : 0;
 }
 
-int16 View::getHeight(LoopNo loopNo, CelNo celNo) {
+int16 View::getHeight(int16 loopNo, int16 celNo) {
 	loopNo = CLIP<int16>(loopNo, 0, _loopCount -1);
 	celNo = CLIP<int16>(celNo, 0, _loop[loopNo].celCount - 1);
 	return _loopCount ? _loop[loopNo].cel[celNo].height : 0;
 }
 
-CelInfo *View::getCelInfo(LoopNo loopNo, CelNo celNo) {
+CelInfo *View::getCelInfo(int16 loopNo, int16 celNo) {
 	loopNo = CLIP<int16>(loopNo, 0, _loopCount - 1);
 	celNo = CLIP<int16>(celNo, 0, _loop[loopNo].celCount - 1);
 	return _loopCount ? &_loop[loopNo].cel[celNo] : NULL;
 }
 
-LoopInfo *View::getLoopInfo(LoopNo loopNo) {
+LoopInfo *View::getLoopInfo(int16 loopNo) {
 	loopNo = CLIP<int16>(loopNo, 0, _loopCount - 1);
 	return _loopCount ? &_loop[loopNo] : NULL;
 }
 
-void View::getCelRect(LoopNo loopNo, CelNo celNo, int16 x, int16 y, int16 z, Common::Rect *outRect) {
+void View::getCelRect(int16 loopNo, int16 celNo, int16 x, int16 y, int16 z, Common::Rect *outRect) {
 	CelInfo *celInfo = getCelInfo(loopNo, celNo);
 	if (celInfo) {
 		outRect->left = x + celInfo->displaceX - (celInfo->width >> 1);
@@ -266,7 +266,7 @@
 	}
 }
 
-void View::unpackCel(LoopNo loopNo, CelNo celNo, byte *outPtr, uint16 pixelCount) {
+void View::unpackCel(int16 loopNo, int16 celNo, byte *outPtr, uint16 pixelCount) {
 	CelInfo *celInfo = getCelInfo(loopNo, celNo);
 	byte *rlePtr;
 	byte *literalPtr;
@@ -354,7 +354,7 @@
 	error("Unable to decompress view");
 }
 
-byte *View::getBitmap(LoopNo loopNo, CelNo celNo) {
+byte *View::getBitmap(int16 loopNo, int16 celNo) {
 	loopNo = CLIP<int16>(loopNo, 0, _loopCount -1);
 	celNo = CLIP<int16>(celNo, 0, _loop[loopNo].celCount - 1);
 	if (_loop[loopNo].cel[celNo].rawBitmap)
@@ -460,7 +460,7 @@
 	}
 }
 
-void View::draw(Common::Rect rect, Common::Rect clipRect, Common::Rect clipRectTranslated, LoopNo loopNo, CelNo celNo, byte priority, uint16 EGAmappingNr, int16 origHeight, uint16 scaleX, uint16 scaleY) {
+void View::draw(Common::Rect rect, Common::Rect clipRect, Common::Rect clipRectTranslated, int16 loopNo, int16 celNo, byte priority, uint16 EGAmappingNr, int16 origHeight, uint16 scaleX, uint16 scaleY) {
 	Palette *palette = _embeddedPal ? &_viewPalette : &_palette->_sysPalette;
 	CelInfo *celInfo = getCelInfo(loopNo, celNo);
 	byte *bitmap = getBitmap(loopNo, celNo);

Modified: scummvm/trunk/engines/sci/graphics/view.h
===================================================================
--- scummvm/trunk/engines/sci/graphics/view.h	2010-01-06 16:39:48 UTC (rev 47086)
+++ scummvm/trunk/engines/sci/graphics/view.h	2010-01-06 17:25:54 UTC (rev 47087)
@@ -54,20 +54,20 @@
 	~View();
 
 	GuiResourceId getResourceId();
-	int16 getWidth(LoopNo loopNo, CelNo celNo);
-	int16 getHeight(LoopNo loopNo, CelNo celNo);
-	CelInfo *getCelInfo(LoopNo loopNo, CelNo celNo);
-	LoopInfo *getLoopInfo(LoopNo loopNo);
-	void getCelRect(LoopNo loopNo, CelNo celNo, int16 x, int16 y, int16 z, Common::Rect *outRect);
-	byte *getBitmap(LoopNo loopNo, CelNo celNo);
-	void draw(Common::Rect rect, Common::Rect clipRect, Common::Rect clipRectTranslated, LoopNo loopNo, CelNo celNo, byte priority, uint16 EGAmappingNr, int16 origHeight = -1, uint16 scaleX = 128, uint16 scaleY = 128);
+	int16 getWidth(int16 loopNo, int16 celNo);
+	int16 getHeight(int16 loopNo, int16 celNo);
+	CelInfo *getCelInfo(int16 loopNo, int16 celNo);
+	LoopInfo *getLoopInfo(int16 loopNo);
+	void getCelRect(int16 loopNo, int16 celNo, int16 x, int16 y, int16 z, Common::Rect *outRect);
+	byte *getBitmap(int16 loopNo, int16 celNo);
+	void draw(Common::Rect rect, Common::Rect clipRect, Common::Rect clipRectTranslated, int16 loopNo, int16 celNo, byte priority, uint16 EGAmappingNr, int16 origHeight = -1, uint16 scaleX = 128, uint16 scaleY = 128);
 	uint16 getLoopCount() const { return _loopCount; }
-	uint16 getCelCount(LoopNo loopNo) { return _loop[loopNo].celCount; }
+	uint16 getCelCount(int16 loopNo) { return _loop[loopNo].celCount; }
 	Palette *getPalette();
 
 private:
 	void initData(GuiResourceId resourceId);
-	void unpackCel(LoopNo loopNo, CelNo celNo, byte *outPtr, uint16 pixelCount);
+	void unpackCel(int16 loopNo, int16 celNo, byte *outPtr, uint16 pixelCount);
 	void unditherBitmap(byte *bitmap, int16 width, int16 height, byte clearKey);
 
 	ResourceManager *_resMan;

Modified: scummvm/trunk/engines/sci/graphics/windowmgr.cpp
===================================================================
--- scummvm/trunk/engines/sci/graphics/windowmgr.cpp	2010-01-06 16:39:48 UTC (rev 47086)
+++ scummvm/trunk/engines/sci/graphics/windowmgr.cpp	2010-01-06 17:25:54 UTC (rev 47087)
@@ -269,7 +269,7 @@
 }
 
 void WindowMgr::UpdateWindow(Window *wnd) {
-	MemoryHandle handle;
+	reg_t handle;
 
 	if (wnd->saveScreenMask && wnd->bDrawn) {
 		handle = _gfx->BitsSave(wnd->restoreRect, SCI_SCREEN_MASK_VISUAL);


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