[Scummvm-cvs-logs] scummvm master -> c00506521724dd0d775ed90b3034c2ac590b1a78
Strangerke
Strangerke at scummvm.org
Fri Jun 3 07:54:48 CEST 2016
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
c005065217 GNAP: Flip the converted frame instead of the original one in order to respect constness
Commit: c00506521724dd0d775ed90b3034c2ac590b1a78
https://github.com/scummvm/scummvm/commit/c00506521724dd0d775ed90b3034c2ac590b1a78
Author: Strangerke (strangerke at scummvm.org)
Date: 2016-06-03T07:46:03+02:00
Commit Message:
GNAP: Flip the converted frame instead of the original one in order to respect constness
Changed paths:
engines/gnap/scenes/intro.cpp
diff --git a/engines/gnap/scenes/intro.cpp b/engines/gnap/scenes/intro.cpp
index b4ba2f5..5bb2239 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;
More information about the Scummvm-git-logs
mailing list