aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorBastien Bouclet2010-11-29 20:52:46 +0000
committerBastien Bouclet2010-11-29 20:52:46 +0000
commit291bea1858c12b8557aeb46e6f57dc701293c956 (patch)
tree2af6bc78af30990ae61a4ebbd753d90cf4d97838 /engines
parente26fb921e9ab814b81ba5c496c626e49f03a47a3 (diff)
downloadscummvm-rg350-291bea1858c12b8557aeb46e6f57dc701293c956.tar.gz
scummvm-rg350-291bea1858c12b8557aeb46e6f57dc701293c956.tar.bz2
scummvm-rg350-291bea1858c12b8557aeb46e6f57dc701293c956.zip
MOHAWK: Revert the screen cache since it has a huge performance hit, and is not needed as is.
svn-id: r54605
Diffstat (limited to 'engines')
-rw-r--r--engines/mohawk/graphics.cpp11
-rw-r--r--engines/mohawk/graphics.h1
2 files changed, 2 insertions, 10 deletions
diff --git a/engines/mohawk/graphics.cpp b/engines/mohawk/graphics.cpp
index 8da0cd07cb..4170b24aad 100644
--- a/engines/mohawk/graphics.cpp
+++ b/engines/mohawk/graphics.cpp
@@ -138,9 +138,6 @@ MystGraphics::MystGraphics(MohawkEngine_Myst* vm) : GraphicsManager(), _vm(vm) {
_pictureFile.entries = NULL;
- // Initialize our buffer
- _mainScreen = new Graphics::Surface();
- _mainScreen->create(_vm->_system->getWidth(), _vm->_system->getHeight(), _pixelFormat.bytesPerPixel);
_dirtyScreen = false;
}
@@ -149,9 +146,6 @@ MystGraphics::~MystGraphics() {
delete _jpegDecoder;
delete _pictDecoder;
delete[] _pictureFile.entries;
-
- _mainScreen->free();
- delete _mainScreen;
}
static const char* picFileNames[] = {
@@ -273,9 +267,9 @@ void MystGraphics::copyImageSectionToScreen(uint16 image, Common::Rect src, Comm
// Convert from bitmap coordinates to surface coordinates
uint16 top = surface->h - src.top - height;
+
+ _vm->_system->copyRectToScreen((byte *)surface->getBasePtr(src.left, top), surface->pitch, dest.left, dest.top, width, height);
- for (uint16 i = 0; i < height; i++)
- memcpy(_mainScreen->getBasePtr(dest.left, i + dest.top), surface->getBasePtr(src.left, top + i), width * surface->bytesPerPixel);
// Mark the screen as dirty
_dirtyScreen = true;
@@ -288,7 +282,6 @@ void MystGraphics::copyImageToScreen(uint16 image, Common::Rect dest) {
void MystGraphics::updateScreen() {
if (_dirtyScreen) {
// Only copy the buffer to the screen if it's dirty
- _vm->_system->copyRectToScreen((byte *)_mainScreen->pixels, _mainScreen->pitch, 0, 0, _mainScreen->w, _mainScreen->h);
_vm->_system->updateScreen();
_dirtyScreen = false;
}
diff --git a/engines/mohawk/graphics.h b/engines/mohawk/graphics.h
index 71bdf2f4a7..1f184b30d0 100644
--- a/engines/mohawk/graphics.h
+++ b/engines/mohawk/graphics.h
@@ -125,7 +125,6 @@ private:
Common::File picFile;
} _pictureFile;
- Graphics::Surface *_mainScreen;
bool _dirtyScreen;
Graphics::PixelFormat _pixelFormat;
};