aboutsummaryrefslogtreecommitdiff
path: root/engines/sword25
diff options
context:
space:
mode:
authorJohannes Schickel2011-04-17 17:29:37 +0200
committerJohannes Schickel2011-04-17 20:58:07 +0200
commitc3669443ece9e29d37ddfdce5614c628717a34b9 (patch)
treeebba3a28a0626fc926a0d93e34de80154804b404 /engines/sword25
parentb0bd8fa7956ca78b65d2e5690b8dda2f842585c0 (diff)
downloadscummvm-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')
-rw-r--r--engines/sword25/fmv/movieplayer.cpp2
-rw-r--r--engines/sword25/gfx/image/renderedimage.cpp6
-rw-r--r--engines/sword25/gfx/screenshot.cpp2
3 files changed, 6 insertions, 4 deletions
diff --git a/engines/sword25/fmv/movieplayer.cpp b/engines/sword25/fmv/movieplayer.cpp
index 177bd38303..8ab64fa7a8 100644
--- a/engines/sword25/fmv/movieplayer.cpp
+++ b/engines/sword25/fmv/movieplayer.cpp
@@ -121,7 +121,7 @@ void MoviePlayer::update() {
const Graphics::Surface *s = _decoder.decodeNextFrame();
if (s) {
// Transfer the next frame
- assert(s->bytesPerPixel == 4);
+ assert(s->format.bytesPerPixel == 4);
#ifdef THEORA_INDIRECT_RENDERING
byte *frameData = (byte *)s->getBasePtr(0, 0);
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++;
}
}
diff --git a/engines/sword25/gfx/screenshot.cpp b/engines/sword25/gfx/screenshot.cpp
index e06ccb8051..5d25626727 100644
--- a/engines/sword25/gfx/screenshot.cpp
+++ b/engines/sword25/gfx/screenshot.cpp
@@ -127,7 +127,7 @@ Common::SeekableReadStream *Screenshot::createThumbnail(Graphics::Surface *data)
// generates a pixel of the target image. Finally, the result as a PNG file is stored as a file.
// The source image must be 800x600.
- if (data->w != 800 || data->h != 600 || data->bytesPerPixel != 4) {
+ if (data->w != 800 || data->h != 600 || data->format.bytesPerPixel != 4) {
error("The sreenshot dimensions have to be 800x600 in order to be saved as a thumbnail.");
return false;
}