aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobert Göffringmann2003-05-15 19:14:40 +0000
committerRobert Göffringmann2003-05-15 19:14:40 +0000
commit7fb5bd3a3dcd70212f950c98bcc877143c0de225 (patch)
tree5311d4d5669ddb37cb28ac2d7e5d104eae2688fc
parent2a7ae09b192cc01ea2f96701b6bdb20b76754b8e (diff)
downloadscummvm-rg350-7fb5bd3a3dcd70212f950c98bcc877143c0de225.tar.gz
scummvm-rg350-7fb5bd3a3dcd70212f950c98bcc877143c0de225.tar.bz2
scummvm-rg350-7fb5bd3a3dcd70212f950c98bcc877143c0de225.zip
reordered some intro commands, made fade-in look nicer
svn-id: r7531
-rw-r--r--sky/intro.cpp26
-rw-r--r--sky/screen.cpp29
-rw-r--r--sky/screen.h1
3 files changed, 10 insertions, 46 deletions
diff --git a/sky/intro.cpp b/sky/intro.cpp
index 61c683f553..de26433e1e 100644
--- a/sky/intro.cpp
+++ b/sky/intro.cpp
@@ -25,18 +25,7 @@
#include "sky/skydefs.h"
#include "sky/sky.h"
-//#define WAIT_SEQUENCE while (_tseqFrames != 0) { checkCommands(commandPtr); delay(50); CHECK_ESC }
-//#define CHECK_ESC if (_key_pressed == 27) { _tseqFrames = 0; REMOVE_INTRO return; }
#define FREE_IF_NOT_0(ptr) if (ptr != NULL) { free (ptr); ptr = 0; }
-/*#define REMOVE_INTRO commandPtr = (uint32 *)zeroCommands; \
- FREE_IF_NOT_0(_vgaData) \
- FREE_IF_NOT_0(_diffData) \
- FREE_IF_NOT_0(_workBase) \
- FREE_IF_NOT_0(_tempPal) \
- FREE_IF_NOT_0(seq1) \
- FREE_IF_NOT_0(seq2) \
- FREE_IF_NOT_0(_introTextSpace) \
- FREE_IF_NOT_0(_introTextSave) */
#define REMOVE_INTRO commandPtr = (uint32 *)zeroCommands; \
FREE_IF_NOT_0(_introTextSpace) \
FREE_IF_NOT_0(_introTextSave)
@@ -314,28 +303,21 @@ void SkyState::intro(void) {
free(scrollData);
free(vgaData);
free(diffData);
+ commandPtr = (uint32 *)anim4aCommands;
+ _skyDisk->prefetchFile(FN_4B);
+ _skyDisk->prefetchFile(FN_4B_LOG);
WAIT_SEQUENCE;
- _skyDisk->prefetchFile(FN_4B);
_skyScreen->showScreen(FN_4B_LOG);
-
- /*commandPtr = (uint32 *)anim4aCommands;
- WAIT_SEQUENCE; */
- printf("anim 4A commands skipped.\n");
-
commandPtr = (uint32 *)cockpitCommands;
_skyScreen->startSequence(FN_4B);
-
checkCommands(commandPtr);
checkCommands(commandPtr);
-
- WAIT_SEQUENCE; //4b
-
_skyDisk->prefetchFile(FN_4C);
+ WAIT_SEQUENCE; //4b
_skyScreen->showScreen(FN_4C_LOG);
_skyScreen->startSequence(FN_4C);
-
commandPtr = (uint32 *)anim4cCommands;
WAIT_SEQUENCE; //4c
diff --git a/sky/screen.cpp b/sky/screen.cpp
index 5acc188ad3..6f0d721bae 100644
--- a/sky/screen.cpp
+++ b/sky/screen.cpp
@@ -177,35 +177,18 @@ void SkyScreen::paletteFadeUp(uint8 *pal) {
convertPalette(pal, tmpPal);
- for (uint8 cnt = 0; cnt < 32; cnt++) {
- palette_fadeup_helper((uint32 *)_palette, (uint32 *)tmpPal, GAME_COLOURS);
+ for (uint8 cnt = 1; cnt <= 32; cnt++) {
+ for (uint8 colCnt = 0; colCnt < GAME_COLOURS; colCnt++) {
+ _palette[(colCnt << 2) | 0] = (tmpPal[(colCnt << 2) | 0] * cnt) >> 5;
+ _palette[(colCnt << 2) | 1] = (tmpPal[(colCnt << 2) | 1] * cnt) >> 5;
+ _palette[(colCnt << 2) | 2] = (tmpPal[(colCnt << 2) | 2] * cnt) >> 5;
+ }
_system->set_palette(_palette, 0, GAME_COLOURS);
_system->update_screen();
waitForTimer();
}
}
-void SkyScreen::palette_fadeup_helper(uint32 *realPal, uint32 *desiredPal, int num) {
-
- byte *r = (byte *)realPal;
- byte *d = (byte *)desiredPal;
-
- do {
- if (r[0] < d[0]-8) r[0] += 8;
- else r[0] = d[0];
-
- if (r[1] < d[1]-8) r[1] += 8;
- else r[1] = d[1];
-
- if (r[2] < d[2]-8) r[2] += 8;
- else r[2] = d[2];
-
- r += sizeof(uint32);
- d += sizeof(uint32);
- } while (--num);
-
-}
-
void SkyScreen::waitForTimer(void) {
_gotTick = false;
diff --git a/sky/screen.h b/sky/screen.h
index bcc742117c..f88be28555 100644
--- a/sky/screen.h
+++ b/sky/screen.h
@@ -87,7 +87,6 @@ private:
void convertPalette(uint8 *inPal, uint8* outPal);
void palette_fadedown_helper(uint32 *pal, uint num);
- void palette_fadeup_helper(uint32 *realPal, uint32 *desiredPal, int num);
};
#endif //SKYSCREEN_H