added inventory objects loader routine

svn-id: r25936
This commit is contained in:
Nicola Mettifogo 2007-03-02 22:23:02 +00:00
parent c122d83c0e
commit 02d4001f57
3 changed files with 22 additions and 14 deletions

View File

@ -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

View File

@ -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

View File

@ -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);