aboutsummaryrefslogtreecommitdiff
path: root/graphics
diff options
context:
space:
mode:
authorFilippos Karapetis2009-01-11 04:41:22 +0000
committerFilippos Karapetis2009-01-11 04:41:22 +0000
commitb107b7db4792ebc682bf9d140ac86da0df44414d (patch)
tree0698306bcf3f43f84501a15573ef4d167ad47627 /graphics
parentf997ea3c6e6c9631977feec62e5772d9c576d4c3 (diff)
downloadscummvm-rg350-b107b7db4792ebc682bf9d140ac86da0df44414d.tar.gz
scummvm-rg350-b107b7db4792ebc682bf9d140ac86da0df44414d.tar.bz2
scummvm-rg350-b107b7db4792ebc682bf9d140ac86da0df44414d.zip
Stop recalculating the x and y coordinates for every frame in playVideo()
svn-id: r35819
Diffstat (limited to 'graphics')
-rw-r--r--graphics/video/video_player.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/graphics/video/video_player.cpp b/graphics/video/video_player.cpp
index 7859a67bab..e11c3c5c31 100644
--- a/graphics/video/video_player.cpp
+++ b/graphics/video/video_player.cpp
@@ -188,6 +188,9 @@ bool VideoPlayer::playVideo(Common::List<Common::Event> *stopEvents) {
g_system->clearScreen();
+ int frameX = (g_system->getWidth() - _decoder->getWidth()) / 2;
+ int frameY = (g_system->getHeight() - _decoder->getHeight()) / 2;
+
while (_decoder->getCurFrame() < _decoder->getFrameCount() && !_skipVideo) {
processVideoEvents(stopEvents);
@@ -195,10 +198,7 @@ bool VideoPlayer::playVideo(Common::List<Common::Event> *stopEvents) {
_decoder->decodeNextFrame();
Graphics::Surface *screen = g_system->lockScreen();
- _decoder->copyFrameToBuffer((byte *)screen->pixels,
- (g_system->getWidth() - _decoder->getWidth()) / 2,
- (g_system->getHeight() - _decoder->getHeight()) / 2,
- g_system->getWidth());
+ _decoder->copyFrameToBuffer((byte *)screen->pixels, frameX, frameY, g_system->getWidth());
performPostProcessing((byte *)screen->pixels);
g_system->unlockScreen();