aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorjohndoe1232015-11-19 14:01:03 +0100
committerEugene Sandulenko2018-07-20 06:43:33 +0000
commit8b48f2f63f5cc21d864c3e960ce307b50286b64b (patch)
treed678ddede21faf2957629554e6859f68e44f1c79 /engines
parent61a0b5badbd7098e0b96355a428408654b3705df (diff)
downloadscummvm-rg350-8b48f2f63f5cc21d864c3e960ce307b50286b64b.tar.gz
scummvm-rg350-8b48f2f63f5cc21d864c3e960ce307b50286b64b.tar.bz2
scummvm-rg350-8b48f2f63f5cc21d864c3e960ce307b50286b64b.zip
ILLUSIONS: Rename ProgInfo -> SceneInfo
Diffstat (limited to 'engines')
-rw-r--r--engines/illusions/bbdou/illusions_bbdou.cpp12
-rw-r--r--engines/illusions/duckman/illusions_duckman.cpp24
-rw-r--r--engines/illusions/resources/scriptresource.cpp60
-rw-r--r--engines/illusions/resources/scriptresource.h18
4 files changed, 57 insertions, 57 deletions
diff --git a/engines/illusions/bbdou/illusions_bbdou.cpp b/engines/illusions/bbdou/illusions_bbdou.cpp
index 9c7e0192bb..b872a3c6e8 100644
--- a/engines/illusions/bbdou/illusions_bbdou.cpp
+++ b/engines/illusions/bbdou/illusions_bbdou.cpp
@@ -504,13 +504,13 @@ uint32 IllusionsEngine_BBDOU::newTempThreadId() {
}
bool IllusionsEngine_BBDOU::enterScene(uint32 sceneId, uint32 threadId) {
- ProgInfo *progInfo = _scriptResource->getProgInfo(sceneId & 0xFFFF);
- if (!progInfo) {
+ SceneInfo *sceneInfo = _scriptResource->getSceneInfo(sceneId & 0xFFFF);
+ if (!sceneInfo) {
dumpActiveScenes(_globalSceneId, threadId);
sceneId = _theSceneId;
}
_activeScenes.push(sceneId);
- return progInfo != 0;
+ return sceneInfo != 0;
}
void IllusionsEngine_BBDOU::exitScene(uint32 threadId) {
@@ -563,9 +563,9 @@ void IllusionsEngine_BBDOU::setSceneIdThreadId(uint32 theSceneId, uint32 theThre
}
bool IllusionsEngine_BBDOU::findTriggerCause(uint32 sceneId, uint32 verbId, uint32 objectId2, uint32 objectId, uint32 &codeOffs) {
- ProgInfo *progInfo = _scriptResource->getProgInfo(sceneId & 0xFFFF);
- if (progInfo)
- return progInfo->findTriggerCause(verbId, objectId2, objectId, codeOffs);
+ SceneInfo *sceneInfo = _scriptResource->getSceneInfo(sceneId & 0xFFFF);
+ if (sceneInfo)
+ return sceneInfo->findTriggerCause(verbId, objectId2, objectId, codeOffs);
return false;
}
diff --git a/engines/illusions/duckman/illusions_duckman.cpp b/engines/illusions/duckman/illusions_duckman.cpp
index 3a6514fa96..86cd068f22 100644
--- a/engines/illusions/duckman/illusions_duckman.cpp
+++ b/engines/illusions/duckman/illusions_duckman.cpp
@@ -717,13 +717,13 @@ void IllusionsEngine_Duckman::popActiveScene() {
}
bool IllusionsEngine_Duckman::loadScene(uint32 sceneId) {
- ProgInfo *progInfo = _scriptResource->getProgInfo(sceneId & 0xFFFF);
- if (!progInfo)
+ SceneInfo *sceneInfo = _scriptResource->getSceneInfo(sceneId & 0xFFFF);
+ if (!sceneInfo)
return false;
pushActiveScene(sceneId);
uint resourcesCount;
uint32 *resources;
- progInfo->getResources(resourcesCount, resources);
+ sceneInfo->getResources(resourcesCount, resources);
for (uint i = 0; i < resourcesCount; ++i)
_resSys->loadResource(resources[i], sceneId, 0);
return true;
@@ -789,9 +789,9 @@ void IllusionsEngine_Duckman::setSceneIdThreadId(uint32 theSceneId, uint32 theTh
}
bool IllusionsEngine_Duckman::findTriggerCause(uint32 sceneId, uint32 verbId, uint32 objectId2, uint32 objectId, uint32 &codeOffs) {
- ProgInfo *progInfo = _scriptResource->getProgInfo(sceneId & 0xFFFF);
- if (progInfo)
- return progInfo->findTriggerCause(verbId, objectId2, objectId, codeOffs);
+ SceneInfo *sceneInfo = _scriptResource->getSceneInfo(sceneId & 0xFFFF);
+ if (sceneInfo)
+ return sceneInfo->findTriggerCause(verbId, objectId2, objectId, codeOffs);
return false;
}
@@ -993,15 +993,15 @@ void IllusionsEngine_Duckman::playSoundEffect(int index) {
}
bool IllusionsEngine_Duckman::getTriggerCause(uint32 verbId, uint32 objectId2, uint32 objectId, uint32 &outThreadId) {
- ProgInfo *progInfo = _scriptResource->getProgInfo(getCurrentScene() & 0xFFFF);
+ SceneInfo *sceneInfo = _scriptResource->getSceneInfo(getCurrentScene() & 0xFFFF);
bool found =
- progInfo->findTriggerCause(verbId, objectId2, objectId, outThreadId) ||
- progInfo->findTriggerCause(verbId, objectId2, 0x40001, outThreadId);
+ sceneInfo->findTriggerCause(verbId, objectId2, objectId, outThreadId) ||
+ sceneInfo->findTriggerCause(verbId, objectId2, 0x40001, outThreadId);
if (!found) {
- progInfo = _scriptResource->getProgInfo(3);
+ sceneInfo = _scriptResource->getSceneInfo(3);
found =
- progInfo->findTriggerCause(verbId, objectId2, objectId, outThreadId) ||
- progInfo->findTriggerCause(verbId, objectId2, 0x40001, outThreadId);
+ sceneInfo->findTriggerCause(verbId, objectId2, objectId, outThreadId) ||
+ sceneInfo->findTriggerCause(verbId, objectId2, 0x40001, outThreadId);
}
return found;
}
diff --git a/engines/illusions/resources/scriptresource.cpp b/engines/illusions/resources/scriptresource.cpp
index 5ce7154439..3038a8694d 100644
--- a/engines/illusions/resources/scriptresource.cpp
+++ b/engines/illusions/resources/scriptresource.cpp
@@ -164,19 +164,19 @@ bool TriggerObject::findTriggerCause(uint32 verbId, uint32 objectId2, uint32 &co
return false;
}
-void TriggerObject::fixupProgInfosDuckman() {
+void TriggerObject::fixupSceneInfosDuckman() {
for (uint i = 0; i < _causesCount; ++i)
_causes[i]._verbId &= 0xFFFF;
}
-// ProgInfo
+// SceneInfo
-ProgInfo::ProgInfo()
+SceneInfo::SceneInfo()
: _triggerObjectsCount(0), _triggerObjects(0),
_resourcesCount(0), _resources(0) {
}
-ProgInfo::~ProgInfo() {
+SceneInfo::~SceneInfo() {
delete[] _triggerObjects;
delete[] _resources;
}
@@ -192,14 +192,14 @@ char *debugW2I(byte *wstr) {
return buf;
}
-void ProgInfo::load(byte *dataStart, Common::SeekableReadStream &stream) {
+void SceneInfo::load(byte *dataStart, Common::SeekableReadStream &stream) {
_id = stream.readUint16LE();
_unk = stream.readUint16LE();
_name = dataStart + stream.pos();
stream.skip(128);
_triggerObjectsCount = stream.readUint16LE();
_resourcesCount = stream.readUint16LE();
- debug(2, "\nProgInfo::load() _id: %d; _unk: %d; _name: [%s]",
+ debug(2, "\nSceneInfo::load() _id: %d; _unk: %d; _name: [%s]",
_id, _unk, debugW2I(_name));
uint32 triggerObjectsListOffs = stream.readUint32LE();
if (_resourcesCount > 0) {
@@ -218,28 +218,28 @@ void ProgInfo::load(byte *dataStart, Common::SeekableReadStream &stream) {
}
}
-bool ProgInfo::findTriggerCause(uint32 verbId, uint32 objectId2, uint32 objectId, uint32 &codeOffs) {
+bool SceneInfo::findTriggerCause(uint32 verbId, uint32 objectId2, uint32 objectId, uint32 &codeOffs) {
TriggerObject *triggerObject = findTriggerObject(objectId);
if (triggerObject)
return triggerObject->findTriggerCause(verbId, objectId2, codeOffs);
return false;
}
-void ProgInfo::getResources(uint &resourcesCount, uint32 *&resources) {
+void SceneInfo::getResources(uint &resourcesCount, uint32 *&resources) {
resourcesCount = _resourcesCount;
resources = _resources;
}
-TriggerObject *ProgInfo::findTriggerObject(uint32 objectId) {
+TriggerObject *SceneInfo::findTriggerObject(uint32 objectId) {
for (uint i = 0; i < _triggerObjectsCount; ++i)
if (_triggerObjects[i]._objectId == objectId)
return &_triggerObjects[i];
return 0;
}
-void ProgInfo::fixupProgInfosDuckman() {
+void SceneInfo::fixupSceneInfosDuckman() {
for (uint i = 0; i < _triggerObjectsCount; ++i)
- _triggerObjects[i].fixupProgInfosDuckman();
+ _triggerObjects[i].fixupSceneInfosDuckman();
}
// ScriptResource
@@ -259,15 +259,15 @@ void ScriptResource::load(Resource *resource) {
Common::MemoryReadStream stream(_data, _dataSize, DisposeAfterUse::NO);
- uint32 objectMapOffs, progInfosOffs;
+ uint32 objectMapOffs, sceneInfosOffs;
_objectMapCount = 0;
if (resource->_gameId == kGameIdBBDOU) {
- progInfosOffs = 0x18;
+ sceneInfosOffs = 0x18;
} else if (resource->_gameId == kGameIdDuckman) {
for (uint i = 0; i < 27; ++i)
_soundIds[i] = stream.readUint32LE();
- progInfosOffs = 0x8C;
+ sceneInfosOffs = 0x8C;
}
stream.skip(4); // Skip unused
@@ -278,7 +278,7 @@ void ScriptResource::load(Resource *resource) {
if (resource->_gameId == kGameIdDuckman)
_objectMapCount = stream.readUint16LE();
_codeCount = stream.readUint16LE();
- _progInfosCount = stream.readUint16LE();
+ _sceneInfosCount = stream.readUint16LE();
if (resource->_gameId == kGameIdDuckman)
stream.readUint16LE();//Unused?
@@ -289,8 +289,8 @@ void ScriptResource::load(Resource *resource) {
objectMapOffs = stream.readUint32LE();
uint32 codeTblOffs = stream.readUint32LE();
- debug(2, "ScriptResource::load() propertiesCount: %d; blockCountersCount: %d; _codeCount: %d; _progInfosCount: %d; _objectMapCount: %d",
- propertiesCount, blockCountersCount, _codeCount, _progInfosCount, _objectMapCount);
+ debug(2, "ScriptResource::load() propertiesCount: %d; blockCountersCount: %d; _codeCount: %d; _sceneInfosCount: %d; _objectMapCount: %d",
+ propertiesCount, blockCountersCount, _codeCount, _sceneInfosCount, _objectMapCount);
debug(2, "ScriptResource::load() propertiesOffs: %08X; blockCountersOffs: %08X; codeTblOffs: %08X; objectMapOffs: %08X",
propertiesOffs, blockCountersOffs, codeTblOffs, objectMapOffs);
// Init properties
@@ -304,12 +304,12 @@ void ScriptResource::load(Resource *resource) {
for (uint i = 0; i < _codeCount; ++i)
_codeOffsets[i] = stream.readUint32LE();
- _progInfos = new ProgInfo[_progInfosCount];
- for (uint i = 0; i < _progInfosCount; ++i) {
- stream.seek(progInfosOffs + i * 4);
- uint32 progInfoOffs = stream.readUint32LE();
- stream.seek(progInfoOffs);
- _progInfos[i].load(_data, stream);
+ _sceneInfos = new SceneInfo[_sceneInfosCount];
+ for (uint i = 0; i < _sceneInfosCount; ++i) {
+ stream.seek(sceneInfosOffs + i * 4);
+ uint32 sceneInfoOffs = stream.readUint32LE();
+ stream.seek(sceneInfoOffs);
+ _sceneInfos[i].load(_data, stream);
}
if (_objectMapCount > 0) {
@@ -330,7 +330,7 @@ void ScriptResource::load(Resource *resource) {
}
if (resource->_gameId == kGameIdDuckman)
- fixupProgInfosDuckman();
+ fixupSceneInfosDuckman();
}
@@ -342,9 +342,9 @@ byte *ScriptResource::getCode(uint32 codeOffs) {
return _data + codeOffs;
}
-ProgInfo *ScriptResource::getProgInfo(uint32 index) {
- if (index > 0 && index <= _progInfosCount)
- return &_progInfos[index - 1];
+SceneInfo *ScriptResource::getSceneInfo(uint32 index) {
+ if (index > 0 && index <= _sceneInfosCount)
+ return &_sceneInfos[index - 1];
return 0;
}
@@ -352,9 +352,9 @@ uint32 ScriptResource::getObjectActorTypeId(uint32 objectId) {
return _objectMap[(objectId & 0xFFFF) - 1];
}
-void ScriptResource::fixupProgInfosDuckman() {
- for (uint i = 0; i < _progInfosCount; ++i)
- _progInfos[i].fixupProgInfosDuckman();
+void ScriptResource::fixupSceneInfosDuckman() {
+ for (uint i = 0; i < _sceneInfosCount; ++i)
+ _sceneInfos[i].fixupSceneInfosDuckman();
}
// ScriptInstance
diff --git a/engines/illusions/resources/scriptresource.h b/engines/illusions/resources/scriptresource.h
index eb58c66cb9..6debcb2efb 100644
--- a/engines/illusions/resources/scriptresource.h
+++ b/engines/illusions/resources/scriptresource.h
@@ -79,21 +79,21 @@ public:
~TriggerObject();
void load(byte *dataStart, Common::SeekableReadStream &stream);
bool findTriggerCause(uint32 verbId, uint32 objectId2, uint32 &codeOffs);
- void fixupProgInfosDuckman();
+ void fixupSceneInfosDuckman();
public:
uint32 _objectId;
uint _causesCount;
TriggerCause *_causes;
};
-class ProgInfo {
+class SceneInfo {
public:
- ProgInfo();
- ~ProgInfo();
+ SceneInfo();
+ ~SceneInfo();
void load(byte *dataStart, Common::SeekableReadStream &stream);
bool findTriggerCause(uint32 verbId, uint32 objectId2, uint32 objectId, uint32 &codeOffs);
void getResources(uint &resourcesCount, uint32 *&resources);
- void fixupProgInfosDuckman();
+ void fixupSceneInfosDuckman();
protected:
uint16 _id;
uint16 _unk;
@@ -112,7 +112,7 @@ public:
void load(Resource *resource);
byte *getThreadCode(uint32 threadId);
byte *getCode(uint32 codeOffs);
- ProgInfo *getProgInfo(uint32 index);
+ SceneInfo *getSceneInfo(uint32 index);
uint32 getObjectActorTypeId(uint32 objectId);
uint32 getMainActorObjectId() const { return _mainActorObjectId; }
public:
@@ -122,14 +122,14 @@ public:
BlockCounters _blockCounters;
uint _codeCount;
uint32 *_codeOffsets;
- uint _progInfosCount;
- ProgInfo *_progInfos;
+ uint _sceneInfosCount;
+ SceneInfo *_sceneInfos;
// Duckman specific
uint32 _soundIds[27];
uint _objectMapCount;
uint32 *_objectMap;
uint32 _mainActorObjectId;
- void fixupProgInfosDuckman();
+ void fixupSceneInfosDuckman();
};
class ScriptInstance : public ResourceInstance {