diff options
author | Eugene Sandulenko | 2005-10-09 01:18:26 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2005-10-09 01:18:26 +0000 |
commit | d02c35c8213b4994769d7f42ffb40c148ae991a8 (patch) | |
tree | 021f371e0d996373956bdad49e105e0dede612c1 | |
parent | 41b0ba9f95e87b6a2c3ad448440dfec5fdcd4e51 (diff) | |
download | scummvm-rg350-d02c35c8213b4994769d7f42ffb40c148ae991a8.tar.gz scummvm-rg350-d02c35c8213b4994769d7f42ffb40c148ae991a8.tar.bz2 scummvm-rg350-d02c35c8213b4994769d7f42ffb40c148ae991a8.zip |
(more) Proper implementation of ChapterSelection panel. Though not all
functionality is implemented but it is enough for now. Lets select any
character.
svn-id: r18982
-rw-r--r-- | saga/actor.cpp | 2 | ||||
-rw-r--r-- | saga/interface.cpp | 22 | ||||
-rw-r--r-- | saga/rscfile.cpp | 2 | ||||
-rw-r--r-- | saga/saga.h | 5 |
4 files changed, 26 insertions, 5 deletions
diff --git a/saga/actor.cpp b/saga/actor.cpp index ecbfe5584d..fe97ef7e5b 100644 --- a/saga/actor.cpp +++ b/saga/actor.cpp @@ -426,7 +426,7 @@ void Actor::loadActorList(int protagonistIdx, int actorCount, int actorsResource actor->_screenDepth = actorS.readUint16LE(); actor->_spriteListResourceId = actorS.readUint32LE(); actor->_frameListResourceId = actorS.readUint32LE(); - debug(0, "%d: %d, %d", i, actor->_spriteListResourceId, actor->_frameListResourceId); + debug(0, "%d: %d, %d [%d]", i, actor->_spriteListResourceId, actor->_frameListResourceId, actor->_nameIndex); actor->_scriptEntrypointNumber = actorS.readUint32LE(); actorS.readUint32LE(); // xSprite *dSpr; actorS.readUint16LE(); //LEFT diff --git a/saga/interface.cpp b/saga/interface.cpp index c62adbdd11..383fcd573e 100644 --- a/saga/interface.cpp +++ b/saga/interface.cpp @@ -1215,7 +1215,27 @@ void Interface::handleOptionClick(const Point& mousePoint) { } void Interface::handleChapterSelectionUpdate(const Point& mousePoint) { - _vm->_script->whichObject(mousePoint); + uint16 objectId =ID_NOTHING; + int16 objectFlags; + uint16 newObjectId; + + // FIXME: Original handled more object types here. + + newObjectId = _vm->_actor->hitTest(mousePoint, true); + + if (newObjectId != ID_NOTHING) { + if (objectTypeId(newObjectId) == kGameObjectObject) { + objectId = newObjectId; + objectFlags = 0; + } else { + objectId = newObjectId; + objectFlags = kObjUseWith; + } + } + + if (objectId != _vm->_script->_pointerObject) { + _vm->_script->_pointerObject = objectId; + } } void Interface::handleChapterSelectionClick(const Point& mousePoint) { diff --git a/saga/rscfile.cpp b/saga/rscfile.cpp index bba3225883..0088a8be42 100644 --- a/saga/rscfile.cpp +++ b/saga/rscfile.cpp @@ -531,7 +531,7 @@ void Resource::loadGlobalResources(int chapter, int actorsEntrance) { _vm->loadStrings(_vm->_actor->_actorsStrings, resourcePointer, resourceLength); free(resourcePointer); - // TODO: field_8 + // TODO: field_8. Inventory-related _vm->_sprite->_mainSprites.freeMem(); _vm->_sprite->loadList(_metaResource.mainSpritesID, _vm->_sprite->_mainSprites); diff --git a/saga/saga.h b/saga/saga.h index 677117dade..787e85d6da 100644 --- a/saga/saga.h +++ b/saga/saga.h @@ -232,8 +232,9 @@ struct StringsTable { const char **strings; const char *getString(int index) const { - if ((stringsCount <= index) || (index < 0)) - error("StringList::getString wrong index 0x%X", index); + if ((stringsCount <= index) || (index < 0)) { + error("StringList::getString wrong index 0x%X (%d)", index, stringsCount); + } return strings[index]; } |