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

bluegr bluegr at gmail.com
Tue Mar 15 20:07:22 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:
be58e5bc30 SCI32: More work on remapping


Commit: be58e5bc308c7364d971039d54e357b1ee3ed4ea
    https://github.com/scummvm/scummvm/commit/be58e5bc308c7364d971039d54e357b1ee3ed4ea
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2016-03-15T21:06:46+02:00

Commit Message:
SCI32: More work on remapping

Still not working

Changed paths:
    engines/sci/graphics/celobj32.cpp
    engines/sci/graphics/frameout.cpp
    engines/sci/graphics/frameout.h
    engines/sci/graphics/plane32.cpp
    engines/sci/graphics/plane32.h



diff --git a/engines/sci/graphics/celobj32.cpp b/engines/sci/graphics/celobj32.cpp
index e9833c5..eb71a45 100644
--- a/engines/sci/graphics/celobj32.cpp
+++ b/engines/sci/graphics/celobj32.cpp
@@ -27,6 +27,7 @@
 #include "sci/graphics/frameout.h"
 #include "sci/graphics/palette32.h"
 #include "sci/graphics/picture.h"
+#include "sci/graphics/remap.h"
 #include "sci/graphics/text32.h"
 #include "sci/graphics/view.h"
 
@@ -381,7 +382,7 @@ void CelObj::draw(Buffer &target, const ScreenItem &screenItem, const Common::Re
 			// NOTE: In the original code this check was `g_Remap_numActiveRemaps && _remap`,
 			// but since we are already in a `_remap` branch, there is no reason to check it
 			// again
-			if (/* TODO: g_Remap_numActiveRemaps */ false) {
+			if (g_sci->_gfxRemap32->getRemapCount()) {
 				if (scaleX.isOne() && scaleY.isOne()) {
 					if (_compressionType == kCelCompressionNone) {
 						if (_drawMirrored) {
diff --git a/engines/sci/graphics/frameout.cpp b/engines/sci/graphics/frameout.cpp
index b124573..99abb92 100644
--- a/engines/sci/graphics/frameout.cpp
+++ b/engines/sci/graphics/frameout.cpp
@@ -448,8 +448,7 @@ void GfxFrameout::frameOut(const bool shouldShowBits, const Common::Rect &rect)
 	eraseLists.resize(_planes.size());
 
 	if (g_sci->_gfxRemap32->getRemapCount() > 0 && _remapOccurred) {
-		// TODO
-		// remapMarkRedraw();
+		remapMarkRedraw();
 	}
 
 	calcLists(screenItemLists, eraseLists, rect);
@@ -846,8 +845,7 @@ void GfxFrameout::palMorphFrameOut(const int8 *styleRanges, const ShowStyleEntry
 	eraseLists.resize(_planes.size());
 
 	if (g_sci->_gfxRemap32->getRemapCount() > 0 && _remapOccurred) {
-		// TODO
-		//_screen->remapMarkRedraw();
+		remapMarkRedraw();
 	}
 
 	calcLists(screenItemLists, eraseLists, calcRect);
@@ -908,8 +906,7 @@ void GfxFrameout::palMorphFrameOut(const int8 *styleRanges, const ShowStyleEntry
 	}
 
 	if (g_sci->_gfxRemap32->getRemapCount() > 0 && _remapOccurred) {
-		// TODO
-		//_screen->remapMarkRedraw();
+		remapMarkRedraw();
 	}
 
 	calcLists(screenItemLists, eraseLists, calcRect);
@@ -2053,6 +2050,13 @@ void GfxFrameout::kernelSetNowSeen(const reg_t screenItemObject) const {
 	writeSelectorValue(_segMan, screenItemObject, SELECTOR(nsBottom), result.bottom - 1);
 }
 
+void GfxFrameout::remapMarkRedraw() {
+	for (PlaneList::const_iterator it = _planes.begin(); it != _planes.end(); ++it) {
+		Plane *p = *it;
+		p->remapMarkRedraw();
+	}
+}
+
 #pragma mark -
 #pragma mark Debugging
 
diff --git a/engines/sci/graphics/frameout.h b/engines/sci/graphics/frameout.h
index 22c0e14..a820696 100644
--- a/engines/sci/graphics/frameout.h
+++ b/engines/sci/graphics/frameout.h
@@ -240,6 +240,7 @@ public:
 #pragma mark Screen items
 private:
 	void deleteScreenItem(ScreenItem *screenItem, const reg_t plane);
+	void remapMarkRedraw();
 
 public:
 	void kernelAddScreenItem(const reg_t object);
diff --git a/engines/sci/graphics/plane32.cpp b/engines/sci/graphics/plane32.cpp
index b019770..9e75379 100644
--- a/engines/sci/graphics/plane32.cpp
+++ b/engines/sci/graphics/plane32.cpp
@@ -27,6 +27,7 @@
 #include "sci/graphics/frameout.h"
 #include "sci/graphics/lists32.h"
 #include "sci/graphics/plane32.h"
+#include "sci/graphics/remap.h"
 #include "sci/graphics/screen.h"
 #include "sci/graphics/screen_item32.h"
 
@@ -317,7 +318,7 @@ void Plane::calcLists(Plane &visiblePlane, const PlaneList &planeList, DrawList
 					vitem != nullptr &&
 					!vitem->_screenRect.isEmpty()
 				) {
-					if (/* TODO: g_Remap_numActiveRemaps */ false) { // active remaps?
+					if (g_sci->_gfxRemap32->getRemapCount()) {
 						mergeToRectList(vitem->_screenRect, eraseList);
 					} else {
 						eraseList.add(vitem->_screenRect);
@@ -328,7 +329,7 @@ void Plane::calcLists(Plane &visiblePlane, const PlaneList &planeList, DrawList
 				item->calcRects(*this);
 
 				if(!item->_screenRect.isEmpty()) {
-					if (/* TODO: g_Remap_numActiveRemaps */ false) { // active remaps?
+					if (g_sci->_gfxRemap32->getRemapCount()) {
 						drawList.add(item, item->_screenRect);
 						mergeToRectList(item->_screenRect, eraseList);
 					} else {
@@ -338,7 +339,7 @@ void Plane::calcLists(Plane &visiblePlane, const PlaneList &planeList, DrawList
 			} else if (item->_updated) {
 				// add old rect to erase list, new item to draw list
 				item->calcRects(*this);
-				if (/* TODO: g_Remap_numActiveRemaps */ false) { // active remaps
+				if (g_sci->_gfxRemap32->getRemapCount()) {
 					// if item and vitem don't overlap, ...
 					if (item->_screenRect.isEmpty() ||
 						i >= visiblePlaneItemCount ||
@@ -452,7 +453,7 @@ void Plane::calcLists(Plane &visiblePlane, const PlaneList &planeList, DrawList
 		}
 	}
 
-	if (/* TODO: g_Remap_numActiveRemaps == 0 */ true) { // no remaps active?
+	if (g_sci->_gfxRemap32->getRemapCount() == 0) { // no remaps active?
 		// Add all items that overlap with items in the drawlist and have higher
 		// priority.
 
@@ -811,6 +812,17 @@ void Plane::scrollScreenItems(const int16 deltaX, const int16 deltaY, const bool
 	}
 }
 
+void Plane::remapMarkRedraw() {
+	for (ScreenItemList::const_iterator screenItemPtr = _screenItemList.begin(); screenItemPtr != _screenItemList.end(); ++screenItemPtr) {
+		if (*screenItemPtr != nullptr) {
+			ScreenItem &screenItem = **screenItemPtr;
+			if (screenItem.getCelObj()._remap && !screenItem._deleted && !screenItem._created) {
+				screenItem._updated = _screenItemList.size();
+			}
+		}
+	}
+}
+
 #pragma mark -
 #pragma mark PlaneList
 void PlaneList::add(Plane *plane) {
diff --git a/engines/sci/graphics/plane32.h b/engines/sci/graphics/plane32.h
index 51d93b7..4262966 100644
--- a/engines/sci/graphics/plane32.h
+++ b/engines/sci/graphics/plane32.h
@@ -430,6 +430,8 @@ public:
 	 * and adds them to the given draw and erase lists.
 	 */
 	void redrawAll(Plane *visiblePlane, const PlaneList &planeList, DrawList &drawList, RectList &eraseList);
+
+	void remapMarkRedraw();
 };
 
 #pragma mark -






More information about the Scummvm-git-logs mailing list