mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-03 09:23:37 +00:00
Hooked the VMD player in kPlayVMD. The VMD videos in the demo of Phantasmagoria 1 are shown now (e.g. the intro and the chapter beginning)
svn-id: r49912
This commit is contained in:
parent
93890a49c1
commit
18dc295a33
@ -386,6 +386,7 @@ SciKernelFunction kfunct_mappers[] = {
|
||||
{ "Save", kSave, ".*" },
|
||||
{ "List", kList, ".*" },
|
||||
{ "Robot", kRobot, ".*" },
|
||||
{ "PlayVMD", kPlayVMD, ".*" },
|
||||
{ "IsOnMe", kIsOnMe, "iio.*" },
|
||||
{ "MulDiv", kMulDiv, "iii" },
|
||||
|
||||
|
@ -438,6 +438,7 @@ reg_t kInPolygon(EngineState *s, int argc, reg_t *argv);
|
||||
reg_t kSave(EngineState *s, int argc, reg_t *argv);
|
||||
reg_t kList(EngineState *s, int argc, reg_t *argv);
|
||||
reg_t kRobot(EngineState *s, int argc, reg_t *argv);
|
||||
reg_t kPlayVMD(EngineState *s, int argc, reg_t *argv);
|
||||
reg_t kIsOnMe(EngineState *s, int argc, reg_t *argv);
|
||||
|
||||
#endif
|
||||
|
@ -30,8 +30,10 @@
|
||||
#include "sci/engine/segment.h"
|
||||
#include "sci/engine/state.h"
|
||||
#include "sci/engine/selector.h"
|
||||
#include "sci/graphics/cursor.h"
|
||||
#include "sci/graphics/frameout.h"
|
||||
#include "sci/graphics/screen.h"
|
||||
#include "sci/video/vmd_decoder.h"
|
||||
|
||||
#include "common/system.h"
|
||||
|
||||
@ -893,6 +895,74 @@ reg_t kMulDiv(EngineState *s, int argc, reg_t *argv) {
|
||||
return make_reg(0, multiplicant * multiplier / denominator);
|
||||
}
|
||||
|
||||
reg_t kPlayVMD(EngineState *s, int argc, reg_t *argv) {
|
||||
uint16 operation = argv[0].toUint16();
|
||||
Graphics::VideoDecoder *videoDecoder = 0;
|
||||
Common::String fileName;
|
||||
|
||||
Common::String warningMsg;
|
||||
|
||||
switch (operation) {
|
||||
case 0: // play
|
||||
fileName = s->_segMan->derefString(argv[1]);
|
||||
// TODO: argv[2] (usually 0)
|
||||
videoDecoder = new VMDDecoder(g_system->getMixer());
|
||||
|
||||
g_sci->_gfxCursor->kernelHide();
|
||||
|
||||
if (videoDecoder && videoDecoder->loadFile(fileName)) {
|
||||
uint16 x = (g_system->getWidth() - videoDecoder->getWidth()) / 2;
|
||||
uint16 y = (g_system->getHeight() - videoDecoder->getHeight()) / 2;
|
||||
bool skipVideo = false;
|
||||
|
||||
while (!g_engine->shouldQuit() && !videoDecoder->endOfVideo() && !skipVideo) {
|
||||
if (videoDecoder->needsUpdate()) {
|
||||
Graphics::Surface *frame = videoDecoder->decodeNextFrame();
|
||||
if (frame) {
|
||||
g_system->copyRectToScreen((byte *)frame->pixels, frame->pitch, x, y, frame->w, frame->h);
|
||||
|
||||
if (videoDecoder->hasDirtyPalette())
|
||||
videoDecoder->setSystemPalette();
|
||||
|
||||
g_system->updateScreen();
|
||||
}
|
||||
}
|
||||
|
||||
Common::Event event;
|
||||
while (g_system->getEventManager()->pollEvent(event)) {
|
||||
if ((event.type == Common::EVENT_KEYDOWN && event.kbd.keycode == Common::KEYCODE_ESCAPE) || event.type == Common::EVENT_LBUTTONUP)
|
||||
skipVideo = true;
|
||||
}
|
||||
|
||||
g_system->delayMillis(10);
|
||||
}
|
||||
|
||||
// Copy video contents to screen buffer
|
||||
g_sci->_gfxScreen->kernelSyncWithFramebuffer();
|
||||
|
||||
delete videoDecoder;
|
||||
} else
|
||||
warning("Could not play video %s\n", fileName.c_str());
|
||||
|
||||
g_sci->_gfxCursor->kernelShow();
|
||||
|
||||
break;
|
||||
default:
|
||||
warningMsg = "PlayVMD - unsupported subop. Params: " +
|
||||
Common::String::printf("%d", argc) + " (";
|
||||
|
||||
for (int i = 0; i < argc; i++) {
|
||||
warningMsg += Common::String::printf("%04x:%04x", PRINT_REG(argv[i]));
|
||||
warningMsg += (i == argc - 1 ? ")" : ", ");
|
||||
}
|
||||
|
||||
warning("%s", warningMsg.c_str());
|
||||
break;
|
||||
}
|
||||
|
||||
return s->r_acc;
|
||||
}
|
||||
|
||||
} // End of namespace Sci
|
||||
|
||||
#endif // ENABLE_SCI32
|
||||
|
@ -118,11 +118,12 @@ SciEngine::SciEngine(OSystem *syst, const ADGameDescription *desc)
|
||||
|
||||
SearchMan.addSubDirectoryMatching(gameDataDir, "actors"); // KQ6 hi-res portraits
|
||||
SearchMan.addSubDirectoryMatching(gameDataDir, "aud"); // resource.aud and audio files
|
||||
SearchMan.addSubDirectoryMatching(gameDataDir, "avi"); // AVI movie files for Windows versions
|
||||
SearchMan.addSubDirectoryMatching(gameDataDir, "seq"); // SEQ movie files for DOS versions
|
||||
SearchMan.addSubDirectoryMatching(gameDataDir, "wav"); // speech files in WAV format
|
||||
SearchMan.addSubDirectoryMatching(gameDataDir, "sfx"); // music/sound files in WAV format
|
||||
SearchMan.addSubDirectoryMatching(gameDataDir, "robot"); // robot files
|
||||
SearchMan.addSubDirectoryMatching(gameDataDir, "avi"); // AVI movie files for Windows versions
|
||||
SearchMan.addSubDirectoryMatching(gameDataDir, "seq"); // SEQ movie files for DOS versions
|
||||
SearchMan.addSubDirectoryMatching(gameDataDir, "robot"); // robot movie files
|
||||
SearchMan.addSubDirectoryMatching(gameDataDir, "vmd"); // vmd movie files
|
||||
|
||||
// Add the patches directory, except for KQ6CD; The patches folder in some versions of KQ6CD
|
||||
// is for the demo of Phantasmagoria, included in the disk
|
||||
|
Loading…
x
Reference in New Issue
Block a user