aboutsummaryrefslogtreecommitdiff
path: root/engines/gnap/scenes
diff options
context:
space:
mode:
authorStrangerke2016-06-03 07:46:03 +0200
committerStrangerke2016-06-03 07:46:03 +0200
commitc00506521724dd0d775ed90b3034c2ac590b1a78 (patch)
treee28136f9a8d24986b86a684fcc77ab04dec7ffe3 /engines/gnap/scenes
parent531b190d5974f2bb396a19cd4869020ce2669c3a (diff)
downloadscummvm-rg350-c00506521724dd0d775ed90b3034c2ac590b1a78.tar.gz
scummvm-rg350-c00506521724dd0d775ed90b3034c2ac590b1a78.tar.bz2
scummvm-rg350-c00506521724dd0d775ed90b3034c2ac590b1a78.zip
GNAP: Flip the converted frame instead of the original one in order to respect constness
Diffstat (limited to 'engines/gnap/scenes')
-rw-r--r--engines/gnap/scenes/intro.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/engines/gnap/scenes/intro.cpp b/engines/gnap/scenes/intro.cpp
index b4ba2f5201..5bb2239bab 100644
--- a/engines/gnap/scenes/intro.cpp
+++ b/engines/gnap/scenes/intro.cpp
@@ -88,12 +88,15 @@ void SceneIntro::run() {
frame1->free();
delete frame1;
} else {
+ Graphics::Surface *frame1 = frame->convertTo(_vm->_system->getScreenFormat());
+
// The intro AVI is played upside down, it's the only video played in the English version
- for (uint16 y = 0; y < frame->h / 2; y++) {
- uint32 *ptrFrom = (uint32 *)frame->getBasePtr(0, y);
- uint32 *ptrTo = (uint32 *)frame->getBasePtr(0, frame->h - y - 1);
- for (uint16 x = 0; x < frame->w; x++) {
- uint32 t = *ptrFrom;
+ for (uint16 y = 0; y < frame1->h / 2; y++) {
+ uint32 *ptrFrom = (uint32 *)frame1->getBasePtr(0, y);
+ uint32 *ptrTo = (uint32 *)frame1->getBasePtr(0, frame1->h - y - 1);
+ // in this else branch, bytesPerPixel equals 4
+ for (uint16 x = 0; x < frame1->pitch / 4; x++) {
+ uint32 t = *ptrFrom;
*ptrFrom = *ptrTo;
*ptrTo = t;
ptrFrom++;
@@ -101,7 +104,6 @@ void SceneIntro::run() {
}
}
- Graphics::Surface *frame1 = frame->convertTo(_vm->_system->getScreenFormat());
_vm->_system->copyRectToScreen(frame1->getPixels(), frame1->pitch, vidPosX, vidPosY, frame1->w, frame1->h);
frame1->free();
delete frame1;