[Scummvm-cvs-logs] scummvm master -> 625a5ef2ed8f947e43e8e8d12bd72ffe9d1776c6

wjp wjp at usecode.org
Fri Dec 23 20:46:39 CET 2011


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:
625a5ef2ed DREAMWEB: Minor cleanup


Commit: 625a5ef2ed8f947e43e8e8d12bd72ffe9d1776c6
    https://github.com/scummvm/scummvm/commit/625a5ef2ed8f947e43e8e8d12bd72ffe9d1776c6
Author: Willem Jan Palenstijn (wjp at usecode.org)
Date: 2011-12-23T11:45:51-08:00

Commit Message:
DREAMWEB: Minor cleanup

Changed paths:
    engines/dreamweb/backdrop.cpp
    engines/dreamweb/dreambase.h



diff --git a/engines/dreamweb/backdrop.cpp b/engines/dreamweb/backdrop.cpp
index 9d13eef..cb72454 100644
--- a/engines/dreamweb/backdrop.cpp
+++ b/engines/dreamweb/backdrop.cpp
@@ -100,8 +100,8 @@ uint8 DreamBase::getMapAd(const uint8 *setData, uint16 *x, uint16 *y) {
 	return 1;
 }
 
-void DreamBase::calcFrFrame(uint16 frameSeg, uint16 frameNum, uint8 *width, uint8 *height, uint16 x, uint16 y, ObjPos *objPos) {
-	const Frame *frame = (const Frame *)getSegment(frameSeg).ptr(frameNum * sizeof(Frame), sizeof(Frame));
+void DreamBase::calcFrFrame(const Frame *frameBase, uint16 frameNum, uint8 *width, uint8 *height, uint16 x, uint16 y, ObjPos *objPos) {
+	const Frame *frame = frameBase + frameNum;
 	*width = frame->width;
 	*height = frame->height;
 
@@ -148,7 +148,7 @@ void DreamBase::showAllObs() {
 		if (currentFrame == 0xff)
 			continue;
 		uint8 width, height;
-		calcFrFrame(data.word(kSetframes), currentFrame, &width, &height, x, y, objPos);
+		calcFrFrame(frameBase, currentFrame, &width, &height, x, y, objPos);
 		setEntry->index = setEntry->frames[0];
 		if ((setEntry->type == 0) && (setEntry->priority != 5) && (setEntry->priority != 6)) {
 			x += data.word(kMapadx);
@@ -229,7 +229,7 @@ void DreamBase::showAllFree() {
 		if (mapAd != 0) {
 			uint8 width, height;
 			uint16 currentFrame = 3 * i;
-			calcFrFrame(data.word(kFreeframes), currentFrame, &width, &height, x, y, objPos);
+			calcFrFrame(frameBase, currentFrame, &width, &height, x, y, objPos);
 			if ((width != 0) || (height != 0)) {
 				x += data.word(kMapadx);
 				y += data.word(kMapady);
@@ -277,7 +277,7 @@ void DreamBase::showAllEx() {
 			continue;
 		uint8 width, height;
 		uint16 currentFrame = 3 * i;
-		calcFrFrame(data.word(kExtras), currentFrame, &width, &height, x, y, objPos);
+		calcFrFrame(frameBase, currentFrame, &width, &height, x, y, objPos);
 		if ((width != 0) || (height != 0)) {
 			assert(currentFrame < 256);
 			showFrame(frameBase, x + data.word(kMapadx), y + data.word(kMapady), currentFrame, 0);
diff --git a/engines/dreamweb/dreambase.h b/engines/dreamweb/dreambase.h
index b49787e..3c22836 100644
--- a/engines/dreamweb/dreambase.h
+++ b/engines/dreamweb/dreambase.h
@@ -78,7 +78,7 @@ public:
 	uint8 getXAd(const uint8 *setData, uint8 *result);
 	uint8 getYAd(const uint8 *setData, uint8 *result);
 	uint8 getMapAd(const uint8 *setData, uint16 *x, uint16 *y);
-	void calcFrFrame(uint16 frameSeg, uint16 frameNum, uint8* width, uint8* height, uint16 x, uint16 y, ObjPos *objPos);
+	void calcFrFrame(const Frame *frameBase, uint16 frameNum, uint8* width, uint8* height, uint16 x, uint16 y, ObjPos *objPos);
 	void makeBackOb(SetObject *objData, uint16 x, uint16 y);
 	void showAllObs();
 	bool addAlong(const uint8 *mapFlags);






More information about the Scummvm-git-logs mailing list