[Scummvm-cvs-logs] SF.net SVN: scummvm:[42705] scummvm/trunk
drmccoy at users.sourceforge.net
drmccoy at users.sourceforge.net
Fri Jul 24 23:31:00 CEST 2009
Revision: 42705
http://scummvm.svn.sourceforge.net/scummvm/?rev=42705&view=rev
Author: drmccoy
Date: 2009-07-24 21:31:00 +0000 (Fri, 24 Jul 2009)
Log Message:
-----------
Adding subtitle support to Woodruff
Modified Paths:
--------------
scummvm/trunk/engines/gob/detection.cpp
scummvm/trunk/engines/gob/draw.h
scummvm/trunk/engines/gob/draw_v2.cpp
scummvm/trunk/engines/gob/gob.cpp
scummvm/trunk/engines/gob/gob.h
scummvm/trunk/engines/gob/scenery.cpp
scummvm/trunk/engines/gob/videoplayer.cpp
scummvm/trunk/graphics/video/coktelvideo/coktelvideo.cpp
scummvm/trunk/graphics/video/coktelvideo/coktelvideo.h
Modified: scummvm/trunk/engines/gob/detection.cpp
===================================================================
--- scummvm/trunk/engines/gob/detection.cpp 2009-07-24 21:29:41 UTC (rev 42704)
+++ scummvm/trunk/engines/gob/detection.cpp 2009-07-24 21:31:00 UTC (rev 42705)
@@ -2750,7 +2750,7 @@
EN_GRB,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSUBTITLES | GUIO_NOSPEECH
+ GUIO_NOSPEECH
},
kGameTypeWoodruff,
kFeatures640,
@@ -2764,7 +2764,7 @@
DE_DEU,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSUBTITLES | GUIO_NOSPEECH
+ GUIO_NOSPEECH
},
kGameTypeWoodruff,
kFeatures640,
@@ -2778,7 +2778,7 @@
FR_FRA,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSUBTITLES | GUIO_NOSPEECH
+ GUIO_NOSPEECH
},
kGameTypeWoodruff,
kFeatures640,
@@ -2792,7 +2792,7 @@
IT_ITA,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSUBTITLES | GUIO_NOSPEECH
+ GUIO_NOSPEECH
},
kGameTypeWoodruff,
kFeatures640,
@@ -2806,7 +2806,7 @@
ES_ESP,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSUBTITLES | GUIO_NOSPEECH
+ GUIO_NOSPEECH
},
kGameTypeWoodruff,
kFeatures640,
@@ -2820,7 +2820,7 @@
EN_GRB,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSUBTITLES | GUIO_NOSPEECH
+ GUIO_NOSPEECH
},
kGameTypeWoodruff,
kFeatures640,
@@ -2834,7 +2834,7 @@
DE_DEU,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSUBTITLES | GUIO_NOSPEECH
+ GUIO_NOSPEECH
},
kGameTypeWoodruff,
kFeatures640,
@@ -2848,7 +2848,7 @@
FR_FRA,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSUBTITLES | GUIO_NOSPEECH
+ GUIO_NOSPEECH
},
kGameTypeWoodruff,
kFeatures640,
@@ -2862,7 +2862,7 @@
IT_ITA,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSUBTITLES | GUIO_NOSPEECH
+ GUIO_NOSPEECH
},
kGameTypeWoodruff,
kFeatures640,
@@ -2876,7 +2876,7 @@
ES_ESP,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSUBTITLES | GUIO_NOSPEECH
+ GUIO_NOSPEECH
},
kGameTypeWoodruff,
kFeatures640,
@@ -2890,7 +2890,7 @@
DE_DEU,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSUBTITLES | GUIO_NOSPEECH
+ GUIO_NOSPEECH
},
kGameTypeWoodruff,
kFeatures640,
@@ -2904,7 +2904,7 @@
ES_ESP,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSUBTITLES | GUIO_NOSPEECH
+ GUIO_NOSPEECH
},
kGameTypeWoodruff,
kFeatures640,
@@ -2918,7 +2918,7 @@
EN_GRB,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSUBTITLES | GUIO_NOSPEECH
+ GUIO_NOSPEECH
},
kGameTypeWoodruff,
kFeatures640,
@@ -2932,7 +2932,7 @@
DE_DEU,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSUBTITLES | GUIO_NOSPEECH
+ GUIO_NOSPEECH
},
kGameTypeWoodruff,
kFeatures640,
@@ -2946,7 +2946,7 @@
FR_FRA,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSUBTITLES | GUIO_NOSPEECH
+ GUIO_NOSPEECH
},
kGameTypeWoodruff,
kFeatures640,
@@ -2960,7 +2960,7 @@
IT_ITA,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSUBTITLES | GUIO_NOSPEECH
+ GUIO_NOSPEECH
},
kGameTypeWoodruff,
kFeatures640,
@@ -2974,7 +2974,7 @@
IT_ITA,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSUBTITLES | GUIO_NOSPEECH
+ GUIO_NOSPEECH
},
kGameTypeWoodruff,
kFeatures640,
@@ -2988,7 +2988,7 @@
DE_DEU,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSUBTITLES | GUIO_NOSPEECH
+ GUIO_NOSPEECH
},
kGameTypeWoodruff,
kFeatures640,
@@ -3002,7 +3002,7 @@
FR_FRA,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSUBTITLES | GUIO_NOSPEECH
+ GUIO_NOSPEECH
},
kGameTypeWoodruff,
kFeatures640,
@@ -3016,7 +3016,7 @@
EN_GRB,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSUBTITLES | GUIO_NOSPEECH
+ GUIO_NOSPEECH
},
kGameTypeWoodruff,
kFeatures640,
@@ -3030,7 +3030,7 @@
DE_DEU,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSUBTITLES | GUIO_NOSPEECH
+ GUIO_NOSPEECH
},
kGameTypeWoodruff,
kFeatures640,
@@ -3044,7 +3044,7 @@
FR_FRA,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSUBTITLES | GUIO_NOSPEECH
+ GUIO_NOSPEECH
},
kGameTypeWoodruff,
kFeatures640,
@@ -3058,7 +3058,7 @@
IT_ITA,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSUBTITLES | GUIO_NOSPEECH
+ GUIO_NOSPEECH
},
kGameTypeWoodruff,
kFeatures640,
@@ -3072,7 +3072,7 @@
ES_ESP,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSUBTITLES | GUIO_NOSPEECH
+ GUIO_NOSPEECH
},
kGameTypeWoodruff,
kFeatures640,
@@ -3086,7 +3086,7 @@
PL_POL,
kPlatformPC,
ADGF_NO_FLAGS,
- GUIO_NOSUBTITLES | GUIO_NOSPEECH
+ GUIO_NOSPEECH
},
kGameTypeWoodruff,
kFeatures640,
Modified: scummvm/trunk/engines/gob/draw.h
===================================================================
--- scummvm/trunk/engines/gob/draw.h 2009-07-24 21:29:41 UTC (rev 42704)
+++ scummvm/trunk/engines/gob/draw.h 2009-07-24 21:31:00 UTC (rev 42705)
@@ -39,7 +39,7 @@
#define RENDERFLAG_USEDELTAS 0x0010
#define RENDERFLAG_UNKNOWN 0x0080
#define RENDERFLAG_NOBLITINVALIDATED 0x0200
-#define RENDERFLAG_SKIPOPTIONALTEXT 0x0400
+#define RENDERFLAG_NOSUBTITLES 0x0400
#define RENDERFLAG_FROMSPLIT 0x0800
#define RENDERFLAG_DOUBLECOORDS 0x1000
Modified: scummvm/trunk/engines/gob/draw_v2.cpp
===================================================================
--- scummvm/trunk/engines/gob/draw_v2.cpp 2009-07-24 21:29:41 UTC (rev 42704)
+++ scummvm/trunk/engines/gob/draw_v2.cpp 2009-07-24 21:31:00 UTC (rev 42705)
@@ -216,7 +216,7 @@
dataPtr = textItem->getData();
ptr = dataPtr;
- if ((_renderFlags & RENDERFLAG_SKIPOPTIONALTEXT) && (ptr[1] & 0x80)) {
+ if ((ptr[1] & 0x80) && !_vm->subtitles()) {
delete textItem;
return;
}
@@ -449,6 +449,10 @@
ptr++;
offX = destX + (int16)READ_LE_UINT16(ptr);
offY = destY + (int16)READ_LE_UINT16(ptr + 2);
+ if (_renderFlags & RENDERFLAG_DOUBLECOORDS) {
+ offX += (int16)READ_LE_UINT16(ptr);
+ offY += (int16)READ_LE_UINT16(ptr + 2);
+ }
ptr += 4;
break;
Modified: scummvm/trunk/engines/gob/gob.cpp
===================================================================
--- scummvm/trunk/engines/gob/gob.cpp 2009-07-24 21:29:41 UTC (rev 42704)
+++ scummvm/trunk/engines/gob/gob.cpp 2009-07-24 21:31:00 UTC (rev 42705)
@@ -213,6 +213,10 @@
return (isSCNDemo() || isBATDemo());
}
+bool GobEngine::subtitles() const {
+ return ConfMan.getBool("subtitles");
+}
+
Common::Error GobEngine::run() {
if (!initGameParts()) {
GUIErrorMessage("GobEngine::init(): Unknown version of game engine");
Modified: scummvm/trunk/engines/gob/gob.h
===================================================================
--- scummvm/trunk/engines/gob/gob.h 2009-07-24 21:29:41 UTC (rev 42704)
+++ scummvm/trunk/engines/gob/gob.h 2009-07-24 21:31:00 UTC (rev 42705)
@@ -221,6 +221,8 @@
bool is800x600() const;
bool isDemo() const;
+ bool subtitles() const;
+
GobEngine(OSystem *syst);
virtual ~GobEngine();
Modified: scummvm/trunk/engines/gob/scenery.cpp
===================================================================
--- scummvm/trunk/engines/gob/scenery.cpp 2009-07-24 21:29:41 UTC (rev 42704)
+++ scummvm/trunk/engines/gob/scenery.cpp 2009-07-24 21:31:00 UTC (rev 42705)
@@ -632,6 +632,11 @@
_vm->_vidPlayer->slotPlay(obj.videoSlot - 1);
}
+ // Subtitle
+ Graphics::CoktelVideo::State state = _vm->_vidPlayer->getState(obj.videoSlot - 1);
+ if (state.flags & Graphics::CoktelVideo::kStateSpeech)
+ _vm->_draw->printTotText(state.speechId);
+
destX = 0;
destY = 0;
left = *(obj.pPosX);
Modified: scummvm/trunk/engines/gob/videoplayer.cpp
===================================================================
--- scummvm/trunk/engines/gob/videoplayer.cpp 2009-07-24 21:29:41 UTC (rev 42704)
+++ scummvm/trunk/engines/gob/videoplayer.cpp 2009-07-24 21:31:00 UTC (rev 42705)
@@ -711,6 +711,9 @@
_vm->_video->retrace();
}
+ // Subtitle
+ if (state.flags & Graphics::CoktelVideo::kStateSpeech)
+ _vm->_draw->printTotText(state.speechId);
if (modifiedPal && ((palCmd == 2) || (palCmd == 4)))
_vm->_palAnim->fade(_vm->_global->_pPaletteDesc, -2, 0);
Modified: scummvm/trunk/graphics/video/coktelvideo/coktelvideo.cpp
===================================================================
--- scummvm/trunk/graphics/video/coktelvideo/coktelvideo.cpp 2009-07-24 21:29:41 UTC (rev 42704)
+++ scummvm/trunk/graphics/video/coktelvideo/coktelvideo.cpp 2009-07-24 21:31:00 UTC (rev 42705)
@@ -1114,6 +1114,10 @@
_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 @@
}
} 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 @@
// 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 @@
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;
Modified: scummvm/trunk/graphics/video/coktelvideo/coktelvideo.h
===================================================================
--- scummvm/trunk/graphics/video/coktelvideo/coktelvideo.h 2009-07-24 21:29:41 UTC (rev 42704)
+++ scummvm/trunk/graphics/video/coktelvideo/coktelvideo.h 2009-07-24 21:31:00 UTC (rev 42705)
@@ -76,7 +76,9 @@
/** 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 @@
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 @@
int16 top;
int16 right;
int16 bottom;
+ uint16 id;
byte flags;
} PACKED_STRUCT;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list