mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-03 09:23:37 +00:00
Split readResTypeList into a normal and a GF_OLD_BUNDLE version; added comments to many of the GF_ feature flags; removed GF_DRAWOBJ_OTHER_ORDER (it was only use by Sam&Max, I switched that to a direct check for Sam&Max)
svn-id: r17362
This commit is contained in:
parent
eda317924e
commit
1419f0d5ef
@ -215,6 +215,7 @@ public:
|
||||
ScummEngine_v3old(GameDetector *detector, OSystem *syst, const ScummGameSettings &gs, uint8 md5sum[16]);
|
||||
|
||||
protected:
|
||||
void readResTypeList(int id, uint32 tag, const char *name);
|
||||
void readIndexFile();
|
||||
void initRoomSubBlocks();
|
||||
void loadRoomObjects();
|
||||
|
@ -400,7 +400,8 @@ void ScummEngine::drawRoomObjects(int arg) {
|
||||
int i;
|
||||
const int mask = (_version <= 2) ? 0x8 : 0xF;
|
||||
|
||||
if (_features & GF_DRAWOBJ_OTHER_ORDER) {
|
||||
if (_gameId == GID_SAMNMAX) {
|
||||
// In Sam & Max, objects are drawn in reverse order.
|
||||
for (i = 1; i < _numLocalObjects; i++)
|
||||
if (_objs[i].obj_nr > 0)
|
||||
drawRoomObject(i, arg);
|
||||
|
@ -34,8 +34,9 @@
|
||||
|
||||
namespace Scumm {
|
||||
|
||||
extern const char *resTypeFromId(int id);
|
||||
|
||||
static uint16 newTag2Old(uint32 newTag);
|
||||
static const char *resTypeFromId(int id);
|
||||
static const byte *findResourceSmall(uint32 tag, const byte *searchin);
|
||||
|
||||
|
||||
@ -520,37 +521,14 @@ void ScummEngine::readResTypeList(int id, uint32 tag, const char *name) {
|
||||
|
||||
if (_version == 8)
|
||||
num = _fileHandle->readUint32LE();
|
||||
else if (!(_features & GF_OLD_BUNDLE))
|
||||
num = _fileHandle->readUint16LE();
|
||||
else
|
||||
num = _fileHandle->readByte();
|
||||
num = _fileHandle->readUint16LE();
|
||||
|
||||
if (_features & GF_OLD_BUNDLE) {
|
||||
if (num >= 0xFF) {
|
||||
error("Too many %ss (%d) in directory", name, num);
|
||||
}
|
||||
} else {
|
||||
if (num != res.num[id]) {
|
||||
error("Invalid number of %ss (%d) in directory", name, num);
|
||||
}
|
||||
if (num != res.num[id]) {
|
||||
error("Invalid number of %ss (%d) in directory", name, num);
|
||||
}
|
||||
|
||||
if (_features & GF_OLD_BUNDLE) {
|
||||
if (id == rtRoom) {
|
||||
for (i = 0; i < num; i++)
|
||||
res.roomno[id][i] = i;
|
||||
_fileHandle->seek(num, SEEK_CUR);
|
||||
} else {
|
||||
for (i = 0; i < num; i++)
|
||||
res.roomno[id][i] = _fileHandle->readByte();
|
||||
}
|
||||
for (i = 0; i < num; i++) {
|
||||
res.roomoffs[id][i] = _fileHandle->readUint16LE();
|
||||
if (res.roomoffs[id][i] == 0xFFFF)
|
||||
res.roomoffs[id][i] = 0xFFFFFFFF;
|
||||
}
|
||||
|
||||
} else if (_features & GF_SMALL_HEADER) {
|
||||
if (_features & GF_SMALL_HEADER) {
|
||||
for (i = 0; i < num; i++) {
|
||||
res.roomno[id][i] = _fileHandle->readByte();
|
||||
res.roomoffs[id][i] = _fileHandle->readUint32LE();
|
||||
|
@ -26,6 +26,36 @@
|
||||
|
||||
namespace Scumm {
|
||||
|
||||
extern const char *resTypeFromId(int id);
|
||||
|
||||
|
||||
void ScummEngine_v3old::readResTypeList(int id, uint32 tag, const char *name) {
|
||||
int num;
|
||||
int i;
|
||||
|
||||
debug(9, "readResTypeList(%s,%s,%s)", resTypeFromId(id), tag2str(TO_BE_32(tag)), name);
|
||||
|
||||
num = _fileHandle->readByte();
|
||||
|
||||
if (num >= 0xFF) {
|
||||
error("Too many %ss (%d) in directory", name, num);
|
||||
}
|
||||
|
||||
if (id == rtRoom) {
|
||||
for (i = 0; i < num; i++)
|
||||
res.roomno[id][i] = i;
|
||||
_fileHandle->seek(num, SEEK_CUR);
|
||||
} else {
|
||||
for (i = 0; i < num; i++)
|
||||
res.roomno[id][i] = _fileHandle->readByte();
|
||||
}
|
||||
for (i = 0; i < num; i++) {
|
||||
res.roomoffs[id][i] = _fileHandle->readUint16LE();
|
||||
if (res.roomoffs[id][i] == 0xFFFF)
|
||||
res.roomoffs[id][i] = 0xFFFFFFFF;
|
||||
}
|
||||
}
|
||||
|
||||
void ScummEngine_v3old::readIndexFile() {
|
||||
int magic = 0;
|
||||
debug(9, "readIndexFile()");
|
||||
|
@ -168,19 +168,19 @@ static const ScummGameSettings scumm_settings[] = {
|
||||
GF_NEW_OPCODES | GF_USE_KEY, 0, 0},
|
||||
|
||||
{"samnmax", "Sam & Max", GID_SAMNMAX, 6, 0, 30, /*MDT_PCSPK |*/ MDT_ADLIB | MDT_NATIVE,
|
||||
GF_NEW_OPCODES | GF_USE_KEY | GF_DRAWOBJ_OTHER_ORDER, 0, 0},
|
||||
GF_NEW_OPCODES | GF_USE_KEY, 0, 0},
|
||||
{"samnmax-alt", "Sam & Max (alt)", GID_SAMNMAX, 6, 0, 30, /*MDT_PCSPK |*/ MDT_ADLIB | MDT_NATIVE,
|
||||
GF_NEW_OPCODES | GF_USE_KEY | GF_DRAWOBJ_OTHER_ORDER, "samnmax", "samnmax.sm0"},
|
||||
GF_NEW_OPCODES | GF_USE_KEY, "samnmax", "samnmax.sm0"},
|
||||
{"samnmaxMac", "Sam & Max (Mac)", GID_SAMNMAX, 6, 0, 30, /*MDT_PCSPK |*/ MDT_ADLIB | MDT_NATIVE,
|
||||
GF_NEW_OPCODES | GF_USE_KEY | GF_DRAWOBJ_OTHER_ORDER, "samnmax", "Sam & Max Data"},
|
||||
GF_NEW_OPCODES | GF_USE_KEY, "samnmax", "Sam & Max Data"},
|
||||
{"samdemo", "Sam & Max (Demo)", GID_SAMNMAX, 6, 0, 30, /*MDT_PCSPK |*/ MDT_ADLIB | MDT_NATIVE,
|
||||
GF_NEW_OPCODES | GF_USE_KEY | GF_DRAWOBJ_OTHER_ORDER, 0, 0},
|
||||
GF_NEW_OPCODES | GF_USE_KEY, 0, 0},
|
||||
{"samdemoMac", "Sam & Max (Mac Demo)", GID_SAMNMAX, 6, 0, 30, /*MDT_PCSPK |*/ MDT_ADLIB | MDT_NATIVE,
|
||||
GF_NEW_OPCODES | GF_USE_KEY | GF_DRAWOBJ_OTHER_ORDER, "samdemo", "Sam & Max Demo Data"},
|
||||
GF_NEW_OPCODES | GF_USE_KEY, "samdemo", "Sam & Max Demo Data"},
|
||||
{"snmdemo", "Sam & Max (Demo)", GID_SAMNMAX, 6, 0, 30, /*MDT_PCSPK |*/ MDT_ADLIB | MDT_NATIVE,
|
||||
GF_NEW_OPCODES | GF_USE_KEY | GF_DRAWOBJ_OTHER_ORDER, 0, "snmdemo.sm0"},
|
||||
GF_NEW_OPCODES | GF_USE_KEY, 0, "snmdemo.sm0"},
|
||||
{"snmidemo", "Sam & Max (Interactive WIP Demo)", GID_SAMNMAX, 6, 0, 30, /*MDT_PCSPK |*/ MDT_ADLIB | MDT_NATIVE,
|
||||
GF_NEW_OPCODES | GF_USE_KEY | GF_DRAWOBJ_OTHER_ORDER, 0, 0},
|
||||
GF_NEW_OPCODES | GF_USE_KEY, 0, 0},
|
||||
|
||||
// {"test", "Test demo game", GID_SAMNMAX, 6, 0, /*MDT_PCSPK |*/ MDT_ADLIB | MDT_NATIVE, GF_NEW_OPCODES, 0, 0},
|
||||
|
||||
|
@ -72,22 +72,55 @@ enum {
|
||||
KEY_ALL_SKIP = 3457 // WinCE
|
||||
};
|
||||
|
||||
/** SCUMM feature flags. */
|
||||
/**
|
||||
* SCUMM feature flags define for every game which specific set of engine
|
||||
* features are used by that game.
|
||||
* Note that some of them could be replaced by checks for the SCUMM version.
|
||||
*/
|
||||
enum GameFeatures {
|
||||
/** Games with the new stack based opcodes (ScummEngine_v6 and subclasses). */
|
||||
GF_NEW_OPCODES = 1 << 0,
|
||||
|
||||
/** Games with the new camera system (ScummEngine_v7 and subclasses). */
|
||||
GF_NEW_CAMERA = 1 << 1,
|
||||
|
||||
/** Games with the AKOS custome system (ScummEngine_v7 and subclasses, HE games). */
|
||||
GF_NEW_COSTUMES = 1 << 2,
|
||||
|
||||
/** Games with digital IMUSE (ScummEngine_v7 and subclasses). */
|
||||
GF_DIGI_IMUSE = 1 << 3,
|
||||
|
||||
/** Games using XOR encrypted data files. */
|
||||
GF_USE_KEY = 1 << 4,
|
||||
GF_DRAWOBJ_OTHER_ORDER = 1 << 5,
|
||||
|
||||
/** Small header games (ScummEngine_v4 and subclasses). */
|
||||
GF_SMALL_HEADER = 1 << 6,
|
||||
|
||||
/** Small name games (ScummEngine_v3 and subclasses). */
|
||||
GF_SMALL_NAMES = 1 << 7,
|
||||
|
||||
/** Old bundle games (ScummEngine_v3old and subclasses). */
|
||||
GF_OLD_BUNDLE = 1 << 8,
|
||||
|
||||
/** EGA games. */
|
||||
GF_16COLOR = 1 << 9,
|
||||
|
||||
/** VGA versions of V3 games. */
|
||||
GF_OLD256 = 1 << 10,
|
||||
|
||||
/** Games which have Audio CD tracks. */
|
||||
GF_AUDIOTRACKS = 1 << 11,
|
||||
|
||||
/** Games without actor scaling (ScummEngine_v3 and subclasses). */
|
||||
GF_NO_SCALING = 1 << 12,
|
||||
|
||||
/**
|
||||
* Games using only very few local variables in scripts.
|
||||
* Apparently that is only the case for 256 color version of Indy3.
|
||||
*/
|
||||
GF_FEW_LOCALS = 1 << 13,
|
||||
|
||||
/** Games made by Humongous Entertainment. */
|
||||
GF_HUMONGOUS = 1 << 14,
|
||||
GF_MULTIPLE_VERSIONS = 1 << 15,
|
||||
|
||||
@ -668,7 +701,7 @@ protected:
|
||||
bool openResourceFile(const char *filename, byte encByte);
|
||||
|
||||
void loadPtrToResource(int type, int i, const byte *ptr);
|
||||
void readResTypeList(int id, uint32 tag, const char *name);
|
||||
virtual void readResTypeList(int id, uint32 tag, const char *name);
|
||||
void allocResTypeData(int id, uint32 tag, int num, const char *name, int mode);
|
||||
byte *createResource(int type, int index, uint32 size);
|
||||
int loadResource(int type, int i);
|
||||
|
Loading…
x
Reference in New Issue
Block a user