mirror of
https://github.com/libretro/scummvm.git
synced 2025-01-19 08:25:35 +00:00
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:
parent
e26fb921e9
commit
291bea1858
@ -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;
|
||||
}
|
||||
|
@ -125,7 +125,6 @@ private:
|
||||
Common::File picFile;
|
||||
} _pictureFile;
|
||||
|
||||
Graphics::Surface *_mainScreen;
|
||||
bool _dirtyScreen;
|
||||
Graphics::PixelFormat _pixelFormat;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user