Skip to content

Commit

Permalink
MADS: Fix palette setup for credits view
Browse files Browse the repository at this point in the history
  • Loading branch information
dreammaster committed Sep 5, 2014
1 parent 82b2b2d commit 6c25604
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 10 deletions.
12 changes: 3 additions & 9 deletions engines/mads/nebular/dialogs_nebular.cpp
Expand Up @@ -571,7 +571,8 @@ void FullScreenDialog::display() {
int currentSceneId = scene._currentSceneId;
int priorSceneId = scene._priorSceneId;

scene.loadScene(_screenId, game._aaName, _palFlag);
SceneInfo *sceneInfo = SceneInfo::init(_vm);
sceneInfo->load(_screenId, 0, "", 0, scene._depthSurface, scene._backgroundSurface);

scene._priorSceneId = priorSceneId;
scene._currentSceneId = currentSceneId;
Expand All @@ -593,16 +594,9 @@ void FullScreenDialog::display() {
game._fx = _vm->_screenFade == SCREEN_FADE_SMOOTH ? kTransitionFadeIn : kCenterVertTransition;
game._trigger = 0;

_vm->_palette->setEntry(10, 0, 63, 0);
_vm->_palette->setEntry(11, 0, 45, 0);
_vm->_palette->setEntry(12, 63, 63, 0);
_vm->_palette->setEntry(13, 45, 45, 0);
_vm->_palette->setEntry(14, 63, 63, 63);
_vm->_palette->setEntry(15, 45, 45, 45);


// Clear the screen and draw the upper and lower horizontal lines
_vm->_screen.empty();
_vm->_palette->setLowRange();
_vm->_screen.hLine(0, 20, MADS_SCREEN_WIDTH, 2);
_vm->_screen.hLine(0, 179, MADS_SCREEN_WIDTH, 2);
_vm->_screen.copyRectToScreen(Common::Rect(0, 0, MADS_SCREEN_WIDTH, MADS_SCREEN_HEIGHT));
Expand Down
10 changes: 9 additions & 1 deletion engines/mads/nebular/menu_nebular.cpp
Expand Up @@ -625,10 +625,18 @@ void TextView::processText() {
}

void TextView::display() {
MenuView::display();
resetPalette();

FullScreenDialog::display();
_sceneChanged = true;
}

void TextView::resetPalette() {
_vm->_palette->resetGamePalette(8, 8);
_vm->_palette->setEntry(5, 0, 63, 63);
_vm->_palette->setEntry(6, 0, 45, 45);
}

void TextView::doFrame() {
Scene &scene = _vm->_game->_scene;
if (!_animating)
Expand Down
5 changes: 5 additions & 0 deletions engines/mads/nebular/menu_nebular.h
Expand Up @@ -200,6 +200,11 @@ class TextView : public MenuView {
* Called when the script is finished
*/
void scriptDone();

/**
* Reset the game palette
*/
void resetPalette();
protected:
virtual void display();

Expand Down

0 comments on commit 6c25604

Please sign in to comment.