aboutsummaryrefslogtreecommitdiff
path: root/sword1
diff options
context:
space:
mode:
authorRobert Göffringmann2003-12-22 11:23:40 +0000
committerRobert Göffringmann2003-12-22 11:23:40 +0000
commit42cea0975a39b570a2e0a463530a0dc0534db8b3 (patch)
treebbe01b863c02ed97b9cd98ec583491d67c6df421 /sword1
parenta6fb0fd5538a3c04806772df051c0103206fad42 (diff)
downloadscummvm-rg350-42cea0975a39b570a2e0a463530a0dc0534db8b3.tar.gz
scummvm-rg350-42cea0975a39b570a2e0a463530a0dc0534db8b3.tar.bz2
scummvm-rg350-42cea0975a39b570a2e0a463530a0dc0534db8b3.zip
added fnSetPaletteToFade/fnSetPaletteToCut
svn-id: r11851
Diffstat (limited to 'sword1')
-rw-r--r--sword1/logic.cpp4
-rw-r--r--sword1/screen.cpp7
-rw-r--r--sword1/sword1.cpp6
-rw-r--r--sword1/sword1.h1
4 files changed, 10 insertions, 8 deletions
diff --git a/sword1/logic.cpp b/sword1/logic.cpp
index 6dca18d031..7a20c1d5b1 100644
--- a/sword1/logic.cpp
+++ b/sword1/logic.cpp
@@ -889,12 +889,12 @@ int SwordLogic::fnSetFadeTargetPalette(BsObject *cpt, int32 id, int32 spritePal,
}
int SwordLogic::fnSetPaletteToFade(BsObject *cpt, int32 id, int32 c, int32 d, int32 e, int32 f, int32 z, int32 x) {
- warning("fnSetPaletteToFade(xx, %d, %d, %d, %d)", id, c, d, e);
+ SwordEngine::_systemVars.wantFade = true;
return SCRIPT_CONT;
}
int SwordLogic::fnSetPaletteToCut(BsObject *cpt, int32 id, int32 c, int32 d, int32 e, int32 f, int32 z, int32 x) {
- warning("fnSetPaletteToCut(xx, %d, %d, %d, %d)", id, c, d, e);
+ SwordEngine::_systemVars.wantFade = false;
return SCRIPT_CONT;
}
diff --git a/sword1/screen.cpp b/sword1/screen.cpp
index f33437df9d..2e0cf14836 100644
--- a/sword1/screen.cpp
+++ b/sword1/screen.cpp
@@ -30,6 +30,7 @@
#include "common/util.h"
#include "system.h"
#include "menu.h"
+#include "sword1.h"
#define SCROLL_FRACTION 16
#define MAX_SCROLL_DISTANCE 8
@@ -106,7 +107,7 @@ void SwordScreen::fnSetPalette(uint8 start, uint16 length, uint32 id, bool fadeU
memset(_currentPalette, 0, 256 * 4);
_system->set_palette(_currentPalette, 0, 256);
} else
- _system->set_palette(_targetPalette, start, length);
+ _system->set_palette(_targetPalette + 4 * start, start, length);
}
void SwordScreen::refreshPalette(void) {
@@ -259,8 +260,8 @@ void SwordScreen::newScreen(uint32 screen) {
if (_roomDefTable[_currentScreen].parallax[1])
_parallax[1] = (uint8*)_resMan->openFetchRes(_roomDefTable[_currentScreen].parallax[1]);
- fnSetPalette(0, 184, _roomDefTable[_currentScreen].palettes[0], true);
- fnSetPalette(184, 72, _roomDefTable[_currentScreen].palettes[1], true);
+ fnSetPalette(0, 184, _roomDefTable[_currentScreen].palettes[0], SwordEngine::_systemVars.wantFade);
+ fnSetPalette(184, 72, _roomDefTable[_currentScreen].palettes[1], SwordEngine::_systemVars.wantFade);
}
void SwordScreen::quitScreen(void) {
diff --git a/sword1/sword1.cpp b/sword1/sword1.cpp
index bba5628c68..a41f5dd6db 100644
--- a/sword1/sword1.cpp
+++ b/sword1/sword1.cpp
@@ -159,6 +159,7 @@ void SwordEngine::reinitialize(void) {
_objectMan->initialize(); // resources which have just been wiped.
_mouse->initialize();
// todo: reinitialize swordmenu.
+ _systemVars.wantFade = true;
}
void SwordEngine::startPositions(int32 startNumber) {
@@ -1116,9 +1117,8 @@ uint8 SwordEngine::mainLoop(void) {
// do something smart here to implement pausing the game. If we even want that, that is.
} while ((SwordLogic::_scriptVars[SCREEN] == SwordLogic::_scriptVars[NEW_SCREEN]) && (retCode == 0));
- if (retCode == 0) {
- if (SwordLogic::_scriptVars[SCREEN] != 53) // we don't fade down after syria pan (53).
- _screen->fadeDownPalette();
+ if ((retCode == 0) && (SwordLogic::_scriptVars[SCREEN] != 53) && _systemVars.wantFade) {
+ _screen->fadeDownPalette();
while (_screen->stillFading()) {
_music->stream();
_screen->updateScreen();
diff --git a/sword1/sword1.h b/sword1/sword1.h
index 73663515f5..1a93a511e0 100644
--- a/sword1/sword1.h
+++ b/sword1/sword1.h
@@ -46,6 +46,7 @@ struct SystemVars {
uint8 deathScreenFlag; // 1 death screen version of the control panel, 2 = successful end of game, 3 = force restart
bool forceRestart;
+ bool wantFade; // when true => fade during scene change, else cut.
uint8 playSpeech;
uint8 showText;
uint8 language;