diff options
author | Nicola Mettifogo | 2007-03-18 10:25:46 +0000 |
---|---|---|
committer | Nicola Mettifogo | 2007-03-18 10:25:46 +0000 |
commit | ec58e9ac05cb887c3c2e0c8c9d98d3300fb4ad86 (patch) | |
tree | e5464c5a9c541d5f545a89f657013cd0ffe2f75b | |
parent | 35cebe2444257f1cc9e5c6a13cba54cef3542732 (diff) | |
download | scummvm-rg350-ec58e9ac05cb887c3c2e0c8c9d98d3300fb4ad86.tar.gz scummvm-rg350-ec58e9ac05cb887c3c2e0c8c9d98d3300fb4ad86.tar.bz2 scummvm-rg350-ec58e9ac05cb887c3c2e0c8c9d98d3300fb4ad86.zip |
Made loadHead return a new Cnv instead of accepting a parameter.
svn-id: r26200
-rw-r--r-- | engines/parallaction/disk.cpp | 4 | ||||
-rw-r--r-- | engines/parallaction/disk.h | 2 | ||||
-rw-r--r-- | engines/parallaction/parallaction.cpp | 7 | ||||
-rw-r--r-- | engines/parallaction/parallaction.h | 11 | ||||
-rw-r--r-- | engines/parallaction/zone.cpp | 2 |
5 files changed, 16 insertions, 10 deletions
diff --git a/engines/parallaction/disk.cpp b/engines/parallaction/disk.cpp index cbda89f8bf..def512c1b6 100644 --- a/engines/parallaction/disk.cpp +++ b/engines/parallaction/disk.cpp @@ -284,7 +284,7 @@ Script* Disk::loadScript(const char* name) { return new Script(buf, true); } -void Disk::loadHead(const char* name, StaticCnv* cnv) { +StaticCnv* Disk::loadHead(const char* name) { char path[PATH_LEN]; /* @@ -300,7 +300,9 @@ void Disk::loadHead(const char* name, StaticCnv* cnv) { snprintf(path, 8, "%shead", name); path[8] = '\0'; + StaticCnv *cnv = new StaticCnv; loadExternalStaticCnv(path, cnv); + return cnv; } diff --git a/engines/parallaction/disk.h b/engines/parallaction/disk.h index a4c8aa6125..a42a988d64 100644 --- a/engines/parallaction/disk.h +++ b/engines/parallaction/disk.h @@ -108,7 +108,7 @@ public: Cnv* loadTalk(const char *name); void loadObjects(const char *name, Cnv *cnv); void loadPointer(StaticCnv* cnv); - void loadHead(const char* name, StaticCnv* cnv); + StaticCnv* loadHead(const char* name); void loadFont(const char* name, Cnv* cnv); void loadStatic(const char* name, StaticCnv* cnv); void loadFrames(const char* name, Cnv* cnv); diff --git a/engines/parallaction/parallaction.cpp b/engines/parallaction/parallaction.cpp index 80da5e730c..41a0e2eddb 100644 --- a/engines/parallaction/parallaction.cpp +++ b/engines/parallaction/parallaction.cpp @@ -725,10 +725,13 @@ void freeCharacter() { if (!IS_DUMMY_CHARACTER(_vm->_characterName)) { _vm->_gfx->freeCnv(&_vm->_char._miniFrames); _vm->freeTable(_objectsNames); + _vm->_gfx->freeCnv(_vm->_char._talk); if (_vm->_char._talk) delete _vm->_char._talk; - _vm->_gfx->freeStaticCnv(&_vm->_char._head); + _vm->_gfx->freeStaticCnv(_vm->_char._head); + if (_vm->_char._head) delete _vm->_char._head; + _vm->_gfx->freeCnv(&_vm->_char._objs); } @@ -806,7 +809,7 @@ void Parallaction::changeCharacter(const char *name) { _disk->loadFrames(path, &_vm->_char._normalFrames); if (!IS_DUMMY_CHARACTER(name)) { - _disk->loadHead(path, &_vm->_char._head); + _vm->_char._head = _disk->loadHead(path); _vm->_char._talk = _disk->loadTalk(path); _disk->loadObjects(name, &_vm->_char._objs); diff --git a/engines/parallaction/parallaction.h b/engines/parallaction/parallaction.h index 53838d7323..49806161fd 100644 --- a/engines/parallaction/parallaction.h +++ b/engines/parallaction/parallaction.h @@ -236,7 +236,7 @@ struct Location { struct Character { Animation _ani; - StaticCnv _head; + StaticCnv *_head; Cnv *_talk; Cnv _normalFrames; Cnv _miniFrames; @@ -249,10 +249,11 @@ struct Character { // _talk._count = 0; // _talk._array = NULL; - _head._width = 0; - _head._height = 0; - _head._data0 = NULL; - _head._data1 = NULL; + _head = NULL; +// _head._width = 0; +// _head._height = 0; +// _head._data0 = NULL; +// _head._data1 = NULL; _objs._count = 0; diff --git a/engines/parallaction/zone.cpp b/engines/parallaction/zone.cpp index 44d0f9d2a3..47a4556c4b 100644 --- a/engines/parallaction/zone.cpp +++ b/engines/parallaction/zone.cpp @@ -414,7 +414,7 @@ void displayItemComment(ExamineData *data) { Common::Rect r(v6C, v6A); r.moveTo(0, 90); _vm->_gfx->drawBalloon(r, 0); - _vm->_gfx->flatBlitCnv(&_vm->_char._head, 100, 152, Gfx::kBitFront); + _vm->_gfx->flatBlitCnv(_vm->_char._head, 100, 152, Gfx::kBitFront); _vm->_gfx->displayWrappedString(data->_description, 0, 90, 130, 0); jobEraseAnimations((void*)1, NULL); |