diff options
author | Nicola Mettifogo | 2007-03-02 22:23:02 +0000 |
---|---|---|
committer | Nicola Mettifogo | 2007-03-02 22:23:02 +0000 |
commit | 02d4001f578c72cd23d22dfd9d10c5e37d151737 (patch) | |
tree | 5bfaea893fabe6f1d5f32f6caa3758a8bab4dd29 /engines/parallaction | |
parent | c122d83c0eacbb0570a0cbbc6aaaeace1f677786 (diff) | |
download | scummvm-rg350-02d4001f578c72cd23d22dfd9d10c5e37d151737.tar.gz scummvm-rg350-02d4001f578c72cd23d22dfd9d10c5e37d151737.tar.bz2 scummvm-rg350-02d4001f578c72cd23d22dfd9d10c5e37d151737.zip |
added inventory objects loader routine
svn-id: r25936
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); |