diff options
author | Gregory Montoir | 2004-01-05 20:46:37 +0000 |
---|---|---|
committer | Gregory Montoir | 2004-01-05 20:46:37 +0000 |
commit | 5e413ceb5c5a319d540d5c7a328509ee69a627f1 (patch) | |
tree | 58d0dee455b21377ce317558fce727ae02cf464c /queen | |
parent | d834bd9684c6b3f7dc8979086d467446f59ba41b (diff) | |
download | scummvm-rg350-5e413ceb5c5a319d540d5c7a328509ee69a627f1.tar.gz scummvm-rg350-5e413ceb5c5a319d540d5c7a328509ee69a627f1.tar.bz2 scummvm-rg350-5e413ceb5c5a319d540d5c7a328509ee69a627f1.zip |
- enabled debugger in QueenEngine::errorString
- initialise Cutaway::_personCount* when the Cutaway starts
- minor tweaks in BankManager
svn-id: r12163
Diffstat (limited to 'queen')
-rw-r--r-- | queen/cutaway.cpp | 5 | ||||
-rw-r--r-- | queen/graphics.cpp | 14 | ||||
-rw-r--r-- | queen/queen.cpp | 4 |
3 files changed, 13 insertions, 10 deletions
diff --git a/queen/cutaway.cpp b/queen/cutaway.cpp index 0c80fdcbc9..fe7f1083c4 100644 --- a/queen/cutaway.cpp +++ b/queen/cutaway.cpp @@ -788,8 +788,6 @@ void Cutaway::handlePersonRecord( Person p; - _personFaceCount = 0; //Hello, please verify me. (Fixes crash on OSX) - if (object.objectNumber == OBJECT_JOE) { if (object.moveToX || object.moveToY) { _vm->walk()->moveJoe(0, object.moveToX, object.moveToY, true); @@ -874,6 +872,9 @@ void Cutaway::run(char *nextFilename) { _vm->logic()->sceneStart(); } + memset(_personFace, 0, sizeof(_personFace)); + _personFaceCount = 0; + byte *ptr = _objectData; for (i = 0; i < _cutawayObjectCount; i++) { diff --git a/queen/graphics.cpp b/queen/graphics.cpp index adc5444f0c..f55e268d0b 100644 --- a/queen/graphics.cpp +++ b/queen/graphics.cpp @@ -225,22 +225,18 @@ void BankManager::load(const char *bankname, uint32 bankslot) { void BankManager::unpack(uint32 srcframe, uint32 dstframe, uint32 bankslot) { debug(9, "BankManager::unpack(%d, %d, %d)", srcframe, dstframe, bankslot); - - uint8 *p = _banks[bankslot].data + _banks[bankslot].indexes[srcframe]; - if (!_banks[bankslot].data) - error("BankManager::bankUnpack(%i, %i, %i) called but _banks[bankslot].data is NULL!", - srcframe, dstframe, bankslot); + error("BankManager::unpack() _banks[bankslot].data is NULL!"); BobFrame *pbf = &_frames[dstframe]; - delete[] pbf->data; - + uint8 *p = _banks[bankslot].data + _banks[bankslot].indexes[srcframe]; pbf->width = READ_LE_UINT16(p + 0); pbf->height = READ_LE_UINT16(p + 2); pbf->xhotspot = READ_LE_UINT16(p + 4); pbf->yhotspot = READ_LE_UINT16(p + 6); uint32 size = pbf->width * pbf->height; + delete[] pbf->data; pbf->data = new uint8[ size ]; memcpy(pbf->data, p + 8, size); } @@ -248,6 +244,8 @@ void BankManager::unpack(uint32 srcframe, uint32 dstframe, uint32 bankslot) { void BankManager::overpack(uint32 srcframe, uint32 dstframe, uint32 bankslot) { debug(9, "BankManager::overpack(%d, %d, %d)", srcframe, dstframe, bankslot); + if (!_banks[bankslot].data) + error("BankManager::overpack() _banks[bankslot].data is NULL!"); uint8 *p = _banks[bankslot].data + _banks[bankslot].indexes[srcframe]; uint16 src_w = READ_LE_UINT16(p + 0); @@ -266,7 +264,7 @@ void BankManager::overpack(uint32 srcframe, uint32 dstframe, uint32 bankslot) { void BankManager::close(uint32 bankslot) { debug(9, "BankManager::close(%d)", bankslot); delete[] _banks[bankslot].data; - _banks[bankslot].data = 0; + memset(&_banks[bankslot], 0, sizeof(_banks[bankslot])); } diff --git a/queen/queen.cpp b/queen/queen.cpp index e14ff6dce6..01bcc37fdc 100644 --- a/queen/queen.cpp +++ b/queen/queen.cpp @@ -116,6 +116,10 @@ QueenEngine::~QueenEngine() { void QueenEngine::errorString(const char *buf1, char *buf2) { strcpy(buf2, buf1); + if (_debugger && !_debugger->isAttached()) { + _debugger->attach(buf2); + _debugger->onFrame(); + } } |