aboutsummaryrefslogtreecommitdiff
path: root/graphics/video/coktelvideo
diff options
context:
space:
mode:
authorSven Hesse2009-07-24 21:31:00 +0000
committerSven Hesse2009-07-24 21:31:00 +0000
commitadc537161a048939c995475707f70cbe9c34b720 (patch)
treeb35ad12482678964dc14a68f124bf5d7961d4726 /graphics/video/coktelvideo
parent44fb798a3af69ec7e983b60011d8153b804168ba (diff)
downloadscummvm-rg350-adc537161a048939c995475707f70cbe9c34b720.tar.gz
scummvm-rg350-adc537161a048939c995475707f70cbe9c34b720.tar.bz2
scummvm-rg350-adc537161a048939c995475707f70cbe9c34b720.zip
Adding subtitle support to Woodruff
svn-id: r42705
Diffstat (limited to 'graphics/video/coktelvideo')
-rw-r--r--graphics/video/coktelvideo/coktelvideo.cpp13
-rw-r--r--graphics/video/coktelvideo/coktelvideo.h9
2 files changed, 17 insertions, 5 deletions
diff --git a/graphics/video/coktelvideo/coktelvideo.cpp b/graphics/video/coktelvideo/coktelvideo.cpp
index 6309bc5ae2..c02b0528d5 100644
--- a/graphics/video/coktelvideo/coktelvideo.cpp
+++ b/graphics/video/coktelvideo/coktelvideo.cpp
@@ -1114,6 +1114,10 @@ bool Vmd::load(Common::SeekableReadStream &stream) {
_frames[i].parts[j].field_E = _stream->readByte();
_frames[i].parts[j].flags = _stream->readByte();
+ } else if (_frames[i].parts[j].type == kPartTypeSpeech) {
+ _frames[i].parts[j].id = _stream->readUint16LE();
+ // Speech text file name
+ _stream->skip(8);
} else if (_frames[i].parts[j].type == kPartTypeExtraData) {
if (!separator)
numExtraData++;
@@ -1367,7 +1371,8 @@ CoktelVideo::State Vmd::processFrame(uint16 frame) {
}
} else if ((part.type == kPartTypeVideo) && !_hasVideo) {
- warning("Vmd::processFrame(): Header claims there's no video, but video found");
+ warning("Vmd::processFrame(): Header claims there's no video, but video found (%d)", part.size);
+ _stream->skip(part.size);
} else if ((part.type == kPartTypeVideo) && _hasVideo) {
state.flags &= ~kStateNoVideoData;
@@ -1409,6 +1414,8 @@ CoktelVideo::State Vmd::processFrame(uint16 frame) {
// Unknown
_stream->skip(part.size);
} else if (part.type == kPartTypeSpeech) {
+ state.flags |= kStateSpeech;
+ state.speechId = part.id;
// Always triggers when speech starts
_stream->skip(part.size);
} else {
@@ -1863,14 +1870,14 @@ byte *Vmd::sound16bitADPCM(uint32 &size) {
int32 init = _stream->readSint16LE();
size -= 2;
- int32 v28 = _stream->readByte();
+ int32 index = _stream->readByte();
size--;
byte *data = new byte[size];
byte *sound = 0;
if (_stream->read(data, size) == size)
- sound = deADPCM(data, size, init, v28);
+ sound = deADPCM(data, size, init, index);
delete[] data;
diff --git a/graphics/video/coktelvideo/coktelvideo.h b/graphics/video/coktelvideo/coktelvideo.h
index 50fec4c787..6637b045ee 100644
--- a/graphics/video/coktelvideo/coktelvideo.h
+++ b/graphics/video/coktelvideo/coktelvideo.h
@@ -76,7 +76,9 @@ public:
/** Had to explicitely seek to the frame. */
kStateSeeked = 0x2000,
/** Reached a break-point. */
- kStateBreak = 0x8000
+ kStateBreak = 0x8000,
+ /** Frame marks the beginning of speech. */
+ kStateSpeech = 0x4000000
};
struct State {
@@ -90,8 +92,10 @@ public:
int16 bottom;
/** Set accordingly to what was done. */
uint32 flags;
+ /** The id of the spoken words. */
+ uint16 speechId;
- State() : left(0), top(0), right(0), bottom(0), flags(0) { }
+ State() : left(0), top(0), right(0), bottom(0), flags(0), speechId(0) { }
};
virtual ~CoktelVideo() { }
@@ -364,6 +368,7 @@ protected:
int16 top;
int16 right;
int16 bottom;
+ uint16 id;
byte flags;
} PACKED_STRUCT;