diff options
author | johndoe123 | 2013-04-17 12:41:49 +0200 |
---|---|---|
committer | johndoe123 | 2013-04-17 12:41:49 +0200 |
commit | 0a0b2f397b95e6e219f2ac8c5b79bbe6300ef432 (patch) | |
tree | 4351e3a630eb9dc4e684d5147e1c1499fbf0e98e /engines/sword25/gfx/dynamicbitmap.cpp | |
parent | 6548104b96be211b1c93412a05802cc821b1d2e0 (diff) | |
download | scummvm-rg350-0a0b2f397b95e6e219f2ac8c5b79bbe6300ef432.tar.gz scummvm-rg350-0a0b2f397b95e6e219f2ac8c5b79bbe6300ef432.tar.bz2 scummvm-rg350-0a0b2f397b95e6e219f2ac8c5b79bbe6300ef432.zip |
SWORD25: Optimize graphics drawing code
Diffstat (limited to 'engines/sword25/gfx/dynamicbitmap.cpp')
-rw-r--r-- | engines/sword25/gfx/dynamicbitmap.cpp | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/engines/sword25/gfx/dynamicbitmap.cpp b/engines/sword25/gfx/dynamicbitmap.cpp index 137d943575..aef04fe1ef 100644 --- a/engines/sword25/gfx/dynamicbitmap.cpp +++ b/engines/sword25/gfx/dynamicbitmap.cpp @@ -53,10 +53,13 @@ DynamicBitmap::DynamicBitmap(InputPersistenceBlock &reader, RenderObjectPtr<Rend bool DynamicBitmap::createRenderedImage(uint width, uint height) { bool result = false; _image.reset(new RenderedImage(width, height, result)); - + _originalWidth = _width = width; _originalHeight = _height = height; + _image->setIsTransparent(false); + _isSolid = true; + return result; } @@ -70,10 +73,12 @@ uint DynamicBitmap::getPixel(int x, int y) const { return _image->getPixel(x, y); } -bool DynamicBitmap::doRender() { +bool DynamicBitmap::doRender(RectangleList *updateRects) { // Get the frame buffer object GraphicEngine *pGfx = Kernel::getInstance()->getGfx(); assert(pGfx); + + //return true;//DEBUG // Draw the bitmap bool result; @@ -85,7 +90,8 @@ bool DynamicBitmap::doRender() { result = _image->blit(_absoluteX, _absoluteY, (_flipV ? BitmapResource::FLIP_V : 0) | (_flipH ? BitmapResource::FLIP_H : 0), - 0, _modulationColor, -1, -1); + 0, _modulationColor, -1, -1, + updateRects); #else // WIP: A bit faster code @@ -103,13 +109,15 @@ bool DynamicBitmap::doRender() { result = _image->blit(_absoluteX, _absoluteY, (_flipV ? BitmapResource::FLIP_V : 0) | (_flipH ? BitmapResource::FLIP_H : 0), - 0, _modulationColor, _width, _height); + 0, _modulationColor, _width, _height, + updateRects); } return result; } bool DynamicBitmap::setContent(const byte *pixeldata, uint size, uint offset, uint stride) { + ++_version; // Update version to display the new video image return _image->setContent(pixeldata, size, offset, stride); } |