aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorEugene Sandulenko2019-12-30 13:43:23 +0100
committerEugene Sandulenko2019-12-30 13:43:23 +0100
commitd5b963a3b997067c874e6fb21445266bc4a1e766 (patch)
tree9f4e553e5dc26df98215619d2a50fa2aa1f6dd63 /engines
parent6810957e6db2e9f72170edbebfb11830fe519019 (diff)
downloadscummvm-rg350-d5b963a3b997067c874e6fb21445266bc4a1e766.tar.gz
scummvm-rg350-d5b963a3b997067c874e6fb21445266bc4a1e766.tar.bz2
scummvm-rg350-d5b963a3b997067c874e6fb21445266bc4a1e766.zip
DIRECTOR: Get rid of _castTypes[]
Diffstat (limited to 'engines')
-rw-r--r--engines/director/director.cpp7
-rw-r--r--engines/director/director.h2
-rw-r--r--engines/director/frame.cpp8
-rw-r--r--engines/director/lingo/lingo-the.cpp8
-rw-r--r--engines/director/score.cpp10
-rw-r--r--engines/director/score.h1
6 files changed, 8 insertions, 28 deletions
diff --git a/engines/director/director.cpp b/engines/director/director.cpp
index c914c0dd9f..7862fb0dfd 100644
--- a/engines/director/director.cpp
+++ b/engines/director/director.cpp
@@ -269,11 +269,4 @@ Common::HashMap<Common::String, Score *> *DirectorEngine::scanMovies(const Commo
return nameMap;
}
-Common::HashMap<int, CastType> *DirectorEngine::getSharedCastTypes() {
- if (_sharedScore)
- return &_sharedScore->_castTypes;
-
- return &_dummyCastType;
-}
-
} // End of namespace Director
diff --git a/engines/director/director.h b/engines/director/director.h
index b31eceb99a..4575df3fd5 100644
--- a/engines/director/director.h
+++ b/engines/director/director.h
@@ -119,7 +119,6 @@ public:
Common::HashMap<int, Common::SeekableSubReadStreamEndian *> *getSharedDIB() const { return _sharedDIB; }
Common::HashMap<int, Common::SeekableSubReadStreamEndian *> *getSharedBMP() const { return _sharedBMP; }
Common::HashMap<int, Common::SeekableSubReadStreamEndian *> *getSharedSTXT() const { return _sharedSTXT; }
- Common::HashMap<int, CastType> *getSharedCastTypes();
Common::HashMap<Common::String, Score *> *_movies;
@@ -171,7 +170,6 @@ private:
Graphics::MacPatterns _director3QuickDrawPatterns;
Common::String _sharedCastFile;
- Common::HashMap<int, CastType> _dummyCastType;
bool _draggingSprite;
uint16 _draggingSpriteId;
diff --git a/engines/director/frame.cpp b/engines/director/frame.cpp
index 0770f7656c..45c5f87780 100644
--- a/engines/director/frame.cpp
+++ b/engines/director/frame.cpp
@@ -604,16 +604,16 @@ void Frame::renderSprites(Graphics::ManagedSurface &surface, bool renderTrail) {
break;
}
} else {
- if (!_vm->getCurrentScore()->_castTypes.contains(_sprites[i]->_castId)) {
- if (!_vm->getSharedCastTypes()->contains(_sprites[i]->_castId)) {
+ if (!_vm->getCurrentScore()->_loadedCast->contains(_sprites[i]->_castId)) {
+ if (!_vm->getSharedScore()->_loadedCast->contains(_sprites[i]->_castId)) {
debugC(1, kDebugImages, "Frame::renderSprites(): Cast id %d not found", _sprites[i]->_castId);
continue;
} else {
debugC(1, kDebugImages, "Frame::renderSprites(): Getting cast id %d from shared cast", _sprites[i]->_castId);
- castType = _vm->getSharedCastTypes()->getVal(_sprites[i]->_castId);
+ castType = _vm->getSharedScore()->_loadedCast->getVal(_sprites[i]->_castId)->_type;
}
} else {
- castType = _vm->getCurrentScore()->_castTypes[_sprites[i]->_castId];
+ castType = _vm->getCurrentScore()->_loadedCast->getVal(_sprites[i]->_castId)->_type;
}
}
diff --git a/engines/director/lingo/lingo-the.cpp b/engines/director/lingo/lingo-the.cpp
index 09a9fc8a55..a1fa3e11e2 100644
--- a/engines/director/lingo/lingo-the.cpp
+++ b/engines/director/lingo/lingo-the.cpp
@@ -340,7 +340,7 @@ void Lingo::setTheSprite(Datum &id1, int field, Datum &d) {
switch (field) {
case kTheCastNum:
- if (_vm->getCurrentScore()->_castTypes.contains(d.u.i)) {
+ if (_vm->getCurrentScore()->_loadedCast->contains(d.u.i)) {
_vm->getCurrentScore()->loadCastInto(sprite, d.u.i);
sprite->_castId = d.u.i;
}
@@ -658,7 +658,7 @@ Datum Lingo::getTheCast(Datum &id1, int field) {
CastType castType;
CastInfo *castInfo;
- if (!_vm->getCurrentScore()->_castTypes.contains(id)) {
+ if (!_vm->getCurrentScore()->_loadedCast->contains(id)) {
if (field == kTheLoaded) {
d.type = INT;
d.u.i = 0;
@@ -669,7 +669,7 @@ Datum Lingo::getTheCast(Datum &id1, int field) {
warning("Lingo::getTheCast(): The cast %d found", id);
}
- castType = _vm->getCurrentScore()->_castTypes[id];
+ castType = _vm->getCurrentScore()->_loadedCast->getVal(id)->_type;
castInfo = _vm->getCurrentScore()->_castsInfo[id];
d.type = INT;
@@ -748,7 +748,7 @@ void Lingo::setTheCast(Datum &id1, int field, Datum &d) {
return;
}
- CastType castType = score->_castTypes[id];
+ CastType castType = score->_loadedCast->getVal(id)->_type;
CastInfo *castInfo = score->_castsInfo[id + score->_castIDoffset];
switch (field) {
diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index 10a13d8aaa..9e40f0f62a 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -566,22 +566,18 @@ void Score::loadCastDataVWCR(Common::SeekableSubReadStreamEndian &stream) {
debugC(3, kDebugLoading, "Score::loadCastDataVWCR(): CastTypes id: %d(%s) BitmapCast", id, numToCastNum(id));
// TODO: Work out the proper tag!
_loadedCast->setVal(id, new BitmapCast(stream, MKTAG('B', 'I', 'T', 'D'), _vm->getVersion()));
- _castTypes[id] = kCastBitmap;
break;
case kCastText:
debugC(3, kDebugLoading, "Score::loadCastDataVWCR(): CastTypes id: %d(%s) TextCast", id, numToCastNum(id));
_loadedCast->setVal(id, new TextCast(stream, _vm->getVersion()));
- _castTypes[id] = kCastText;
break;
case kCastShape:
debugC(3, kDebugLoading, "Score::loadCastDataVWCR(): CastTypes id: %d(%s) ShapeCast", id, numToCastNum(id));
_loadedCast->setVal(id, new ShapeCast(stream, _vm->getVersion()));
- _castTypes[id] = kCastShape;
break;
case kCastButton:
debugC(3, kDebugLoading, "Score::loadCastDataVWCR(): CastTypes id: %d(%s) ButtonCast", id, numToCastNum(id));
_loadedCast->setVal(id, new ButtonCast(stream, _vm->getVersion()));
- _castTypes[id] = kCastButton;
break;
default:
warning("Score::loadCastDataVWCR(): Unhandled cast id: %d(%s), type: %d, %d bytes", id, numToCastNum(id), castType, size);
@@ -673,31 +669,25 @@ void Score::loadCastData(Common::SeekableSubReadStreamEndian &stream, uint16 id,
switch (castType) {
case kCastBitmap:
_loadedCast->setVal(id, new BitmapCast(castStream, res->tag, _vm->getVersion()));
- _castTypes[id] = kCastBitmap;
debugC(3, kDebugLoading, "Score::loadCastData(): loaded kCastBitmap (%d)", res->children.size());
break;
case kCastText:
_loadedCast->setVal(id, new TextCast(castStream, _vm->getVersion()));
- _castTypes[id] = kCastText;
debugC(3, kDebugLoading, "Score::loadCastData(): loaded kCastText (%d)", res->children.size());
break;
case kCastShape:
_loadedCast->setVal(id, new ShapeCast(castStream, _vm->getVersion()));
- _castTypes[id] = kCastShape;
debugC(3, kDebugLoading, "Score::loadCastData(): loaded kCastShape (%d)", res->children.size());
break;
case kCastButton:
_loadedCast->setVal(id, new ButtonCast(castStream, _vm->getVersion()));
- _castTypes[id] = kCastButton;
debugC(3, kDebugLoading, "Score::loadCastData(): loaded kCastButton (%d)", res->children.size());
break;
case kCastLingoScript:
_loadedCast->setVal(id, new ScriptCast(castStream, _vm->getVersion()));
- _castTypes[id] = kCastLingoScript;
debugC(3, kDebugLoading, "Score::loadCastData(): loaded kCastLingoScript");
break;
case kCastRTE:
- _castTypes[id] = kCastRTE;
_loadedCast->setVal(id, new RTECast(castStream, _vm->getVersion()));
debugC(3, kDebugLoading, "Score::loadCastData(): loaded kCastRTE (%d)", res->children.size());
break;
diff --git a/engines/director/score.h b/engines/director/score.h
index aeda616729..ef7244bf97 100644
--- a/engines/director/score.h
+++ b/engines/director/score.h
@@ -122,7 +122,6 @@ private:
public:
Common::Array<Frame *> _frames;
- Common::HashMap<int, CastType> _castTypes;
Common::HashMap<uint16, CastInfo *> _castsInfo;
Common::HashMap<Common::String, int> _castsNames;
Common::SortedArray<Label *> *_labels;