diff options
author | Gregory Montoir | 2003-10-03 19:59:19 +0000 |
---|---|---|
committer | Gregory Montoir | 2003-10-03 19:59:19 +0000 |
commit | d19c7980fb350359003412eab07b6b29d9b3e9ed (patch) | |
tree | 25bcf6b810a1732837a82c9ca1f44427c74bd3f4 /queen | |
parent | 8fb8ea48ec71b3806ed4d8a27f20bed399b58386 (diff) | |
download | scummvm-rg350-d19c7980fb350359003412eab07b6b29d9b3e9ed.tar.gz scummvm-rg350-d19c7980fb350359003412eab07b6b29d9b3e9ed.tar.bz2 scummvm-rg350-d19c7980fb350359003412eab07b6b29d9b3e9ed.zip |
fix 2 cases not handled in findBob() (stupid me...) and match new/delete
svn-id: r10576
Diffstat (limited to 'queen')
-rw-r--r-- | queen/logic.cpp | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/queen/logic.cpp b/queen/logic.cpp index ff08881946..5307e6ff4f 100644 --- a/queen/logic.cpp +++ b/queen/logic.cpp @@ -31,7 +31,7 @@ QueenLogic::QueenLogic(QueenResource *resource) } QueenLogic::~QueenLogic() { - free (_jas); + delete[] _jas; //free(_graphicData); } @@ -280,16 +280,25 @@ uint16 QueenLogic::findBob(uint16 obj) { ++idxStatic; } } + else if(img == -1) { + ++idxStatic; + } + else if(img == -2) { + ++idxAnimated; + } } - // FIXME: _max*Frame variables should initialized in SETUP_FURNITURE and DISP_ROOM + // FIXME: _max*Frame variables should be initialized in SETUP_FURNITURE and DISP_ROOM if(bobtype == 0) { // static bob - bobnum = 19 + _maxStaticFrame + idxStatic; + if(idxStatic > 0) { + bobnum = 19 + _maxStaticFrame + idxStatic; + } } else { // animated bob - bobnum = 4 + _maxAnimatedFrame + idxAnimated; - + if(idxAnimated > 0) { + bobnum = 4 + _maxAnimatedFrame + idxAnimated; + } } } } @@ -355,7 +364,7 @@ uint16 QueenLogic::findFrame(uint16 obj) { if(img <= -10) { GraphicData* pgd = &_graphicData[-(img + 10)]; if(pgd->lastFrame != 0) { - idx += ABS(pgd->lastFrame - pgd->firstFrame) + 1; + idx += ABS(pgd->lastFrame) - pgd->firstFrame + 1; } else { ++idx; |