diff options
author | Nicola Mettifogo | 2007-03-18 10:34:41 +0000 |
---|---|---|
committer | Nicola Mettifogo | 2007-03-18 10:34:41 +0000 |
commit | 13385a5f2d22870417ec07334ae0836d4fac12a7 (patch) | |
tree | 183422444908f05171ead2c81c74ce84819a4d01 | |
parent | 8f74bc15aef1c56b29d21bf3aa7e8e51687b98ae (diff) | |
download | scummvm-rg350-13385a5f2d22870417ec07334ae0836d4fac12a7.tar.gz scummvm-rg350-13385a5f2d22870417ec07334ae0836d4fac12a7.tar.bz2 scummvm-rg350-13385a5f2d22870417ec07334ae0836d4fac12a7.zip |
Made loadObjects return a new Cnv instead of accepting a parameter.
svn-id: r26202
-rw-r--r-- | engines/parallaction/disk.cpp | 6 | ||||
-rw-r--r-- | engines/parallaction/disk.h | 2 | ||||
-rw-r--r-- | engines/parallaction/inventory.cpp | 10 | ||||
-rw-r--r-- | engines/parallaction/parallaction.cpp | 5 | ||||
-rw-r--r-- | engines/parallaction/parallaction.h | 5 |
5 files changed, 15 insertions, 13 deletions
diff --git a/engines/parallaction/disk.cpp b/engines/parallaction/disk.cpp index 863eaada18..8e2c2dd8a2 100644 --- a/engines/parallaction/disk.cpp +++ b/engines/parallaction/disk.cpp @@ -322,7 +322,7 @@ void Disk::loadFont(const char* name, Cnv* cnv) { // loads character's icons set -void Disk::loadObjects(const char *name, Cnv* cnv) { +Cnv* Disk::loadObjects(const char *name) { if (IS_MINI_CHARACTER(name)) { name += 4; @@ -331,9 +331,9 @@ void Disk::loadObjects(const char *name, Cnv* cnv) { char path[PATH_LEN]; sprintf(path, "%sobj", name); + Cnv* cnv = new Cnv; loadExternalCnv(path, cnv); - - return; + return cnv; } diff --git a/engines/parallaction/disk.h b/engines/parallaction/disk.h index 438f7af417..730cf559e6 100644 --- a/engines/parallaction/disk.h +++ b/engines/parallaction/disk.h @@ -106,7 +106,7 @@ public: Script* loadLocation(const char *name); Script* loadScript(const char* name); Cnv* loadTalk(const char *name); - void loadObjects(const char *name, Cnv *cnv); + Cnv* loadObjects(const char *name); StaticCnv* loadPointer(); StaticCnv* loadHead(const char* name); void loadFont(const char* name, Cnv* cnv); diff --git a/engines/parallaction/inventory.cpp b/engines/parallaction/inventory.cpp index aed5ce2a18..723b9176cb 100644 --- a/engines/parallaction/inventory.cpp +++ b/engines/parallaction/inventory.cpp @@ -187,8 +187,8 @@ void drawInventoryItem(uint16 pos, InventoryItem *item) { uint16 col = pos % INVENTORY_ITEMS_PER_LINE; // FIXME: this will end up in a general blit function - byte* s = _vm->_char._objs._array[item->_index]; - byte* d = _buffer + col * INVENTORYITEM_WIDTH + line * _vm->_char._objs._height * INVENTORY_WIDTH; + byte* s = _vm->_char._objs->_array[item->_index]; + byte* d = _buffer + col * INVENTORYITEM_WIDTH + line * _vm->_char._objs->_height * INVENTORY_WIDTH; for (uint32 i = 0; i < INVENTORYITEM_HEIGHT; i++) { memcpy(d, s, INVENTORYITEM_WIDTH); @@ -228,8 +228,8 @@ void highlightInventoryItem(int16 pos, byte color) { uint16 line = pos / INVENTORY_ITEMS_PER_LINE; uint16 col = pos % INVENTORY_ITEMS_PER_LINE; - Common::Rect r(INVENTORYITEM_WIDTH, _vm->_char._objs._height); - r.moveTo(col * INVENTORYITEM_WIDTH, line * _vm->_char._objs._height); + Common::Rect r(INVENTORYITEM_WIDTH, _vm->_char._objs->_height); + r.moveTo(col * INVENTORYITEM_WIDTH, line * _vm->_char._objs->_height); drawBorder(r, _buffer, color); @@ -247,7 +247,7 @@ void extractInventoryGraphics(int16 pos, byte *dst) { // FIXME: this will end up in a general blit function byte* d = dst; - byte* s = _buffer + col * INVENTORYITEM_WIDTH + line * _vm->_char._objs._height * INVENTORY_WIDTH; + byte* s = _buffer + col * INVENTORYITEM_WIDTH + line * _vm->_char._objs->_height * INVENTORY_WIDTH; for (uint32 i = 0; i < INVENTORYITEM_HEIGHT; i++) { memcpy(d, s, INVENTORYITEM_WIDTH); diff --git a/engines/parallaction/parallaction.cpp b/engines/parallaction/parallaction.cpp index 41a0e2eddb..3c257677b3 100644 --- a/engines/parallaction/parallaction.cpp +++ b/engines/parallaction/parallaction.cpp @@ -732,7 +732,8 @@ void freeCharacter() { _vm->_gfx->freeStaticCnv(_vm->_char._head); if (_vm->_char._head) delete _vm->_char._head; - _vm->_gfx->freeCnv(&_vm->_char._objs); + _vm->_gfx->freeCnv(_vm->_char._objs); + if (_vm->_char._objs) delete _vm->_char._objs; } return; @@ -811,7 +812,7 @@ void Parallaction::changeCharacter(const char *name) { if (!IS_DUMMY_CHARACTER(name)) { _vm->_char._head = _disk->loadHead(path); _vm->_char._talk = _disk->loadTalk(path); - _disk->loadObjects(name, &_vm->_char._objs); + _vm->_char._objs = _disk->loadObjects(name); sprintf(path, "mini%s", v32); _disk->loadFrames(path, &_vm->_char._miniFrames); diff --git a/engines/parallaction/parallaction.h b/engines/parallaction/parallaction.h index 49806161fd..c26846f520 100644 --- a/engines/parallaction/parallaction.h +++ b/engines/parallaction/parallaction.h @@ -240,7 +240,7 @@ struct Character { Cnv *_talk; Cnv _normalFrames; Cnv _miniFrames; - Cnv _objs; + Cnv *_objs; Character() { _talk = NULL; @@ -255,7 +255,8 @@ struct Character { // _head._data0 = NULL; // _head._data1 = NULL; - _objs._count = 0; + _objs = NULL; +// _objs._count = 0; _ani._zone._left = 150; _ani._zone._top = 100; |