DIRECTOR: Move humanVersion to util.cpp

This commit is contained in:
djsrv 2021-06-07 13:02:07 -04:00
parent d6b6cc6f18
commit d91e3d5148
3 changed files with 34 additions and 32 deletions

View File

@ -363,38 +363,6 @@ bool Cast::loadArchive() {
return true;
}
uint16 humanVersion(uint16 ver) {
if (ver >= kFileVer1201)
return 1201;
if (ver >= kFileVer1200)
return 1200;
if (ver >= kFileVer1150)
return 1150;
if (ver >= kFileVer1100)
return 1100;
if (ver >= kFileVer1000)
return 1000;
if (ver >= kFileVer850)
return 850;
if (ver >= kFileVer800)
return 800;
if (ver >= kFileVer700)
return 700;
if (ver >= kFileVer600)
return 600;
if (ver >= kFileVer500)
return 500;
if (ver >= kFileVer404)
return 404;
if (ver >= kFileVer400)
return 400;
if (ver >= kFileVer310)
return 310;
if (ver >= kFileVer300)
return 300;
return 200;
}
void Cast::loadConfig(Common::SeekableReadStreamEndian &stream) {
debugC(1, kDebugLoading, "****** Loading Config VWCF");

View File

@ -693,4 +693,36 @@ Common::SeekableReadStreamEndian *readZlibData(Common::SeekableReadStream &strea
# endif
}
uint16 humanVersion(uint16 ver) {
if (ver >= kFileVer1201)
return 1201;
if (ver >= kFileVer1200)
return 1200;
if (ver >= kFileVer1150)
return 1150;
if (ver >= kFileVer1100)
return 1100;
if (ver >= kFileVer1000)
return 1000;
if (ver >= kFileVer850)
return 850;
if (ver >= kFileVer800)
return 800;
if (ver >= kFileVer700)
return 700;
if (ver >= kFileVer600)
return 600;
if (ver >= kFileVer500)
return 500;
if (ver >= kFileVer404)
return 404;
if (ver >= kFileVer400)
return 400;
if (ver >= kFileVer310)
return 310;
if (ver >= kFileVer300)
return 300;
return 200;
}
} // End of namespace Director

View File

@ -80,6 +80,8 @@ uint32 readVarInt(Common::SeekableReadStream &stream);
Common::SeekableReadStreamEndian *readZlibData(Common::SeekableReadStream &stream, unsigned long len, unsigned long *outLen, bool bigEndian);
uint16 humanVersion(uint16 ver);
} // End of namespace Director
#endif