diff options
author | Johannes Schickel | 2011-04-17 17:29:37 +0200 |
---|---|---|
committer | Johannes Schickel | 2011-04-17 20:58:07 +0200 |
commit | c3669443ece9e29d37ddfdce5614c628717a34b9 (patch) | |
tree | ebba3a28a0626fc926a0d93e34de80154804b404 /engines/sword25/gfx/image | |
parent | b0bd8fa7956ca78b65d2e5690b8dda2f842585c0 (diff) | |
download | scummvm-rg350-c3669443ece9e29d37ddfdce5614c628717a34b9.tar.gz scummvm-rg350-c3669443ece9e29d37ddfdce5614c628717a34b9.tar.bz2 scummvm-rg350-c3669443ece9e29d37ddfdce5614c628717a34b9.zip |
SWORD25: Prefer Surface::format over Surface::bytesPerPixel.
Diffstat (limited to 'engines/sword25/gfx/image')
-rw-r--r-- | engines/sword25/gfx/image/renderedimage.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/engines/sword25/gfx/image/renderedimage.cpp b/engines/sword25/gfx/image/renderedimage.cpp index 560663896f..494b631f14 100644 --- a/engines/sword25/gfx/image/renderedimage.cpp +++ b/engines/sword25/gfx/image/renderedimage.cpp @@ -188,6 +188,8 @@ bool RenderedImage::blit(int posX, int posY, int flipping, Common::Rect *pPartRe // Create an encapsulating surface for the data Graphics::Surface srcImage; srcImage.bytesPerPixel = 4; + // TODO: Is the data really in the screen format? + srcImage.format = g_system->getScreenFormat(); srcImage.pitch = _width * 4; srcImage.w = _width; srcImage.h = _height; @@ -420,8 +422,8 @@ Graphics::Surface *RenderedImage::scale(const Graphics::Surface &srcImage, int x byte *destP = (byte *)s->getBasePtr(0, yp); for (int xp = 0; xp < xSize; ++xp) { - const byte *tempSrcP = srcP + (horizUsage[xp] * srcImage.bytesPerPixel); - for (int byteCtr = 0; byteCtr < srcImage.bytesPerPixel; ++byteCtr) { + const byte *tempSrcP = srcP + (horizUsage[xp] * srcImage.format.bytesPerPixel); + for (int byteCtr = 0; byteCtr < srcImage.format.bytesPerPixel; ++byteCtr) { *destP++ = *tempSrcP++; } } |