aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorDmitry Iskrich2016-06-27 21:11:26 +0300
committerEugene Sandulenko2016-08-03 23:40:36 +0200
commit825a9fb29f39226a6be0f66ed0253ebafa8b143f (patch)
treea884111154ca790088f092c152c56e5129e748ad /engines
parent840487d2ef1aa50748e526bd70dc2b7a3677d7eb (diff)
downloadscummvm-rg350-825a9fb29f39226a6be0f66ed0253ebafa8b143f.tar.gz
scummvm-rg350-825a9fb29f39226a6be0f66ed0253ebafa8b143f.tar.bz2
scummvm-rg350-825a9fb29f39226a6be0f66ed0253ebafa8b143f.zip
DIRECTOR: Load shared casts in engine
Diffstat (limited to 'engines')
-rw-r--r--engines/director/director.cpp14
-rw-r--r--engines/director/director.h5
-rw-r--r--engines/director/score.cpp3
-rw-r--r--engines/director/score.h3
4 files changed, 20 insertions, 5 deletions
diff --git a/engines/director/director.cpp b/engines/director/director.cpp
index cb31f88aa0..2c8441d1d9 100644
--- a/engines/director/director.cpp
+++ b/engines/director/director.cpp
@@ -56,6 +56,7 @@ DirectorEngine::DirectorEngine(OSystem *syst, const DirectorGameDescription *gam
_mainArchive = 0;
_macBinary = 0;
_currentPalette = 0;
+
_movies = new Common::HashMap<Common::String, Score *>();
const Common::FSNode gameDataDir(ConfMan.get("path"));
SearchMan.addSubDirectoryMatching(gameDataDir, "data");
@@ -370,4 +371,17 @@ void DirectorEngine::setPalette(byte *palette, uint16 count) {
_currentPaletteLength = count;
}
+Common::HashMap<int, Cast *> DirectorEngine::loadSharedCastsFrom(Common::String filename) {
+
+ //TODO d4 arch
+ RIFFArchive *shardcst = new RIFFArchive();
+ shardcst->openFile(filename);
+
+ Score *castScore = new Score(this);
+
+ Common::SeekableSubReadStreamEndian *castStream = shardcst->getResource(MKTAG('V','W','C','R'), 1024);
+
+ castScore->loadCastData(*castStream);
+ return castScore->_casts;
+}
} // End of namespace Director
diff --git a/engines/director/director.h b/engines/director/director.h
index 74dc651ef7..87190640b1 100644
--- a/engines/director/director.h
+++ b/engines/director/director.h
@@ -44,7 +44,7 @@ class Archive;
struct DirectorGameDescription;
class Lingo;
class Score;
-
+class Cast;
class DirectorEngine : public ::Engine {
public:
@@ -66,9 +66,12 @@ public:
bool hasFeature(EngineFeature f) const;
const byte *getPalette() const { return _currentPalette; }
uint16 getPaletteColorCount() const { return _currentPaletteLength; }
+ Common::HashMap<int, Cast *> loadSharedCastsFrom(Common::String filename);
+
Common::HashMap<Common::String, Score *> *_movies;
Score *_currentScore;
+
protected:
virtual Common::Error run();
diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index 5b05ed67fe..285577d478 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -67,7 +67,6 @@ void Score::loadArchive() {
if (clutList.size() == 0)
error("CLUT not found");
-
Common::SeekableSubReadStreamEndian *pal = _movieArchive->getResource(MKTAG('C', 'L', 'U', 'T'), clutList[0]);
loadPalette(*pal);
@@ -194,7 +193,6 @@ void Score::readVersion(uint32 rid) {
void Score::loadCastData(Common::SeekableSubReadStreamEndian &stream) {
for (uint16 id = _castArrayStart; id <= _castArrayEnd; id++) {
byte size = stream.readByte();
-
if (size == 0)
continue;
@@ -441,6 +439,7 @@ void Score::goToNext() {
//the playback head goes to frame 1, (Director frame array start from 1, engine from 0)
_currentFrame = 0;
}
+
void Score::goToPrevious() {
//One label
if (_labels.begin() == _labels.end()) {
diff --git a/engines/director/score.h b/engines/director/score.h
index 9aeb66e114..592201ed97 100644
--- a/engines/director/score.h
+++ b/engines/director/score.h
@@ -341,14 +341,13 @@ public:
void startLoop();
void processEvents();
Archive *getArchive() const { return _movieArchive; };
-
+ void loadCastData(Common::SeekableSubReadStreamEndian &stream);
Common::String getMacName() const { return _macName; }
private:
void update();
void readVersion(uint32 rid);
void loadConfig(Common::SeekableSubReadStreamEndian &stream);
void loadPalette(Common::SeekableSubReadStreamEndian &stream);
- void loadCastData(Common::SeekableSubReadStreamEndian &stream);
void loadFrames(Common::SeekableSubReadStreamEndian &stream);
void loadLabels(Common::SeekableSubReadStreamEndian &stream);
void loadActions(Common::SeekableSubReadStreamEndian &stream);