diff options
Diffstat (limited to 'src/heretic/f_finale.c')
-rw-r--r-- | src/heretic/f_finale.c | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/src/heretic/f_finale.c b/src/heretic/f_finale.c index 7f6b3594..1592dac4 100644 --- a/src/heretic/f_finale.c +++ b/src/heretic/f_finale.c @@ -29,6 +29,7 @@ #include "deh_str.h" #include "i_swap.h" #include "i_video.h" +#include "i_scale.h" #include "s_sound.h" #include "v_video.h" @@ -304,8 +305,15 @@ void F_DemonScroll(void) void F_DrawUnderwater(void) { - static boolean underwawa; + static boolean underwawa = false; extern boolean askforquit; + char *lumpname; + byte *palette; + + // The underwater screen has its own palette, which is rather annoying. + // The palette doesn't correspond to the normal palette. Because of + // this, we must regenerate the lookup tables used in the video scaling + // code. switch (finalestage) { @@ -313,8 +321,12 @@ void F_DrawUnderwater(void) if (!underwawa) { underwawa = true; - memset((byte *) 0xa0000, 0, SCREENWIDTH * SCREENHEIGHT); - I_SetPalette(W_CacheLumpName(DEH_String("E2PAL"), PU_CACHE)); + V_DrawFilledBox(0, 0, SCREENWIDTH, SCREENHEIGHT, 0); + lumpname = DEH_String("E2PAL"); + palette = W_CacheLumpName(lumpname, PU_STATIC); + I_SetPalette(palette); + I_ResetScaleTables(palette); + W_ReleaseLumpName(lumpname); V_DrawRawScreen(W_CacheLumpName(DEH_String("E2END"), PU_CACHE)); } paused = false; @@ -323,6 +335,15 @@ void F_DrawUnderwater(void) break; case 2: + if (underwawa) + { + lumpname = DEH_String("PLAYPAL"); + palette = W_CacheLumpName(lumpname, PU_STATIC); + I_SetPalette(palette); + I_ResetScaleTables(palette); + W_ReleaseLumpName(lumpname); + underwawa = false; + } V_DrawRawScreen(W_CacheLumpName(DEH_String("TITLE"), PU_CACHE)); //D_StartTitle(); // go to intro/demo mode. } |