DIRECTOR: Remove getCastMemberByScriptId from Movie

This can be called on the correct cast directly.
This commit is contained in:
djsrv 2021-06-30 12:05:19 -04:00
parent b3a09db38b
commit 2d5ca7a1d6
3 changed files with 2 additions and 11 deletions

View File

@ -965,14 +965,14 @@ ScriptContext *LingoCompiler::compileLingoV4(Common::SeekableReadStreamEndian &s
// initialise the script
ScriptType scriptType = kCastScript;
Common::String castName;
CastMember *member = g_director->getCurrentMovie()->getCastMemberByScriptId(scriptId);
CastMember *member = archive->cast->getCastMemberByScriptId(scriptId);
int castId;
if (member) {
if (member->_type == kCastLingoScript)
scriptType = ((ScriptCastMember *)member)->_scriptType;
castId = member->getID();
CastMemberInfo *info = g_director->getCurrentMovie()->getCastMemberInfo(castId);
CastMemberInfo *info = member->getInfo();
if (info)
castName = info->name;
} else {

View File

@ -312,14 +312,6 @@ CastMember *Movie::getCastMemberByName(const Common::String &name) {
return result;
}
CastMember *Movie::getCastMemberByScriptId(int scriptId) {
CastMember *result = _cast->getCastMemberByScriptId(scriptId);
if (result == nullptr && _sharedCast) {
result = _sharedCast->getCastMemberByScriptId(scriptId);
}
return result;
}
CastMemberInfo *Movie::getCastMemberInfo(int castId) {
CastMemberInfo *result = _cast->getCastMemberInfo(castId);
if (result == nullptr && _sharedCast) {

View File

@ -119,7 +119,6 @@ public:
CastMember *getCastMember(int castId);
CastMember *getCastMemberByName(const Common::String &name);
CastMember *getCastMemberByScriptId(int scriptId);
CastMemberInfo *getCastMemberInfo(int castId);
const Stxt *getStxt(int castId);