From 29fc207062d4ffaa557cceff760f311f2d1f96b9 Mon Sep 17 00:00:00 2001 From: David Eriksson Date: Thu, 16 Oct 2003 16:55:13 +0000 Subject: Make frames array available. svn-id: r10828 --- queen/graphics.cpp | 10 +++++++--- queen/graphics.h | 1 + 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/queen/graphics.cpp b/queen/graphics.cpp index dcf34426df..01046b994e 100644 --- a/queen/graphics.cpp +++ b/queen/graphics.cpp @@ -81,6 +81,10 @@ void Graphics::bankLoad(const char *bankname, uint32 bankslot) { void Graphics::bankUnpack(uint32 srcframe, uint32 dstframe, uint32 bankslot) { uint8 *p = _banks[bankslot].data + _banks[bankslot].indexes[srcframe]; + + if (!_banks[bankslot].data) + error("Graphics::bankUnpack(%i, %i, %i) called but _banks[bankslot].data is NULL!", + srcframe, dstframe, bankslot); BobFrame *pbf = &_frames[dstframe]; delete[] pbf->data; @@ -656,13 +660,13 @@ void Graphics::useJournal() { // GameSettings* pgs } -void Graphics::journalBobSetup(uint32 bobnum, uint16 x, uint16 y, uint16 frame) { - +void Graphics::journalBobSetup(uint32 bobnum, uint16 x, uint16 y, uint16 frameNum) +{ BobSlot *pbs = &_bobs[bobnum]; pbs->active = true; pbs->x = x; pbs->y = y; - pbs->frameNum = FRAMES_JOURNAL + frame; + pbs->frameNum = FRAMES_JOURNAL + frameNum; pbs->box.y2 = GAME_SCREEN_HEIGHT - 1; } diff --git a/queen/graphics.h b/queen/graphics.h index 332897154e..d68d4e8e5e 100644 --- a/queen/graphics.h +++ b/queen/graphics.h @@ -144,6 +144,7 @@ public: void frameErase(uint32 fslot); void frameEraseAll(bool joe); // freeframes, freeallframes + BobFrame *frame(int index) { return _frames + index; } void loadBackdrop(const char *name, uint16 room); void loadPanel(); -- cgit v1.2.3