aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2014-08-12 08:38:12 -0400
committerPaul Gilbert2014-08-12 08:38:12 -0400
commitc0cb03cea276832b2d178155786c0418eccfd21d (patch)
tree681f08affbb7b40002722836268bde02306ad5a6 /engines
parenteee84b8760dd38079fe97f263a6fa9361ad5696f (diff)
downloadscummvm-rg350-c0cb03cea276832b2d178155786c0418eccfd21d.tar.gz
scummvm-rg350-c0cb03cea276832b2d178155786c0418eccfd21d.tar.bz2
scummvm-rg350-c0cb03cea276832b2d178155786c0418eccfd21d.zip
ACCESS: Implemented copyBlocks
Diffstat (limited to 'engines')
-rw-r--r--engines/access/access.cpp16
-rw-r--r--engines/access/access.h6
-rw-r--r--engines/access/amazon/amazon_room.cpp4
-rw-r--r--engines/access/asurface.cpp11
-rw-r--r--engines/access/asurface.h2
-rw-r--r--engines/access/room.cpp10
-rw-r--r--engines/access/screen.cpp4
-rw-r--r--engines/access/screen.h2
8 files changed, 39 insertions, 16 deletions
diff --git a/engines/access/access.cpp b/engines/access/access.cpp
index 9fb0287883..29e5188fb3 100644
--- a/engines/access/access.cpp
+++ b/engines/access/access.cpp
@@ -276,7 +276,7 @@ void AccessEngine::plotList1() {
|| _buffer2._topSkip != 0 || _buffer2._bottomSkip != 0)
ie._flags |= 1;
- _newRect.push_back(bounds);
+ _newRects.push_back(bounds);
if (!_scaleFlag) {
_buffer2._rightSkip /= _scale;
@@ -298,4 +298,18 @@ void AccessEngine::plotList1() {
}
}
+void AccessEngine::copyBlocks() {
+ // Copy the block list from the previous frame
+ for (uint i = 0; i < _oldRects.size(); ++i) {
+ _screen->copyBlock(&_buffer2, _oldRects[i]);
+ }
+
+ // Copy the new block list, replacing the old one at the same time
+ _oldRects.clear();
+ for (uint i = 0; i < _newRects.size(); ++i) {
+ _screen->copyBlock(&_buffer2, _newRects[i]);
+ _oldRects.push_back(_newRects[i]);
+ }
+}
+
} // End of namespace Access
diff --git a/engines/access/access.h b/engines/access/access.h
index 819f7faaa7..3cd98f0c45 100644
--- a/engines/access/access.h
+++ b/engines/access/access.h
@@ -134,8 +134,8 @@ public:
int _establishGroup;
int _numAnimTimers;
Common::Array<TimerEntry> _timers;
- Common::Array<Common::Rect> _newRect;
- Common::Array<Common::Rect> _oldRect;
+ Common::Array<Common::Rect> _newRects;
+ Common::Array<Common::Rect> _oldRects;
Common::Array<ExtraCell> _extraCells;
Common::Array<ImageEntry> _images;
int _pCount;
@@ -240,6 +240,8 @@ public:
void plotList();
void plotList1();
+
+ void copyBlocks();
};
} // End of namespace Access
diff --git a/engines/access/amazon/amazon_room.cpp b/engines/access/amazon/amazon_room.cpp
index 5b840afc2e..b8ed0d20de 100644
--- a/engines/access/amazon/amazon_room.cpp
+++ b/engines/access/amazon/amazon_room.cpp
@@ -110,8 +110,8 @@ void AmazonRoom::reloadRoom1() {
}
_vm->_player->_frame = 0;
- _vm->_oldRect.clear();
- _vm->_newRect.clear();
+ _vm->_oldRects.clear();
+ _vm->_newRects.clear();
}
void AmazonRoom::roomSet() {
diff --git a/engines/access/asurface.cpp b/engines/access/asurface.cpp
index fe11612075..5a090afaca 100644
--- a/engines/access/asurface.cpp
+++ b/engines/access/asurface.cpp
@@ -231,4 +231,15 @@ void ASurface::plotB(SpriteFrame *frame, const Common::Point &pt) {
error("TODO");
}
+void ASurface::copyBlock(ASurface *src, const Common::Rect &bounds) {
+ byte *srcP = (byte *)getBasePtr(bounds.left, bounds.top + _scrollY);
+ byte *destP = (byte *)getBasePtr(bounds.left, bounds.top); /* + _windowYAdd */
+
+ for (int y = 0; y < bounds.height(); ++y) {
+ Common::copy(srcP, srcP + bounds.width(), destP);
+ srcP += src->pitch;
+ destP += this->pitch;
+ }
+}
+
} // End of namespace Access
diff --git a/engines/access/asurface.h b/engines/access/asurface.h
index 99f99ae696..776b9506e9 100644
--- a/engines/access/asurface.h
+++ b/engines/access/asurface.h
@@ -62,6 +62,8 @@ public:
void plotB(SpriteFrame *frame, const Common::Point &pt);
+ void copyBlock(ASurface *src, const Common::Rect &bounds);
+
void copyTo(ASurface *dest, const Common::Point &destPos);
};
diff --git a/engines/access/room.cpp b/engines/access/room.cpp
index b39e99815b..ab3592a247 100644
--- a/engines/access/room.cpp
+++ b/engines/access/room.cpp
@@ -65,8 +65,8 @@ void Room::doRoom() {
while (!_vm->shouldQuit()) {
if (!reloadFlag) {
_vm->_numImages = 0;
- _vm->_newRect.clear();
- _vm->_oldRect.clear();
+ _vm->_newRects.clear();
+ _vm->_oldRects.clear();
_vm->_nextImage = 0;
_vm->_numAnimTimers = 0;
@@ -109,7 +109,7 @@ void Room::doRoom() {
if (_vm->_screen->_scrollFlag) {
_vm->_screen->copyBF1BF2();
- _vm->_newRect.clear();
+ _vm->_newRects.clear();
_function = 0;
roomLoop();
@@ -124,7 +124,7 @@ void Room::doRoom() {
}
} else {
_vm->_screen->copyBF1BF2();
- _vm->_newRect.clear();
+ _vm->_newRects.clear();
_function = 0;
roomLoop();
@@ -133,7 +133,7 @@ void Room::doRoom() {
break;
} else {
_vm->plotList();
- _vm->_screen->copyBlocks();
+ _vm->copyBlocks();
}
}
}
diff --git a/engines/access/screen.cpp b/engines/access/screen.cpp
index 2dc86982b7..b47cd3e005 100644
--- a/engines/access/screen.cpp
+++ b/engines/access/screen.cpp
@@ -162,10 +162,6 @@ void Screen::copyBF2Vid() {
warning("TODO");
}
-void Screen::copyBlocks() {
- warning("TODO: copyBlocks");
-}
-
void Screen::copyRects() {
warning("TODO: copyRects");
}
diff --git a/engines/access/screen.h b/engines/access/screen.h
index 6c1d96e360..670da8282d 100644
--- a/engines/access/screen.h
+++ b/engines/access/screen.h
@@ -123,8 +123,6 @@ public:
void copyBF2Vid();
- void copyBlocks();
-
void copyRects();
void setBufferScan();