mirror of
https://github.com/scummvm/scummvm.git
synced 2026-06-20 05:45:29 +00:00
DIRECTOR: Load properties from digital video cast
This commit is contained in:
@@ -146,6 +146,32 @@ void BitmapCast::createWidget() {
|
||||
_widget->getSurface()->blitFrom(*_img->getSurface());
|
||||
}
|
||||
|
||||
DigitalVideoCast::DigitalVideoCast(Common::ReadStreamEndian &stream, uint16 version) {
|
||||
_type = kCastDigitalVideo;
|
||||
|
||||
for (int i = 0; i < 4; i++) {
|
||||
stream.readUint16();
|
||||
}
|
||||
_frameRate = stream.readByte();
|
||||
stream.readByte();
|
||||
|
||||
byte flags1 = stream.readByte();
|
||||
_frameRateType = kFrameRateDefault;
|
||||
if (flags1 & 0x08) {
|
||||
_frameRateType = (FrameRateType)((flags1 & 0x30) >> 4);
|
||||
}
|
||||
_preload = flags1 & 0x04;
|
||||
_enableVideo = ~(flags1 & 0x02);
|
||||
_pauseAtStart = flags1 & 0x01;
|
||||
|
||||
byte flags2 = stream.readByte();
|
||||
_showControls = flags2 & 0x40;
|
||||
_looping = flags2 & 0x10;
|
||||
_enableSound = flags2 & 0x08;
|
||||
_enableCrop = ~(flags2 & 0x02);
|
||||
_center = flags2 & 0x01;
|
||||
}
|
||||
|
||||
SoundCast::SoundCast(Common::ReadStreamEndian &stream, uint16 version) {
|
||||
_type = kCastSound;
|
||||
_audio = nullptr;
|
||||
|
||||
@@ -95,6 +95,23 @@ public:
|
||||
uint32 _tag;
|
||||
};
|
||||
|
||||
class DigitalVideoCast : public Cast {
|
||||
public:
|
||||
DigitalVideoCast(Common::ReadStreamEndian &stream, uint16 version);
|
||||
|
||||
bool _looping;
|
||||
bool _pauseAtStart;
|
||||
bool _enableVideo;
|
||||
bool _enableSound;
|
||||
bool _enableCrop;
|
||||
bool _center;
|
||||
bool _preload;
|
||||
bool _showControls;
|
||||
FrameRateType _frameRateType;
|
||||
|
||||
uint16 _frameRate;
|
||||
};
|
||||
|
||||
class SoundCast : public Cast {
|
||||
public:
|
||||
SoundCast(Common::ReadStreamEndian &stream, uint16 version);
|
||||
|
||||
@@ -671,6 +671,10 @@ void Score::loadCastDataVWCR(Common::SeekableSubReadStreamEndian &stream) {
|
||||
debugC(3, kDebugLoading, "Score::loadCastDataVWCR(): CastTypes id: %d(%s) SoundCast", id, numToCastNum(id));
|
||||
_loadedCast->setVal(id, new SoundCast(stream, _vm->getVersion()));
|
||||
break;
|
||||
case kCastDigitalVideo:
|
||||
debugC(3, kDebugLoading, "Score::loadCastDataVWCR(): CastTypes id: %d(%s) DigitalVideoCast", id, numToCastNum(id));
|
||||
_loadedCast->setVal(id, new DigitalVideoCast(stream, _vm->getVersion()));
|
||||
break;
|
||||
default:
|
||||
warning("Score::loadCastDataVWCR(): Unhandled cast id: %d(%s), type: %d, %d bytes", id, numToCastNum(id), castType, size);
|
||||
stream.skip(size - 1);
|
||||
@@ -784,6 +788,10 @@ void Score::loadCastData(Common::SeekableSubReadStreamEndian &stream, uint16 id,
|
||||
debugC(3, kDebugLoading, "Score::loadCastData(): loading kCastRTE (%d children)", res->children.size());
|
||||
_loadedCast->setVal(id, new RTECast(castStream, _vm->getVersion()));
|
||||
break;
|
||||
case kCastDigitalVideo:
|
||||
debugC(3, kDebugLoading, "Score::loadCastData(): loading kCastDigitalVideo (%d children)", res->children.size());
|
||||
_loadedCast->setVal(id, new DigitalVideoCast(castStream, _vm->getVersion()));
|
||||
break;
|
||||
case kCastFilmLoop:
|
||||
warning("STUB: Score::loadCastData(): kCastFilmLoop (%d children)", res->children.size());
|
||||
size2 = 0;
|
||||
@@ -800,10 +808,6 @@ void Score::loadCastData(Common::SeekableSubReadStreamEndian &stream, uint16 id,
|
||||
warning("STUB: Score::loadCastData(): kCastMovie (%d children)", res->children.size());
|
||||
size2 = 0;
|
||||
break;
|
||||
case kCastDigitalVideo:
|
||||
warning("STUB: Score::loadCastData(): kCastDigitalVideo (%d children)", res->children.size());
|
||||
size2 = 0;
|
||||
break;
|
||||
default:
|
||||
warning("Score::loadCastData(): Unhandled cast type: %d [%s] (%d children)", castType, tag2str(castType), res->children.size());
|
||||
// also don't try and read the strings... we don't know what this item is.
|
||||
|
||||
@@ -90,6 +90,13 @@ enum ButtonType {
|
||||
kTypeRadio
|
||||
};
|
||||
|
||||
enum FrameRateType {
|
||||
kFrameRateDefault = -1,
|
||||
kFrameRateNormal = 0,
|
||||
kFrameRateFastest = 1,
|
||||
kFrameRateFixed = 2
|
||||
};
|
||||
|
||||
enum SpriteType {
|
||||
kInactiveSprite = 0, // turns the sprite off
|
||||
kBitmapSprite = 1,
|
||||
|
||||
Reference in New Issue
Block a user