Start/stop scenes - fixes missing panel.

svn-id: r11205
This commit is contained in:
David Eriksson 2003-11-08 11:32:32 +00:00
parent 6e2b51233f
commit f243b50215
6 changed files with 46 additions and 13 deletions

View File

@ -1198,8 +1198,8 @@ void Cutaway::run(char *nextFilename) {
_initialRoom = _temporaryRoom = _logic->currentRoom();
// XXX if (_comPanel == 0 || _comPanel == 2)
// XXX SCENE_START(0);
if (_comPanel == 0 || _comPanel == 2)
_logic->sceneStart(false);
byte *ptr = _objectData;
@ -1302,7 +1302,7 @@ void Cutaway::run(char *nextFilename) {
talk(nextFilename);
if (_comPanel == 0 || (_comPanel == 2 && !_anotherCutaway)) {
// XXX SCENE_END(1);
_logic->sceneStop(true);
_comPanel = 0;
}

View File

@ -313,11 +313,12 @@ void Display::palFadeOut(int start, int end, uint16 roomNum) {
void Display::palFadePanel() {
int i;
int i, j;
uint8 tempPal[256 * 3];
for (i = 224 * 3; i <= 255 * 3; ++i) {
tempPal[i] = _pals.screen[i] * 2 / 3;
}
for (i = 224; i < 256; ++i)
for (j = 0; j < 3; j++)
tempPal[i * 3 + j] = _pals.screen[i * 3 + 1] * 2 / 3;
palSet(tempPal, 224, 255, true);
}

View File

@ -79,6 +79,7 @@ public:
void palCustomColors(uint16 roomNum); // check_colors
void palCustomScroll(uint16 roomNum); // check_pal_scroll
void palCustomFlash(); // flashspecial()
void palSetAllDirty() { _pals.dirtyMin = 0; _pals.dirtyMax = 255; }
void screenMode(int comPanel, bool inCutaway);
@ -102,6 +103,8 @@ public:
void fullscreen(bool fs) { _fullscreen = fs; }
bool fullscreen() const { return _fullscreen; }
void panel(bool on) { _panel = on; }
void handleTimer();
void waitForTimer();

View File

@ -381,7 +381,7 @@ void Logic::initialise() {
_settings.speechToggle = true;
_cmd->clear(false);
// XXX SCENE = 0
_scene = 0;
memset(_gameState, 0, sizeof(_gameState));
_graphics->loadPanel();
_graphics->bobSetupControl();
@ -2302,7 +2302,7 @@ void Logic::handlePinnacleRoom() {
_graphics->cameraBob(0);
// XXX COMPANEL=1;
// XXX panelflag=1;
_display->panel(true);
}
@ -2315,6 +2315,30 @@ void Logic::update() {
_input->checkKeys();
}
void Logic::sceneStart(bool showMouseCursor) {
_scene++;
_display->mouseCursorShow(showMouseCursor);
if (1 == _scene && _input->cutawayRunning()) {
_display->panel(false);
_display->palFadePanel();
}
update();
}
void Logic::sceneStop(bool showMouseCursor) {
_scene--;
if (_scene > 0)
return;
_display->palSetAllDirty();
_display->panel(true);
_display->mouseCursorShow(showMouseCursor);
zoneSetupPanel();
}
} // End of namespace Queen

View File

@ -279,6 +279,8 @@ public:
void inventoryDeleteItem(uint16 itemNum, bool refresh = true);
void inventoryScroll(uint16 count, bool up);
void sceneStart(bool showMouseCursor);
void sceneStop(bool showMouseCursor);
//! Copy data from dummy object to object
void objectCopy(int dummyObjectIndex, int objectIndex);
@ -422,6 +424,9 @@ protected:
//! Inventory items
int16 _inventoryItem[4];
//! scene counter
int _scene;
Resource *_resource;
Graphics *_graphics;
Display *_display;

View File

@ -77,11 +77,11 @@ CUTAWAY
action_special_move Cutaway::actionSpecialMove
CUTAWAY() Cutaway::run
MAKE_COMPLEX_ANIM() Cutaway::makeComplexAnimation
SCENE_START()
SCENE_END()
SCENE_START() Logic::sceneStart
SCENE_END() Logic::sceneStop
-
CUTJOEF
CUTON
CUTON Input::_cutawayRunning
CUTQUIT Cutaway::_quit (rename and move to Logic?)
FINAL_ROOM Cutaway::_finalRoom
IROOM Cutaway::_initialRoom
@ -89,7 +89,7 @@ OBJ_CUT
OBJ_ANIM
OLDBANK
PERSON_DATA
SCENE
SCENE Logic::_scene
TROOM Cutaway::_temporaryRoom