aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTorbjörn Andersson2005-10-08 22:09:21 +0000
committerTorbjörn Andersson2005-10-08 22:09:21 +0000
commit18d33dc07847cbb5e8c525103d37efe231b5f1d0 (patch)
treec968594d4f43ec74df305aeacf04902028df7f53
parent95ff7fd0bb2cd735071f8431a05a66f8f217cf2e (diff)
downloadscummvm-rg350-18d33dc07847cbb5e8c525103d37efe231b5f1d0.tar.gz
scummvm-rg350-18d33dc07847cbb5e8c525103d37efe231b5f1d0.tar.bz2
scummvm-rg350-18d33dc07847cbb5e8c525103d37efe231b5f1d0.zip
Read IHNM actor and object strings from the resource file. (This does not
keep whichObject() from crashing, but I don't know why.) svn-id: r18980
-rw-r--r--saga/actor.h4
-rw-r--r--saga/rscfile.cpp16
-rw-r--r--saga/rscfile.h4
-rw-r--r--saga/saga.cpp4
4 files changed, 20 insertions, 8 deletions
diff --git a/saga/actor.h b/saga/actor.h
index 8a6518f98e..6830bfd8d7 100644
--- a/saga/actor.h
+++ b/saga/actor.h
@@ -641,7 +641,6 @@ protected:
SagaEngine *_vm;
ResourceContext *_actorContext;
- StringsTable _actorsStrings;
int _lastTickMsec;
CommonObjectOrderList _drawOrderList;
@@ -653,6 +652,9 @@ public:
Rect _speechBoxScript;
+ StringsTable _objectsStrings;
+ StringsTable _actorsStrings;
+
protected:
SpeechData _activeSpeech;
int _protagState;
diff --git a/saga/rscfile.cpp b/saga/rscfile.cpp
index 010173ad7b..bba3225883 100644
--- a/saga/rscfile.cpp
+++ b/saga/rscfile.cpp
@@ -468,12 +468,12 @@ void Resource::loadGlobalResources(int chapter, int actorsEntrance) {
_metaResource.sceneIndex = metaS.readSint16LE();
_metaResource.objectCount = metaS.readSint16LE();
- _metaResource.field_4 = metaS.readSint32LE();
+ _metaResource.objectsStringsResourceID = metaS.readSint32LE();
_metaResource.field_8 = metaS.readSint32LE();
_metaResource.mainSpritesID = metaS.readSint32LE();
_metaResource.objectsResourceID = metaS.readSint32LE();
_metaResource.actorCount = metaS.readSint16LE();
- _metaResource.field_16 = metaS.readSint32LE();
+ _metaResource.actorsStringsResourceID = metaS.readSint32LE();
_metaResource.actorsResourceID = metaS.readSint32LE();
_metaResource.protagFaceSpritesID = metaS.readSint32LE();
_metaResource.field_22 = metaS.readSint32LE();
@@ -491,7 +491,11 @@ void Resource::loadGlobalResources(int chapter, int actorsEntrance) {
_vm->_actor->_protagonist->_sceneNumber = _metaResource.sceneIndex;
- // TODO: field_16
+ _vm->_actor->_objectsStrings.freeMem();
+
+ _vm->_resource->loadResource(resourceContext, _metaResource.objectsStringsResourceID, resourcePointer, resourceLength);
+ _vm->loadStrings(_vm->_actor->_objectsStrings, resourcePointer, resourceLength);
+ free(resourcePointer);
if (chapter >= _vm->_sndRes->_fxTableIDsLen) {
error("Chapter ID exceeds fxTableIDs length");
@@ -521,7 +525,11 @@ void Resource::loadGlobalResources(int chapter, int actorsEntrance) {
_vm->_interface->_defPortraits.freeMem();
_vm->_sprite->loadList(_metaResource.protagFaceSpritesID, _vm->_interface->_defPortraits);
- // TODO: field_4
+ _vm->_actor->_actorsStrings.freeMem();
+
+ _vm->_resource->loadResource(resourceContext, _metaResource.actorsStringsResourceID, resourcePointer, resourceLength);
+ _vm->loadStrings(_vm->_actor->_actorsStrings, resourcePointer, resourceLength);
+ free(resourcePointer);
// TODO: field_8
diff --git a/saga/rscfile.h b/saga/rscfile.h
index d096184ba6..7de0e5b119 100644
--- a/saga/rscfile.h
+++ b/saga/rscfile.h
@@ -92,12 +92,12 @@ struct ResourceContext {
struct MetaResource {
int16 sceneIndex;
int16 objectCount;
- int32 field_4;
+ int32 objectsStringsResourceID;
int32 field_8;
int32 mainSpritesID;
int32 objectsResourceID;
int16 actorCount;
- int32 field_16;
+ int32 actorsStringsResourceID;
int32 actorsResourceID;
int32 protagFaceSpritesID;
int32 field_22;
diff --git a/saga/saga.cpp b/saga/saga.cpp
index fe83e387a7..66840b98a7 100644
--- a/saga/saga.cpp
+++ b/saga/saga.cpp
@@ -388,7 +388,9 @@ const char *SagaEngine::getObjectName(uint16 objectId) {
switch (objectTypeId(objectId)) {
case kGameObjectObject:
obj = _actor->getObj(objectId);
- return _script->_mainStrings.getString(obj->_nameIndex);
+ if (getGameType() == GType_ITE)
+ return _script->_mainStrings.getString(obj->_nameIndex);
+ return _actor->_objectsStrings.getString(obj->_nameIndex);
case kGameObjectActor:
actor = _actor->getActor(objectId);
return _actor->_actorsStrings.getString(actor->_nameIndex);