diff options
author | Johannes Schickel | 2011-04-17 16:31:49 +0200 |
---|---|---|
committer | Johannes Schickel | 2011-04-17 16:31:49 +0200 |
commit | b3f0eb8a9db27d3b0659eeb7ce53c69849342439 (patch) | |
tree | bbe4cd920a591075a861434370bc5f76688cb8a0 /engines | |
parent | 9d7f7fc4b625918340ad3a081e44526a583e0ee0 (diff) | |
download | scummvm-rg350-b3f0eb8a9db27d3b0659eeb7ce53c69849342439.tar.gz scummvm-rg350-b3f0eb8a9db27d3b0659eeb7ce53c69849342439.tar.bz2 scummvm-rg350-b3f0eb8a9db27d3b0659eeb7ce53c69849342439.zip |
SWORD25: Prefer Surface::create taking a PixelFormat over the one taking a byte depth.
I am not 100% sure whether the surfaces all use the same format as the screen,
but a quick test showed that it still works fine. In case this is wrong please
set them up with the correct format.
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sword25/fmv/theora_decoder.cpp | 2 | ||||
-rw-r--r-- | engines/sword25/gfx/graphicengine.cpp | 6 | ||||
-rw-r--r-- | engines/sword25/gfx/image/renderedimage.cpp | 2 | ||||
-rw-r--r-- | engines/sword25/gfx/screenshot.cpp | 2 |
4 files changed, 7 insertions, 5 deletions
diff --git a/engines/sword25/fmv/theora_decoder.cpp b/engines/sword25/fmv/theora_decoder.cpp index e9901c04b0..4f6f52509d 100644 --- a/engines/sword25/fmv/theora_decoder.cpp +++ b/engines/sword25/fmv/theora_decoder.cpp @@ -289,7 +289,7 @@ bool TheoraDecoder::loadStream(Common::SeekableReadStream *stream) { _surface = new Graphics::Surface(); - _surface->create(_theoraInfo.frame_width, _theoraInfo.frame_height, 4); + _surface->create(_theoraInfo.frame_width, _theoraInfo.frame_height, g_system->getScreenFormat()); return true; } diff --git a/engines/sword25/gfx/graphicengine.cpp b/engines/sword25/gfx/graphicengine.cpp index 502d2d3b2a..8bdf2a4a6e 100644 --- a/engines/sword25/gfx/graphicengine.cpp +++ b/engines/sword25/gfx/graphicengine.cpp @@ -112,8 +112,10 @@ bool GraphicEngine::init(int width, int height, int bitDepth, int backbufferCoun _screenRect.right = _width; _screenRect.bottom = _height; - _backSurface.create(width, height, 4); - _frameBuffer.create(width, height, 4); + const Graphics::PixelFormat format = g_system->getScreenFormat(); + + _backSurface.create(width, height, format); + _frameBuffer.create(width, height, format); // Standardmäßig ist Vsync an. setVsync(true); diff --git a/engines/sword25/gfx/image/renderedimage.cpp b/engines/sword25/gfx/image/renderedimage.cpp index b740c0ec68..560663896f 100644 --- a/engines/sword25/gfx/image/renderedimage.cpp +++ b/engines/sword25/gfx/image/renderedimage.cpp @@ -409,7 +409,7 @@ void RenderedImage::copyDirectly(int posX, int posY) { */ Graphics::Surface *RenderedImage::scale(const Graphics::Surface &srcImage, int xSize, int ySize) { Graphics::Surface *s = new Graphics::Surface(); - s->create(xSize, ySize, srcImage.bytesPerPixel); + s->create(xSize, ySize, srcImage.format); int *horizUsage = scaleLine(xSize, srcImage.w); int *vertUsage = scaleLine(ySize, srcImage.h); diff --git a/engines/sword25/gfx/screenshot.cpp b/engines/sword25/gfx/screenshot.cpp index 35e94976eb..e06ccb8051 100644 --- a/engines/sword25/gfx/screenshot.cpp +++ b/engines/sword25/gfx/screenshot.cpp @@ -134,7 +134,7 @@ Common::SeekableReadStream *Screenshot::createThumbnail(Graphics::Surface *data) // Buffer for the output thumbnail Graphics::Surface thumbnail; - thumbnail.create(200, 125, 4); + thumbnail.create(200, 125, g_system->getScreenFormat()); // Über das Zielbild iterieren und einen Pixel zur Zeit berechnen. uint x, y; |