From c00506521724dd0d775ed90b3034c2ac590b1a78 Mon Sep 17 00:00:00 2001 From: Strangerke Date: Fri, 3 Jun 2016 07:46:03 +0200 Subject: GNAP: Flip the converted frame instead of the original one in order to respect constness --- engines/gnap/scenes/intro.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'engines/gnap/scenes') 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; -- cgit v1.2.3