ACCESS: Implemented copyBlocks

This commit is contained in:
Paul Gilbert 2014-08-12 08:38:12 -04:00
parent eee84b8760
commit c0cb03cea2
8 changed files with 39 additions and 16 deletions

View File

@ -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

View File

@ -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

View File

@ -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() {

View File

@ -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

View File

@ -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);
};

View File

@ -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();
}
}
}

View File

@ -162,10 +162,6 @@ void Screen::copyBF2Vid() {
warning("TODO");
}
void Screen::copyBlocks() {
warning("TODO: copyBlocks");
}
void Screen::copyRects() {
warning("TODO: copyRects");
}

View File

@ -123,8 +123,6 @@ public:
void copyBF2Vid();
void copyBlocks();
void copyRects();
void setBufferScan();