MOHAWK: Revert the screen cache since it has a huge performance hit, and is not needed as is.

svn-id: r54605
This commit is contained in:
Bastien Bouclet 2010-11-29 20:52:46 +00:00
parent e26fb921e9
commit 291bea1858
2 changed files with 2 additions and 10 deletions

View File

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

View File

@ -125,7 +125,6 @@ private:
Common::File picFile;
} _pictureFile;
Graphics::Surface *_mainScreen;
bool _dirtyScreen;
Graphics::PixelFormat _pixelFormat;
};