diff options
Diffstat (limited to 'engines/parallaction')
-rw-r--r-- | engines/parallaction/disk.cpp | 16 | ||||
-rw-r--r-- | engines/parallaction/disk.h | 3 | ||||
-rw-r--r-- | engines/parallaction/inventory.cpp | 17 |
3 files changed, 22 insertions, 14 deletions
diff --git a/engines/parallaction/disk.cpp b/engines/parallaction/disk.cpp index 86674be31e..ff4487fbf6 100644 --- a/engines/parallaction/disk.cpp +++ b/engines/parallaction/disk.cpp @@ -116,4 +116,20 @@ void loadFont(const char* name, Cnv* cnv) { _vm->_graphics->loadExternalCnv(path, cnv); } +// loads character's icons set + +void openObjects(const char *name, Cnv* cnv) { + + if (!scumm_strnicmp("mini", name, 4)) { + name += 4; + } + + char path[PATH_LEN]; + sprintf(path, "%sobj", name); + + _vm->_graphics->loadExternalCnv(path, cnv); + + return; +} + } // namespace Parallaction diff --git a/engines/parallaction/disk.h b/engines/parallaction/disk.h index 362439037b..c1d3b2f811 100644 --- a/engines/parallaction/disk.h +++ b/engines/parallaction/disk.h @@ -74,9 +74,12 @@ public: void openLocation(const char *name, char* script); void openTalk(const char *name, Cnv *cnv); +void openObjects(const char *name, Cnv *cnv); void loadPointer(StaticCnv* cnv); void loadHead(const char* name, StaticCnv* cnv); void loadFont(const char* name, Cnv* cnv); + + } // namespace Parallaction diff --git a/engines/parallaction/inventory.cpp b/engines/parallaction/inventory.cpp index c43f13e44b..d3e046ff2e 100644 --- a/engines/parallaction/inventory.cpp +++ b/engines/parallaction/inventory.cpp @@ -22,6 +22,7 @@ #include "parallaction/parallaction.h" +#include "parallaction/disk.h" #include "parallaction/zone.h" #include "parallaction/graphics.h" #include "parallaction/inventory.h" @@ -368,22 +369,10 @@ void cleanInventory() { } -// loads character's icons set -void loadCharacterItems(const char *character) { - - if (!scumm_strnicmp("mini", character, 4)) character += 4; - - char filename[PATH_LEN]; - sprintf(filename, "%sobj", character); - - _vm->_graphics->loadExternalCnv(filename, &_characterInventory); - - return; -} void refreshInventory(const char *character) { - loadCharacterItems(character); + openObjects(character, &_characterInventory); redrawInventory(); _vm->_graphics->freeCnv(&_characterInventory); @@ -392,7 +381,7 @@ void refreshInventory(const char *character) { void refreshInventoryItem(const char *character, uint16 index) { - loadCharacterItems(character); + openObjects(character, &_characterInventory); drawInventoryItem(index, &_inventory[index]); _vm->_graphics->freeCnv(&_characterInventory); |