aboutsummaryrefslogtreecommitdiff
path: root/engines/cryomni3d
diff options
context:
space:
mode:
Diffstat (limited to 'engines/cryomni3d')
-rw-r--r--engines/cryomni3d/cryomni3d.cpp13
-rw-r--r--engines/cryomni3d/cryomni3d.h4
2 files changed, 13 insertions, 4 deletions
diff --git a/engines/cryomni3d/cryomni3d.cpp b/engines/cryomni3d/cryomni3d.cpp
index 473fc7cce6..bd27ea715f 100644
--- a/engines/cryomni3d/cryomni3d.cpp
+++ b/engines/cryomni3d/cryomni3d.cpp
@@ -114,7 +114,8 @@ Common::String CryOmni3DEngine::prepareFileName(const Common::String &baseName,
return baseName;
}
-void CryOmni3DEngine::playHNM(const Common::String &filename, Audio::Mixer::SoundType soundType) {
+void CryOmni3DEngine::playHNM(const Common::String &filename, Audio::Mixer::SoundType soundType,
+ HNMCallback beforeDraw, HNMCallback afterDraw) {
const char *const extensions[] = { "hns", "hnm", nullptr };
Common::String fname(prepareFileName(filename, extensions));
@@ -137,6 +138,7 @@ void CryOmni3DEngine::playHNM(const Common::String &filename, Audio::Mixer::Soun
uint16 height = videoDecoder->getHeight();
bool skipVideo = false;
+ unsigned int frameNum = 0;
while (!g_engine->shouldQuit() && !videoDecoder->endOfVideo() && !skipVideo) {
if (videoDecoder->needsUpdate()) {
const Graphics::Surface *frame = videoDecoder->decodeNextFrame();
@@ -147,10 +149,15 @@ void CryOmni3DEngine::playHNM(const Common::String &filename, Audio::Mixer::Soun
setPalette(palette, 0, 256);
}
- // TODO: beforeDraw
+ if (beforeDraw) {
+ (this->*beforeDraw)(frameNum);
+ }
g_system->copyRectToScreen(frame->getPixels(), frame->pitch, 0, 0, width, height);
- // TODO: afterDraw
+ if (afterDraw) {
+ (this->*afterDraw)(frameNum);
+ }
+ frameNum++;
}
}
g_system->updateScreen();
diff --git a/engines/cryomni3d/cryomni3d.h b/engines/cryomni3d/cryomni3d.h
index c06df5b69f..17e9cd39e3 100644
--- a/engines/cryomni3d/cryomni3d.h
+++ b/engines/cryomni3d/cryomni3d.h
@@ -108,8 +108,10 @@ public:
void fillSurface(byte color);
void setCursor(const Graphics::Cursor &cursor) const;
void setCursor(unsigned int cursorId) const;
+ typedef void (CryOmni3DEngine::*HNMCallback)(unsigned int frameNum);
void playHNM(const Common::String &filename,
- Audio::Mixer::SoundType soundType = Audio::Mixer::kPlainSoundType);
+ Audio::Mixer::SoundType soundType = Audio::Mixer::kPlainSoundType,
+ HNMCallback beforeDraw = nullptr, HNMCallback afterDraw = nullptr);
void displayHLZ(const Common::String &filename);
bool pollEvents();