[Scummvm-cvs-logs] scummvm master -> 7ca33d1889815a63ace0148d34efe67066fdac87
bluegr
bluegr at gmail.com
Sun Jan 5 14:39:22 CET 2014
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
1632d5f39a VIDEO: Handle the AVI 'JUNQ' and 'dmlh' chunk headers
7ca33d1889 FULLPIPE: Implement ModalVideoPlayer::play()
Commit: 1632d5f39a577b5fe1f6a6d89bd67896dbc54673
https://github.com/scummvm/scummvm/commit/1632d5f39a577b5fe1f6a6d89bd67896dbc54673
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2014-01-05T05:34:33-08:00
Commit Message:
VIDEO: Handle the AVI 'JUNQ' and 'dmlh' chunk headers
These are used by Full Pipe's intro videos
Changed paths:
video/avi_decoder.cpp
diff --git a/video/avi_decoder.cpp b/video/avi_decoder.cpp
index 36fe83f..7f5a557 100644
--- a/video/avi_decoder.cpp
+++ b/video/avi_decoder.cpp
@@ -59,6 +59,8 @@ namespace Video {
#define ID_MIDS MKTAG('m','i','d','s')
#define ID_TXTS MKTAG('t','x','t','s')
#define ID_JUNK MKTAG('J','U','N','K')
+#define ID_JUNQ MKTAG('J','U','N','Q')
+#define ID_DMLH MKTAG('d','m','l','h')
#define ID_STRF MKTAG('s','t','r','f')
#define ID_MOVI MKTAG('m','o','v','i')
#define ID_REC MKTAG('r','e','c',' ')
@@ -155,9 +157,11 @@ bool AVIDecoder::parseNextChunk() {
case ID_STRD: // Extra stream info, safe to ignore
case ID_VEDT: // Unknown, safe to ignore
case ID_JUNK: // Alignment bytes, should be ignored
+ case ID_JUNQ: // Same as JUNK, safe to ignore
case ID_ISFT: // Metadata, safe to ignore
case ID_DISP: // Metadata, should be safe to ignore
case ID_STRN: // Metadata, safe to ignore
+ case ID_DMLH: // OpenDML extension, contains an extra total frames field, safe to ignore
skipChunk(size);
break;
case ID_IDX1:
Commit: 7ca33d1889815a63ace0148d34efe67066fdac87
https://github.com/scummvm/scummvm/commit/7ca33d1889815a63ace0148d34efe67066fdac87
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2014-01-05T05:34:34-08:00
Commit Message:
FULLPIPE: Implement ModalVideoPlayer::play()
The intro Videos are encoded using Intel Indeo 5 (IV50), which isn't
supported yet. Thus, only the audio is heard for now
Changed paths:
engines/fullpipe/modal.cpp
diff --git a/engines/fullpipe/modal.cpp b/engines/fullpipe/modal.cpp
index 516d761..6db916a 100644
--- a/engines/fullpipe/modal.cpp
+++ b/engines/fullpipe/modal.cpp
@@ -28,6 +28,9 @@
#include "fullpipe/scenes.h"
#include "fullpipe/gameloader.h"
+#include "graphics/palette.h"
+#include "video/avi_decoder.h"
+
namespace Fullpipe {
ModalIntro::ModalIntro() {
@@ -224,8 +227,41 @@ void ModalIntro::finish() {
g_fp->_gameLoader->updateSystems(42);
}
-void ModalVideoPlayer::play(const char *fname) {
- warning("STUB: ModalVideoPlayer::play(%s)", fname);
+void ModalVideoPlayer::play(const char *filename) {
+ // TODO: Videos are encoded using Intel Indeo 5 (IV50), which isn't supported yet
+
+ Video::AVIDecoder *aviDecoder = new Video::AVIDecoder();
+
+ if (!aviDecoder->loadFile(filename))
+ return;
+
+ uint16 x = (g_system->getWidth() - aviDecoder->getWidth()) / 2;
+ uint16 y = (g_system->getHeight() - aviDecoder->getHeight()) / 2;
+ bool skipVideo = false;
+
+ aviDecoder->start();
+
+ while (!g_fp->shouldQuit() && !aviDecoder->endOfVideo() && !skipVideo) {
+ if (aviDecoder->needsUpdate()) {
+ const Graphics::Surface *frame = aviDecoder->decodeNextFrame();
+ if (frame) {
+ g_fp->_system->copyRectToScreen(frame->getPixels(), frame->pitch, x, y, frame->w, frame->h);
+
+ if (aviDecoder->hasDirtyPalette())
+ g_fp->_system->getPaletteManager()->setPalette(aviDecoder->getPalette(), 0, 256);
+
+ g_fp->_system->updateScreen();
+ }
+ }
+
+ Common::Event event;
+ while (g_fp->_system->getEventManager()->pollEvent(event)) {
+ if ((event.type == Common::EVENT_KEYDOWN && event.kbd.keycode == Common::KEYCODE_ESCAPE) || event.type == Common::EVENT_LBUTTONUP)
+ skipVideo = true;
+ }
+
+ g_fp->_system->delayMillis(aviDecoder->getTimeToNextFrame());
+ }
}
void FullpipeEngine::openMap() {
More information about the Scummvm-git-logs
mailing list