- fixed bug #880415 (only setup bam scene after all _vm->update() calls)

- constness

svn-id: r12564
This commit is contained in:
Gregory Montoir 2004-01-20 21:58:26 +00:00
parent d26fd46cd0
commit ff43b1f8d5
5 changed files with 14 additions and 9 deletions

View file

@ -200,7 +200,7 @@ void Graphics::setupMouseCursor() {
_vm->display()->setMouseCursor(bf->data, bf->width, bf->height); _vm->display()->setMouseCursor(bf->data, bf->width, bf->height);
} }
void Graphics::drawBob(const BobSlot *bs, BobFrame *bf, int16 x, int16 y) { void Graphics::drawBob(const BobSlot *bs, const BobFrame *bf, int16 x, int16 y) {
debug(9, "Graphics::drawBob(%d, %d, %d)", bs->frameNum, x, y); debug(9, "Graphics::drawBob(%d, %d, %d)", bs->frameNum, x, y);
uint16 w, h; uint16 w, h;
@ -410,7 +410,7 @@ BobSlot *Graphics::bob(int index) {
} }
void Graphics::setBobText( void Graphics::setBobText(
BobSlot *pbs, const BobSlot *pbs,
const char *text, const char *text,
int textX, int textY, int textX, int textY,
int color, int flags) { int color, int flags) {

View file

@ -95,7 +95,7 @@ public:
void unpackControlBank(); void unpackControlBank();
void setupMouseCursor(); void setupMouseCursor();
void drawBob(const BobSlot *bs, BobFrame *bf, int16 x, int16 y); void drawBob(const BobSlot *bs, const BobFrame *bf, int16 x, int16 y);
void drawInventoryItem(uint32 frameNum, uint16 x, uint16 y); void drawInventoryItem(uint32 frameNum, uint16 x, uint16 y);
void pasteBob(uint16 objNum, uint16 image); void pasteBob(uint16 objNum, uint16 image);
void shrinkFrame(const BobFrame *bf, uint16 percentage); void shrinkFrame(const BobFrame *bf, uint16 percentage);
@ -105,7 +105,7 @@ public:
void clearBobs(); void clearBobs();
void stopBobs(); void stopBobs();
BobSlot *bob(int index); BobSlot *bob(int index);
void setBobText(BobSlot *bob, const char *text, int textX, int textY, int color, int flags); void setBobText(const BobSlot *bob, const char *text, int textX, int textY, int color, int flags);
void handleParallax(uint16 roomNum); void handleParallax(uint16 roomNum);

View file

@ -282,6 +282,7 @@ void Journal::handleYesNoMode(int16 zoneNum) {
switch (_prevZoneNum) { switch (_prevZoneNum) {
case ZN_REVIEW_ENTRY: case ZN_REVIEW_ENTRY:
if (_saveDescriptions[currentSlot][0]) { if (_saveDescriptions[currentSlot][0]) {
_vm->graphics()->clearBobs();
_vm->display()->palFadeOut(0, 223, JOURNAL_ROOM); _vm->display()->palFadeOut(0, 223, JOURNAL_ROOM);
_vm->loadGameState(currentSlot); _vm->loadGameState(currentSlot);
_vm->display()->clearTexts(0, GAME_SCREEN_HEIGHT - 1); _vm->display()->clearTexts(0, GAME_SCREEN_HEIGHT - 1);

View file

@ -529,7 +529,7 @@ void Logic::displayRoom(uint16 room, RoomDisplayMode mode, uint16 scale, int com
} }
} }
ActorData *Logic::findActor(uint16 noun, const char *name) { ActorData *Logic::findActor(uint16 noun, const char *name) const {
uint16 obj = currentRoomData() + noun; uint16 obj = currentRoomData() + noun;
int16 img = objectData(obj)->image; int16 img = objectData(obj)->image;
if (img != -3 && img != -4) { if (img != -3 && img != -4) {
@ -1362,9 +1362,8 @@ void Logic::loadState(uint32 ver, byte *&ptr) {
} }
void Logic::setupRestoredGame() { void Logic::setupRestoredGame() {
if (_vm->bam()->_flag != BamScene::F_STOP) { uint16 flag = _vm->bam()->_flag;
_vm->bam()->prepareAnimation(); _vm->bam()->_flag = BamScene::F_STOP;
}
_vm->sound()->playSong(_vm->sound()->lastOverride()); _vm->sound()->playSong(_vm->sound()->lastOverride());
@ -1391,6 +1390,11 @@ void Logic::setupRestoredGame() {
_entryObj = 0; _entryObj = 0;
inventoryRefresh(); inventoryRefresh();
if (flag != BamScene::F_STOP) {
_vm->bam()->_flag = flag;
_vm->bam()->prepareAnimation();
}
} }
void Logic::sceneStart() { void Logic::sceneStart() {

View file

@ -128,7 +128,7 @@ public:
int16 entryObj() const { return _entryObj; } int16 entryObj() const { return _entryObj; }
void entryObj(int16 obj) { _entryObj = obj; } void entryObj(int16 obj) { _entryObj = obj; }
ActorData *findActor(uint16 noun, const char *name = NULL); ActorData *findActor(uint16 noun, const char *name = NULL) const;
bool initPerson(uint16 noun, const char *actorName, bool loadBank, Person *pp); bool initPerson(uint16 noun, const char *actorName, bool loadBank, Person *pp);
uint16 findPersonNumber(uint16 obj) const; uint16 findPersonNumber(uint16 obj) const;