DIRECTOR: LINGO: Implement allow outdated lingo

This commit is contained in:
djsrv 2020-07-15 23:30:12 -04:00
parent a892bb58d1
commit f71670e8d9
5 changed files with 15 additions and 2 deletions

View File

@ -419,7 +419,7 @@ void LC::c_varpush() {
}
// Looking for the cast member constants
if (g_director->getVersion() < 4) { // TODO: There could be a flag 'Allow Outdated Lingo' in Movie Info in D4
if (g_director->getVersion() < 4 || g_director->getCurrentMovie()->_allowOutdatedLingo) {
int val = castNumToNum(name.c_str());
if (val != -1) {

View File

@ -21,6 +21,7 @@
*/
#include "director/director.h"
#include "director/movie.h"
#include "director/lingo/lingo.h"
namespace Director {
@ -224,7 +225,7 @@ Common::String Lingo::codePreprocessor(const char *s, ScriptType type, uint16 id
}
debugC(2, kDebugParse | kDebugPreprocess, "line: %d '%s'", iflevel, line.c_str());
if (type == kMovieScript && _vm->getVersion() <= 3 && !defFound) {
if (!defFound && type == kMovieScript && (_vm->getVersion() <= 3 || _vm->getCurrentMovie()->_allowOutdatedLingo)) {
tok = nexttok(line.c_str());
if (tok.equals("macro") || tok.equals("factory") || tok.equals("on")) {
defFound = true;

View File

@ -52,6 +52,8 @@ Movie::Movie(Stage *stage) {
_lastRollTime = _lastEventTime;
_lastTimerReset = _lastEventTime;
_allowOutdatedLingo = false;
_movieArchive = nullptr;
_cast = new Cast(this);
@ -190,6 +192,9 @@ void Movie::loadFileInfo(Common::SeekableSubReadStreamEndian &stream) {
debugC(2, kDebugLoading, "****** Loading FileInfo VWFI");
InfoEntries fileInfo = Movie::loadInfoEntries(stream);
_allowOutdatedLingo = (fileInfo.flags & kMovieFlagAllowOutdatedLingo) != 0;
_script = fileInfo.strings[0].readString(false);
if (!_script.empty() && ConfMan.getBool("dump_scripts"))
@ -212,6 +217,8 @@ void Movie::loadFileInfo(Common::SeekableSubReadStreamEndian &stream) {
}
if (debugChannelSet(3, kDebugLoading)) {
debug("VWFI: flags: %d", fileInfo.flags);
debug("VWFI: allow outdated lingo: %d", _allowOutdatedLingo);
debug("VWFI: script: '%s'", _script.c_str());
debug("VWFI: changed by: '%s'", _changedBy.c_str());
debug("VWFI: created by: '%s'", _createdBy.c_str());

View File

@ -126,6 +126,7 @@ public:
uint32 _lastTimerReset;
uint16 _stageColor;
Cast *_sharedCast;
bool _allowOutdatedLingo;
private:
Stage *_stage;

View File

@ -25,6 +25,10 @@
namespace Director {
enum MovieFlag {
kMovieFlagAllowOutdatedLingo = (1 << 8)
};
enum CastType {
kCastTypeNull = 0,
kCastBitmap = 1,