aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEugene Sandulenko2005-07-25 02:38:43 +0000
committerEugene Sandulenko2005-07-25 02:38:43 +0000
commite8c1f6d1f1d89f350e570cb519202f2a866d7819 (patch)
treef9053028b23e2987c834c400aa1b3433bac212f3
parentf773d76c5452502a1b9ed4aaa3eaee4d09d6fc43 (diff)
downloadscummvm-rg350-e8c1f6d1f1d89f350e570cb519202f2a866d7819.tar.gz
scummvm-rg350-e8c1f6d1f1d89f350e570cb519202f2a866d7819.tar.bz2
scummvm-rg350-e8c1f6d1f1d89f350e570cb519202f2a866d7819.zip
More IHNM differences
svn-id: r18582
-rw-r--r--saga/animation.cpp8
-rw-r--r--saga/animation.h3
-rw-r--r--saga/scene.cpp37
-rw-r--r--saga/scene.h5
-rw-r--r--saga/script.h2
-rw-r--r--saga/sfuncs.cpp16
6 files changed, 57 insertions, 14 deletions
diff --git a/saga/animation.cpp b/saga/animation.cpp
index 081ddd74f7..50ee70cbc4 100644
--- a/saga/animation.cpp
+++ b/saga/animation.cpp
@@ -572,7 +572,7 @@ int Anim::IHNM_DecodeFrame(byte *decode_buf, size_t decode_buf_len, const byte *
outbuf_remain -= runcount;
continue;
break;
- case 0x1F: // 31: Unusued?
+ case SAGA_FRAME_NOOP: // Unused
if (thisf_len - readS.pos() < 3) {
warning("0x%02X: Input buffer underrun", in_ch);
return FAILURE;
@@ -775,6 +775,12 @@ void Anim::fillFrameOffsets(AnimationData *anim) {
readS.readByte();
continue;
break;
+ case SAGA_FRAME_NOOP: // Does nothing
+ readS.readByte();
+ readS.readByte();
+ readS.readByte();
+ continue;
+ break;
default:
break;
}
diff --git a/saga/animation.h b/saga/animation.h
index 1a9df5df06..7316fa7112 100644
--- a/saga/animation.h
+++ b/saga/animation.h
@@ -30,12 +30,13 @@
namespace Saga {
-#define MAX_ANIMATIONS 7
+#define MAX_ANIMATIONS 10
#define DEFAULT_FRAME_TIME 140
#define SAGA_FRAME_START 0xF
#define SAGA_FRAME_END 0x3F
+#define SAGA_FRAME_NOOP 0x1F
#define SAGA_FRAME_REPOSITION 0x30
#define SAGA_FRAME_ROW_END 0x2F
#define SAGA_FRAME_LONG_COMPRESSED_RUN 0x20
diff --git a/saga/scene.cpp b/saga/scene.cpp
index e69b7bce19..c19b654587 100644
--- a/saga/scene.cpp
+++ b/saga/scene.cpp
@@ -675,7 +675,7 @@ void Scene::loadSceneResourceList(uint32 resourceId) {
for (i = 0; i < _resourceListCount; i++) {
_resourceList[i].resourceId = readS.readUint16();
- _resourceList[i].reourceType = readS.readUint16();
+ _resourceList[i].resourceType = readS.readUint16();
// demo version may contain invalid resourceId
_resourceList[i].invalid = !_vm->_resource->validResourceId(_sceneContext, _resourceList[i].resourceId);
}
@@ -688,6 +688,7 @@ void Scene::processSceneResources() {
size_t resourceDataLength;
const byte *palPointer;
size_t i;
+ int resType;
// Process the scene resource list
for (i = 0; i < _resourceListCount; i++) {
@@ -696,8 +697,25 @@ void Scene::processSceneResources() {
}
resourceData = _resourceList[i].buffer;
resourceDataLength = _resourceList[i].size;
- switch (_resourceList[i].reourceType) {
+
+ resType = _resourceList[i].resourceType;
+
+ if (_vm->getGameType() == GType_IHNM) {
+ // IHNM has more animation slots and so resource numbers are shifted
+ // We use this trick to avoid code duplication.
+ // SAGA_ANIM_X code is correctly dependent on _resourceList[i].resourceType
+ if (resType > SAGA_ANIM_7)
+ resType -= 3;
+ }
+
+ switch (resType) {
case SAGA_ACTOR:
+ //for (a = actorsInScene; a; a = a->nextInScene)
+ // if (a->obj.figID == glist->file_id)
+ // if (_vm->getGameType() == GType_ITE ||
+ // ((a->obj.flags & ACTORF_FINAL_FACE) & 0xff))
+ // a->sprites = (xSpriteSet *)glist->offset;
+ warning("STUB: unimplemeted handler of SAGA_ACTOR resource");
break;
case SAGA_OBJECT:
break;
@@ -797,13 +815,17 @@ void Scene::processSceneResources() {
case SAGA_ANIM_6:
case SAGA_ANIM_7:
{
- uint16 animId = _resourceList[i].reourceType - SAGA_ANIM_1;
+ uint16 animId = _resourceList[i].resourceType - SAGA_ANIM_1;
debug(3, "Loading animation resource animId=%i", animId);
_vm->_anim->load(animId, resourceData, resourceDataLength);
}
break;
+ case SAGA_ENTRY:
+ debug(3, "Loading entry list resource...");
+ loadSceneEntryList(resourceData, resourceDataLength);
+ break;
case SAGA_ISO_MULTI:
if (!(_sceneDescription.flags & kSceneFlagISO)) {
error("Scene::ProcessSceneResources(): not Iso mode");
@@ -817,12 +839,9 @@ void Scene::processSceneResources() {
debug(3, "Loading palette animation resource.");
_vm->_palanim->loadPalAnim(resourceData, resourceDataLength);
break;
- case SAGA_ENTRY:
- debug(3, "Loading entry list resource...");
- loadSceneEntryList(resourceData, resourceDataLength);
- break;
case SAGA_FACES:
- _vm->_interface->loadScenePortraits(_resourceList[i].resourceId);
+ if (_vm->getGameType() == GType_ITE)
+ _vm->_interface->loadScenePortraits(_resourceList[i].resourceId);
break;
case SAGA_PALETTE:
{
@@ -841,7 +860,7 @@ void Scene::processSceneResources() {
}
break;
default:
- error("Scene::ProcessSceneResources() Encountered unknown resource type %i", _resourceList[i].reourceType);
+ error("Scene::ProcessSceneResources() Encountered unknown resource type %i", _resourceList[i].resourceType);
break;
}
}
diff --git a/saga/scene.h b/saga/scene.h
index 9ab176011e..c69cee3ecc 100644
--- a/saga/scene.h
+++ b/saga/scene.h
@@ -78,6 +78,9 @@ enum SAGAResourceTypes {
SAGA_ANIM_5,
SAGA_ANIM_6,
SAGA_ANIM_7,
+ //SAGA_ANIM_8, // IHNM. We use trick to avoid code duplication
+ //SAGA_ANIM_9,
+ //SAGA_ANIM_10,
SAGA_ISO_MULTI = 22,
SAGA_PAL_ANIM = 23,
SAGA_FACES = 24,
@@ -88,7 +91,7 @@ enum SAGAResourceTypes {
struct SceneResourceData {
uint32 resourceId;
- int reourceType;
+ int resourceType;
byte *buffer;
size_t size;
bool invalid;
diff --git a/saga/script.h b/saga/script.h
index be1c3d611e..4e175d1900 100644
--- a/saga/script.h
+++ b/saga/script.h
@@ -537,6 +537,8 @@ private:
void sfDebugShowData(SCRIPTFUNC_PARAMS);
void SF_stub(SCRIPTFUNC_PARAMS);
void sfNull(SCRIPTFUNC_PARAMS);
+ void sfPsychicProfile(SCRIPTFUNC_PARAMS);
+ void sfPsychicProfileOff(SCRIPTFUNC_PARAMS);
};
} // End of namespace Saga
diff --git a/saga/sfuncs.cpp b/saga/sfuncs.cpp
index a309331ab0..757e27011d 100644
--- a/saga/sfuncs.cpp
+++ b/saga/sfuncs.cpp
@@ -183,8 +183,8 @@ static const ScriptFunctionDescription IHNMscriptFunctionsList[IHNM_SCRIPT_FUNCT
OPCODE(sfScriptWalkRelative),
OPCODE(sfScriptMoveRelative),
OPCODE(sfSimulSpeech2),
- OPCODE(sfPlacard),
- OPCODE(sfPlacardOff),
+ OPCODE(sfPsychicProfile),
+ OPCODE(sfPsychicProfileOff),
OPCODE(sfSetProtagState),
OPCODE(sfResumeBgdAnim),
OPCODE(sfThrowActor),
@@ -1466,6 +1466,18 @@ void Script::sfPlacardOff(SCRIPTFUNC_PARAMS) {
}
+void Script::sfPsychicProfile(SCRIPTFUNC_PARAMS) {
+ for (int i = 0; i < nArgs; i++)
+ thread->pop();
+ warning("STUB: sfPsychicProfile()");
+}
+
+void Script::sfPsychicProfileOff(SCRIPTFUNC_PARAMS) {
+ for (int i = 0; i < nArgs; i++)
+ thread->pop();
+ warning("STUB: sfPsychicProfileOff()");
+}
+
// Script function #50 (0x32)
void Script::sfSetProtagState(SCRIPTFUNC_PARAMS) {
int protagState = thread->pop();