aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilippos Karapetis2016-03-15 21:05:01 +0200
committerFilippos Karapetis2016-03-15 21:06:46 +0200
commitbe58e5bc308c7364d971039d54e357b1ee3ed4ea (patch)
tree55570529f377e0bc963a17f87a898e7a406688c8
parentd61dd0f52601ba296678493f46b3cf5a6437190b (diff)
downloadscummvm-rg350-be58e5bc308c7364d971039d54e357b1ee3ed4ea.tar.gz
scummvm-rg350-be58e5bc308c7364d971039d54e357b1ee3ed4ea.tar.bz2
scummvm-rg350-be58e5bc308c7364d971039d54e357b1ee3ed4ea.zip
SCI32: More work on remapping
Still not working
-rw-r--r--engines/sci/graphics/celobj32.cpp3
-rw-r--r--engines/sci/graphics/frameout.cpp16
-rw-r--r--engines/sci/graphics/frameout.h1
-rw-r--r--engines/sci/graphics/plane32.cpp20
-rw-r--r--engines/sci/graphics/plane32.h2
5 files changed, 31 insertions, 11 deletions
diff --git a/engines/sci/graphics/celobj32.cpp b/engines/sci/graphics/celobj32.cpp
index e9833c517b..eb71a45734 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 b124573ba1..99abb92151 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 22c0e14829..a820696dde 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 b0197704ce..9e75379b58 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 51d93b78a5..42629666ed 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 -