Skip to content

Commit

Permalink
SCI32: Add kPlayVMD subop 27 (SetPlane)
Browse files Browse the repository at this point in the history
Used by RAMA, when playing a video at the Hub Camp computer at the
beginning of the game (room 1004).
  • Loading branch information
csnover committed Apr 23, 2017
1 parent f711edc commit 168774c
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions engines/sci/engine/kernel.h
Original file line number Diff line number Diff line change
Expand Up @@ -477,6 +477,7 @@ reg_t kPlayVMDPlayUntilEvent(EngineState *s, int argc, reg_t *argv);
reg_t kPlayVMDShowCursor(EngineState *s, int argc, reg_t *argv);
reg_t kPlayVMDSetBlackoutArea(EngineState *s, int argc, reg_t *argv);
reg_t kPlayVMDRestrictPalette(EngineState *s, int argc, reg_t *argv);
reg_t kPlayVMDSetPlane(EngineState *s, int argc, reg_t *argv);

reg_t kShowMovie32(EngineState *s, int argc, reg_t *argv);
reg_t kShowMovieWin(EngineState *s, int argc, reg_t *argv);
Expand Down
1 change: 1 addition & 0 deletions engines/sci/engine/kernel_tables.h
Original file line number Diff line number Diff line change
Expand Up @@ -474,6 +474,7 @@ static const SciKernelMapSubEntry kPlayVMD_subops[] = {
{ SIG_SINCE_SCI21, 18, MAP_DUMMY(PlayVMDStopBlobs), "", NULL },
{ SIG_SINCE_SCI21, 21, MAP_CALL(PlayVMDSetBlackoutArea), "iiii", NULL },
{ SIG_SINCE_SCI21, 23, MAP_CALL(PlayVMDRestrictPalette), "ii", NULL },
{ SIG_SCI3, 27, MAP_CALL(PlayVMDSetPlane), "i(i)", NULL },
{ SIG_SCI3, 28, MAP_EMPTY(PlayVMDSetPreload), "i", NULL },
SCI_SUBOPENTRY_TERMINATOR
};
Expand Down
5 changes: 5 additions & 0 deletions engines/sci/engine/kvideo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -471,6 +471,11 @@ reg_t kPlayVMDRestrictPalette(EngineState *s, int argc, reg_t *argv) {
return s->r_acc;
}

reg_t kPlayVMDSetPlane(EngineState *s, int argc, reg_t *argv) {
g_sci->_video32->getVMDPlayer().setPlane(argv[0].toSint16(), argc > 1 ? argv[1] : NULL_REG);
return s->r_acc;
}

reg_t kPlayDuck(EngineState *s, int argc, reg_t *argv) {
if (!s)
return make_reg(0, getSciVersion());
Expand Down
9 changes: 9 additions & 0 deletions engines/sci/graphics/video32.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -919,6 +919,15 @@ void VMDPlayer::fillPalette(Palette &palette) const {
}
}

void VMDPlayer::setPlane(const int16 priority, const reg_t planeId) {
_priority = priority;
if (planeId != NULL_REG) {
_plane = g_sci->_gfxFrameout->getPlanes().findByObject(planeId);
assert(_plane != nullptr);
_planeIsOwned = false;
}
}

#pragma mark -
#pragma mark VMDPlayer - Palette

Expand Down
5 changes: 5 additions & 0 deletions engines/sci/graphics/video32.h
Original file line number Diff line number Diff line change
Expand Up @@ -363,6 +363,11 @@ class VMDPlayer {
*/
void ignorePalettes() { _ignorePalettes = true; }

/**
* Sets the plane and plane priority used to render video.
*/
void setPlane(const int16 priority, const reg_t planeId);

private:
/**
* The location of the VMD plane, in game script
Expand Down

0 comments on commit 168774c

Please sign in to comment.