From 245aa5d3bca88e65097d8b3e77bed8063c9295b1 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 26 Jan 2020 10:58:00 +0100 Subject: [PATCH] - reworked global palette state for robustness. --- source/blood/src/credits.cpp | 6 +- source/blood/src/view.cpp | 2 +- source/build/include/palette.h | 17 ++++- source/build/src/animvpx.cpp | 3 +- source/build/src/palette.cpp | 18 +++-- .../rendering/gl/system/gl_framebuffer.cpp | 2 +- source/duke3d/src/anim.cpp | 32 ++++----- source/duke3d/src/demo.cpp | 2 +- source/duke3d/src/game.cpp | 1 + source/duke3d/src/game.h | 3 +- source/duke3d/src/gameexec.cpp | 4 +- source/duke3d/src/gamestructures.cpp | 2 +- source/duke3d/src/network.cpp | 4 +- source/duke3d/src/osdcmds.cpp | 33 --------- source/duke3d/src/premap.cpp | 2 +- source/duke3d/src/screens.cpp | 24 +++---- source/exhumed/src/enginesubs.cpp | 2 +- source/exhumed/src/light.cpp | 68 ++----------------- source/exhumed/src/menu.cpp | 2 +- source/exhumed/src/movie.cpp | 4 +- source/glbackend/gl_texture.cpp | 2 +- source/glbackend/glbackend.h | 9 --- source/rr/src/anim.cpp | 7 +- source/rr/src/demo.cpp | 2 +- source/rr/src/game.h | 8 +-- source/rr/src/net.cpp | 4 +- source/rr/src/osdcmds.cpp | 34 ---------- source/rr/src/premap.cpp | 2 +- source/rr/src/screens.cpp | 40 +++++------ source/rr/src/sector.cpp | 4 +- source/sw/src/anim.cpp | 6 +- source/sw/src/colormap.cpp | 2 +- source/sw/src/game.cpp | 4 +- 33 files changed, 108 insertions(+), 247 deletions(-) diff --git a/source/blood/src/credits.cpp b/source/blood/src/credits.cpp index d9c6d94db..245b3cb8b 100644 --- a/source/blood/src/credits.cpp +++ b/source/blood/src/credits.cpp @@ -224,8 +224,7 @@ void credPlaySmk(const char *_pzSMK, const char *_pzWAV, int nWav) Smacker_GetPalette(hSMK, palette); paletteSetColorTable(kSMKPal, palette, true); - GLInterface.EnableNonTransparent255(true); - videoSetPalette(0, kSMKPal, 8+2); + videoSetPalette(0, kSMKPal, Pal_Fullscreen); int nScale; @@ -279,8 +278,7 @@ void credPlaySmk(const char *_pzSMK, const char *_pzWAV, int nWav) Smacker_Close(hSMK); inputState.ClearAllInput(); soundEngine->StopAllChannels(); - GLInterface.EnableNonTransparent255(false); - videoSetPalette(0, 0, 8+2); + videoSetPalette(0, 0, 0); tileDelete(kSMKTile); } diff --git a/source/blood/src/view.cpp b/source/blood/src/view.cpp index 92fd31c06..49203d495 100644 --- a/source/blood/src/view.cpp +++ b/source/blood/src/view.cpp @@ -2924,7 +2924,7 @@ void UpdateDacs(int nPalette, bool bNoTint) nGreen = ClipRange(nGreen, -255, 255); nBlue = ClipRange(nBlue, -255, 255); - videoSetPalette(0, nPalette, 2); + videoSetPalette(0, nPalette, 0); videoTintBlood(nRed, nGreen, nBlue); } else diff --git a/source/build/include/palette.h b/source/build/include/palette.h index 09fdd2f6b..d8f7aea16 100644 --- a/source/build/include/palette.h +++ b/source/build/include/palette.h @@ -60,7 +60,22 @@ void paletteSetBlendTable(int32_t blend, const char *tab); void paletteFreeBlendTable(int32_t blend); int32_t paletteSetLookupTable(int32_t palnum, const uint8_t *shtab); void paletteFreeLookupTable(int32_t palnum); -void videoSetPalette(char dabrightness, uint8_t dapalid, uint8_t flags); + +#include "tflags.h" +enum ESetPalFlag +{ + Pal_DontResetFade = 1, + Pal_SceneBrightness = 2, + Pal_Fullscreen = 4, + Pal_2D = 8, +}; + +typedef TFlags ESetPalFlags; + DEFINE_TFLAGS_OPERATORS(ESetPalFlags) + +extern ESetPalFlags curpaletteflags; + +void videoSetPalette(int dabrightness, int dapalid, ESetPalFlags flags); void videoFadePalette(uint8_t r, uint8_t g, uint8_t b, uint8_t offset); #ifdef USE_OPENGL void videoTintBlood(int32_t r, int32_t g, int32_t b); diff --git a/source/build/src/animvpx.cpp b/source/build/src/animvpx.cpp index 34ef50004..567941b71 100644 --- a/source/build/src/animvpx.cpp +++ b/source/build/src/animvpx.cpp @@ -470,7 +470,8 @@ int32_t animvpx_render_frame(animvpx_codec_ctx *codec, double animvpx_aspect) x *= screen->GetWidth() / 2; y *= screen->GetHeight() / 2; - DrawTexture(twod, vpxtex, screen->GetWidth() / 2 - int(x), screen->GetHeight()/2 - int(y), DTA_DestWidth, 2*int(x), DTA_DestHeight, 2*int(y), DTA_Masked, false, DTA_KeepRatio, true, TAG_DONE); + DrawTexture(twod, vpxtex, screen->GetWidth() / 2 - int(x), screen->GetHeight()/2 - int(y), DTA_DestWidth, 2*int(x), DTA_DestHeight, 2*int(y), + DTA_Masked, false, DTA_KeepRatio, true, DTA_LegacyRenderStyle, STYLE_Normal, TAG_DONE); t = timerGetTicks()-t; codec->sumtimes[2] += t; diff --git a/source/build/src/palette.cpp b/source/build/src/palette.cpp index ca018f02a..d92c5ba54 100644 --- a/source/build/src/palette.cpp +++ b/source/build/src/palette.cpp @@ -28,6 +28,7 @@ palette_t curpalette[256]; // the current palette, unadjusted for brightness o palette_t curpalettefaded[256]; // the current palette, adjusted for brightness and tint (ie. what gets sent to the card) palette_t palfadergb = { 0, 0, 0, 0 }; unsigned char palfadedelta = 0; +ESetPalFlags curpaletteflags; int32_t realmaxshade; float frealmaxshade; @@ -715,7 +716,7 @@ void paletteFreeColorTables() // 8: don't gltexinvalidate8() // 16: don't reset palfade* // 32: apply brightness to scene in OpenGL -void videoSetPalette(char dabrightness, uint8_t dapalid, uint8_t flags) +void videoSetPalette(int dabrightness, int dapalid, ESetPalFlags flags) { int32_t i, j; const uint8_t* dapal; @@ -734,14 +735,9 @@ void videoSetPalette(char dabrightness, uint8_t dapalid, uint8_t flags) dapal = basepaltable[curbasepal]; // In-scene brightness mode for RR's thunderstorm. This shouldn't affect the global gamma ramp. - if ((videoGetRenderMode() >= REND_POLYMOST) && (flags & 32)) + if ((videoGetRenderMode() >= REND_POLYMOST) && (flags & Pal_SceneBrightness)) { - if (!(flags & 4)) - { - curbrightness = clamp(dabrightness, 0, 15); - } - - r_scenebrightness = curbrightness; + r_scenebrightness = clamp(dabrightness, 0, 15); } else { @@ -764,15 +760,17 @@ void videoSetPalette(char dabrightness, uint8_t dapalid, uint8_t flags) curpalettefaded[i].f = 0; } - if ((flags & 16) && palfadedelta) // keep the fade + if ((flags & Pal_DontResetFade) && palfadedelta) // keep the fade paletteSetFade(palfadedelta >> 2); - if ((flags & 16) == 0) + if ((flags & Pal_DontResetFade) == 0) { palfadergb.r = palfadergb.g = palfadergb.b = 0; palfadedelta = 0; } + + curpaletteflags = flags; } palette_t paletteGetColor(int32_t col) diff --git a/source/common/rendering/gl/system/gl_framebuffer.cpp b/source/common/rendering/gl/system/gl_framebuffer.cpp index 77243a103..6cc90b407 100644 --- a/source/common/rendering/gl/system/gl_framebuffer.cpp +++ b/source/common/rendering/gl/system/gl_framebuffer.cpp @@ -433,7 +433,7 @@ void OpenGLFrameBuffer::Draw2D() ::DrawFullscreenBlends(); DrawRateStuff(); auto savepal = curbasepal; - if (!GLInterface.NonTransparent255Enabled()) curbasepal = 0; + if (!(curpaletteflags & (Pal_Fullscreen|Pal_2D))) curbasepal = 0; GLInterface.Draw2D(&twodgen); curbasepal = savepal; } diff --git a/source/duke3d/src/anim.cpp b/source/duke3d/src/anim.cpp index a0748abc0..99ee6d6f4 100644 --- a/source/duke3d/src/anim.cpp +++ b/source/duke3d/src/anim.cpp @@ -236,17 +236,17 @@ int32_t Anim_Play(const char *fn) uint16_t framenum = 0; while (videoGetRenderMode() >= REND_POLYMOST) // if, really { - char const * dot = Bstrrchr(fn, '.'); + char const* dot = Bstrrchr(fn, '.'); if (!dot) break; - dukeanim_t const * origanim = anim; - FileReader handle; - if (!Bstrcmp(dot, ".ivf")) + dukeanim_t const* origanim = anim; + FileReader handle; + if (!Bstrcmp(dot, ".ivf")) { - handle = fileSystem.OpenFileReader(fn, 0); - if (!handle.isOpen()) - break; + handle = fileSystem.OpenFileReader(fn, 0); + if (!handle.isOpen()) + break; } else { @@ -257,15 +257,15 @@ int32_t Anim_Play(const char *fn) if (dotpos + 4 >= BMAX_PATH) break; - char *vpxfndot = vpxfn + dotpos; + char* vpxfndot = vpxfn + dotpos; vpxfndot[1] = 'i'; vpxfndot[2] = 'v'; vpxfndot[3] = 'f'; vpxfndot[4] = '\0'; - handle = fileSystem.OpenFileReader(vpxfn, 0); - if (!handle.isOpen()) - break; + handle = fileSystem.OpenFileReader(vpxfn, 0); + if (!handle.isOpen()) + break; anim = Anim_Find(vpxfn); } @@ -299,12 +299,10 @@ int32_t Anim_Play(const char *fn) uint32_t const msecsperframe = scale(info.fpsdenom, 1000, info.fpsnumer); uint32_t nextframetime = timerGetTicks(); - uint8_t *pic; + uint8_t* pic; // OSD_Printf("msecs per frame: %d\n", msecsperframe); - GLInterface.EnableNonTransparent255(true); - do { nextframetime += msecsperframe; @@ -391,7 +389,6 @@ int32_t Anim_Play(const char *fn) } } while (timerGetTicks() < nextframetime); } while (running); - GLInterface.EnableNonTransparent255(false); #ifdef DEBUGGINGAIDS animvpx_print_stats(&codec); #endif @@ -439,9 +436,7 @@ int32_t Anim_Play(const char *fn) paletteSetColorTable(ANIMPAL, ANIM_GetPalette(), true); - // setpalette(0L,256L,tempbuf); - GLInterface.EnableNonTransparent255(true); - P_SetGamePalette(g_player[myconnectindex].ps, ANIMPAL, 8 + 2); + P_SetGamePalette(g_player[myconnectindex].ps, ANIMPAL, Pal_Fullscreen); #ifdef USE_OPENGL if ((anim->frameflags & CUTSCENE_TEXTUREFILTER && hw_texfilter == TEXFILTER_ON) || anim->frameflags & CUTSCENE_FORCEFILTER) @@ -532,7 +527,6 @@ int32_t Anim_Play(const char *fn) } while (i < numframes); end_anim_restore_gl: - GLInterface.EnableNonTransparent255(false); hw_texfilter = ogltexfiltermode; gltexapplyprops(); end_anim: diff --git a/source/duke3d/src/demo.cpp b/source/duke3d/src/demo.cpp index 9e36f88d9..6e581acca 100644 --- a/source/duke3d/src/demo.cpp +++ b/source/duke3d/src/demo.cpp @@ -485,7 +485,7 @@ RECHECK: } fadepal(0,0,0, 0,252,28); - P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 1); // JBF 20040308 + P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 0); // JBF 20040308 G_DrawBackground(); //M_DisplayMenus(); videoNextPage(); diff --git a/source/duke3d/src/game.cpp b/source/duke3d/src/game.cpp index 97d71ffab..d96f89fd0 100644 --- a/source/duke3d/src/game.cpp +++ b/source/duke3d/src/game.cpp @@ -673,6 +673,7 @@ void G_DrawRooms(int32_t playerNum, int32_t smoothRatio) if (pub > 0 || videoGetRenderMode() >= REND_POLYMOST) // JBF 20040101: redraw background always { + videoClearScreen(0); #ifndef EDUKE32_TOUCH_DEVICES if (ud.screen_size >= 8) #endif diff --git a/source/duke3d/src/game.h b/source/duke3d/src/game.h index b8128bd60..02afaf176 100644 --- a/source/duke3d/src/game.h +++ b/source/duke3d/src/game.h @@ -34,6 +34,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "mmulti.h" #include "network.h" #include "menu/menu.h" +#include "palette.h" BEGIN_DUKE_NS @@ -284,7 +285,7 @@ void G_PrintGameQuotes(int32_t snum); void G_Shutdown(void); void G_UpdatePlayerFromMenu(void); void P_DoQuote(int32_t q,DukePlayer_t *p); -void P_SetGamePalette(DukePlayer_t *player, uint32_t palid, int32_t set); +void P_SetGamePalette(DukePlayer_t *player, uint32_t palid, ESetPalFlags flags); #define NEG_ALPHA_TO_BLEND(alpha, blend, orientation) do { \ if (alpha < 0) { blend = -alpha; alpha = 0; orientation |= RS_TRANS1; } \ diff --git a/source/duke3d/src/gameexec.cpp b/source/duke3d/src/gameexec.cpp index 79b3b6dd8..ac2806c20 100644 --- a/source/duke3d/src/gameexec.cpp +++ b/source/duke3d/src/gameexec.cpp @@ -4147,7 +4147,7 @@ badindex: tw = vm.pPlayer->palette; inputState.ClearAllInput(); Anim_Play(quoteMgr.GetQuote(nQuote)); - P_SetGamePalette(vm.pPlayer, tw, 2 + 16); + P_SetGamePalette(vm.pPlayer, tw, Pal_DontResetFade); dispatch(); } @@ -6034,7 +6034,7 @@ badindex: vInstruction(CON_SETGAMEPALETTE): insptr++; - P_SetGamePalette(vm.pPlayer, Gv_GetVar(*(insptr++)), 2 + 16); + P_SetGamePalette(vm.pPlayer, Gv_GetVar(*(insptr++)), Pal_DontResetFade); dispatch(); vInstruction(CON_GETTEXTURECEILING): diff --git a/source/duke3d/src/gamestructures.cpp b/source/duke3d/src/gamestructures.cpp index a721b0f89..1cfc033d2 100644 --- a/source/duke3d/src/gamestructures.cpp +++ b/source/duke3d/src/gamestructures.cpp @@ -934,7 +934,7 @@ void __fastcall VM_SetPlayer(int const playerNum, int const labelNum, int const ps.gotweapon &= ~(1 << lParm2); break; - case PLAYER_PALETTE: P_SetGamePalette(&ps, newValue, 2 + 16); break; + case PLAYER_PALETTE: P_SetGamePalette(&ps, newValue, Pal_DontResetFade); break; case PLAYER_PALS: switch (lParm2) diff --git a/source/duke3d/src/network.cpp b/source/duke3d/src/network.cpp index 80c581c9e..caf2bcf5d 100644 --- a/source/duke3d/src/network.cpp +++ b/source/duke3d/src/network.cpp @@ -4694,7 +4694,7 @@ void Net_WaitForServer(void) if (numplayers < 2 || g_netServer) return; - P_SetGamePalette(g_player[myconnectindex].ps, TITLEPAL, 8 + 2 + 1); + P_SetGamePalette(g_player[myconnectindex].ps, TITLEPAL, Pal_Fullscreen); do { @@ -4720,7 +4720,7 @@ void Net_WaitForServer(void) if (g_player[0].pingcnt > serverReady) { - P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 8 + 2 + 1); + P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 0); return; } } while (1); diff --git a/source/duke3d/src/osdcmds.cpp b/source/duke3d/src/osdcmds.cpp index 6f838eaa0..59c8c59a2 100644 --- a/source/duke3d/src/osdcmds.cpp +++ b/source/duke3d/src/osdcmds.cpp @@ -422,39 +422,6 @@ static int osdcmd_give(osdcmdptr_t parm) return OSDCMD_SHOWHELP; } -void onvideomodechange(int32_t newmode) -{ - uint8_t palid; - - // XXX? - if (!newmode || g_player[screenpeek].ps->palette < BASEPALCOUNT) - palid = g_player[screenpeek].ps->palette; - else - palid = BASEPAL; - -#ifdef POLYMER - if (videoGetRenderMode() == REND_POLYMER) - { - int32_t i = 0; - - while (i < MAXSPRITES) - { - if (actor[i].lightptr) - { - polymer_deletelight(actor[i].lightId); - actor[i].lightptr = NULL; - actor[i].lightId = -1; - } - i++; - } - } -#endif - - videoSetPalette(0, palid, 0); - g_restorePalette = -1; - g_crosshairSum = -1; -} - static int osdcmd_dumpmapstate(osdfuncparm_t const * const) { diff --git a/source/duke3d/src/premap.cpp b/source/duke3d/src/premap.cpp index c7da84b34..211157ba0 100644 --- a/source/duke3d/src/premap.cpp +++ b/source/duke3d/src/premap.cpp @@ -355,7 +355,7 @@ static void G_DoLoadScreen(const char *statustext, int percent) int const screenSize = ud.screen_size; - P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 1); + P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 0); if (statustext == NULL) { diff --git a/source/duke3d/src/screens.cpp b/source/duke3d/src/screens.cpp index 218499502..d9047e441 100644 --- a/source/duke3d/src/screens.cpp +++ b/source/duke3d/src/screens.cpp @@ -78,7 +78,7 @@ static int32_t G_PlaySoundWhileNoInput(int32_t soundnum) #endif ////////// -void P_SetGamePalette(DukePlayer_t *player, uint32_t palid, int32_t set) +void P_SetGamePalette(DukePlayer_t *player, uint32_t palid, ESetPalFlags set) { if (palid >= MAXBASEPALS) palid = 0; @@ -717,7 +717,7 @@ void G_DisplayRest(int32_t smoothratio) int32_t pal = pp->palette; // g_restorePalette < 0: reset tinting, too (e.g. when loading new game) - P_SetGamePalette(pp, pal, 2 + (g_restorePalette>0)*16); + P_SetGamePalette(pp, pal, (g_restorePalette > 0) ? Pal_DontResetFade : ESetPalFlags::FromInt(0)); g_restorePalette = 0; } else @@ -1096,7 +1096,7 @@ void gameDisplayTENScreen() videoSetViewableArea(0, 0, xdim - 1, ydim - 1); renderFlushPerms(); // g_player[myconnectindex].ps->palette = palette; - P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 1); // JBF 20040308 + P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 0); // JBF 20040308 fadepal(0, 0, 0, 0, 252, 28); inputState.ClearAllInput(); totalclock = 0; @@ -1120,7 +1120,7 @@ void gameDisplaySharewareScreens() videoSetViewableArea(0, 0, xdim - 1, ydim - 1); renderFlushPerms(); // g_player[myconnectindex].ps->palette = palette; - P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 1); // JBF 20040308 + P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 0); // JBF 20040308 fadepal(0, 0, 0, 0, 252, 28); inputState.ClearAllInput(); rotatesprite_fs(160 << 16, 100 << 16, 65536L, 0, 3291, 0, 0, 2 + 8 + 64 + BGSTRETCH); @@ -1168,7 +1168,7 @@ void gameDisplay3DRScreen() { videoClearScreen(0); - P_SetGamePalette(g_player[myconnectindex].ps, DREALMSPAL, 8 + 2 + 1); // JBF 20040308 + P_SetGamePalette(g_player[myconnectindex].ps, DREALMSPAL, Pal_Fullscreen); // JBF 20040308 fadepal(0, 0, 0, 0, 252, 28); renderFlushPerms(); rotatesprite_fs(160 << 16, 100 << 16, 65536L, 0, DREALMS, 0, 0, 2 + 8 + 64 + BGSTRETCH); @@ -1206,7 +1206,7 @@ void gameDisplayTitleScreen(void) videoClearScreen(0); // g_player[myconnectindex].ps->palette = titlepal; - P_SetGamePalette(g_player[myconnectindex].ps, TITLEPAL, 8 + 2 + 1); // JBF 20040308 + P_SetGamePalette(g_player[myconnectindex].ps, TITLEPAL, Pal_Fullscreen); // JBF 20040308 renderFlushPerms(); rotatesprite_fs(160 << 16, 100 << 16, 65536L, 0, BETASCREEN, 0, 0, 2 + 8 + 64 + BGSTRETCH); inputState.keyFlushChars(); @@ -1399,7 +1399,7 @@ void G_DisplayLogo(void) void G_DoOrderScreen(void) { videoSetViewableArea(0, 0, xdim-1, ydim-1); - P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 1); // JBF 20040308 + P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 0); // JBF 20040308 for (int i=0; i<4; i++) { @@ -1440,7 +1440,7 @@ static void G_BonusCutscenes(void) 350, 380, VICTORY1+8, 86, 59 // duplicate row to alleviate overflow in the for loop below "boss" }; - P_SetGamePalette(g_player[myconnectindex].ps, ENDINGPAL, 8+2+1); // JBF 20040308 + P_SetGamePalette(g_player[myconnectindex].ps, ENDINGPAL, Pal_2D); // JBF 20040308 videoClearScreen(0L); rotatesprite_fs(0, 50<<16, 65536L, 0, VICTORY1, 0, 0, 2+8+16+64+128+BGSTRETCH); videoNextPage(); @@ -1516,7 +1516,7 @@ static void G_BonusCutscenes(void) goto VOL1_END; inputState.ClearAllInput(); - P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 8+2+1); // JBF 20040308 + P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 0); // JBF 20040308 rotatesprite_fs(160<<16, 100<<16, 65536L, 0, 3292, 0, 0, 2+8+64+BGSTRETCH); fadepal(0, 0, 0, 252, 0, -4); @@ -1555,7 +1555,7 @@ static void G_BonusCutscenes(void) return; inputState.ClearAllInput(); - P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 8+2+1); // JBF 20040308 + P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 0); // JBF 20040308 rotatesprite_fs(160<<16, 100<<16, 65536L, 0, 3293, 0, 0, 2+8+64+BGSTRETCH); fadepal(0, 0, 0, 252, 0, -4); G_HandleEventsWhileNoInput(); @@ -1608,7 +1608,7 @@ static void G_BonusCutscenes(void) goto VOL4_DUKETEAM; G_FadePalette(0, 0, 0, 0); - P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 8+2+1); // JBF 20040308 + P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 0); // JBF 20040308 // G_FadePalette(0,0,0,252); videoClearScreen(0L); menutext_center(60, GStrings("Thanks to all our")); @@ -1892,7 +1892,7 @@ void G_BonusScreen(int32_t bonusonly) G_BonusCutscenes(); #endif - P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 8+2+1); // JBF 20040308 + P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 0); // JBF 20040308 G_FadePalette(0, 0, 0, 252); // JBF 20031228 inputState.keyFlushChars(); totalclock = 0; diff --git a/source/exhumed/src/enginesubs.cpp b/source/exhumed/src/enginesubs.cpp index 17c14ef3a..4dccdd88e 100644 --- a/source/exhumed/src/enginesubs.cpp +++ b/source/exhumed/src/enginesubs.cpp @@ -78,7 +78,7 @@ void kensetpalette(unsigned char *vgapal) Bmemcpy(palette, vgapal, 768); for (auto &i : palette) i <<= 2; - videoSetPalette(0, 0, /*4 | */2); + videoSetPalette(0, 0, 0); #if 0 char vesapal[1024]; diff --git a/source/exhumed/src/light.cpp b/source/exhumed/src/light.cpp index aa0508c3b..a491ab6cc 100644 --- a/source/exhumed/src/light.cpp +++ b/source/exhumed/src/light.cpp @@ -198,7 +198,7 @@ void GrabPalette() { SetOverscan(BASEPAL); - videoSetPalette(0, BASEPAL, 2+8); + videoSetPalette(0, BASEPAL, 0); nPalDiff = 0; nPalDelay = 0; @@ -206,32 +206,19 @@ void GrabPalette() btint = 0; gtint = 0; rtint = 0; -#ifdef USE_OPENGL videoTintBlood(0, 0, 0); -#endif } void BlackOut() { - for (int i = 0; i < 256; i++) - { - curpalettefaded[i].r = 0; - curpalettefaded[i].g = 0; - curpalettefaded[i].b = 0; - } - //videoUpdatePalette(0, 256); g_lastpalettesum = -1; -#ifdef USE_OPENGL videoTintBlood(0, 0, 0); -#endif } void RestorePalette() { - videoSetPalette(0, BASEPAL, 2+8); -#ifdef USE_OPENGL + videoSetPalette(0, BASEPAL, 0); videoTintBlood(0, 0, 0); -#endif } void WaitTicks(int nTicks) @@ -419,7 +406,7 @@ int DoFadeIn() if (videoGetRenderMode() >= REND_POLYMOST) { paletteSetColorTable(curbasepal, basepaltable[BASEPAL]); - videoSetPalette(0, curbasepal, 2+8); + videoSetPalette(0, curbasepal, 0); videoNextPage(); return 0; } @@ -468,7 +455,7 @@ void FadeIn() #ifdef USE_OPENGL if (videoGetRenderMode() >= REND_POLYMOST) { - videoSetPalette(0, BASEPAL, 2+8); + videoSetPalette(0, BASEPAL, 0); videoNextPage(); return; } @@ -501,53 +488,6 @@ void FixPalette() nPalDelay = 5; -#ifdef USE_OPENGL - if (videoGetRenderMode() == REND_CLASSIC) -#endif - for (int i = 0; i < 256; i++) - { - short nVal; - - nVal = curpalettefaded[i].r - curpalette[i].r; - if (nVal > 0) - { - if (nVal > 20) - { - curpalettefaded[i].r -= 20; - } - else - { - curpalettefaded[i].r = curpalette[i].r; - } - } - - nVal = curpalettefaded[i].g - curpalette[i].g; - if (nVal > 0) - { - if (nVal > 20) - { - curpalettefaded[i].g -= 20; - } - else - { - curpalettefaded[i].g = curpalette[i].g; - } - } - - nVal = curpalettefaded[i].b - curpalette[i].b; - if (nVal > 0) - { - if (nVal > 20) - { - curpalettefaded[i].b -= 20; - } - else - { - curpalettefaded[i].b = curpalette[i].b; - } - } - } - nPalDiff -= 20; gtint -= 20; rtint -= 20; diff --git a/source/exhumed/src/menu.cpp b/source/exhumed/src/menu.cpp index 90bb5874d..719abc87a 100644 --- a/source/exhumed/src/menu.cpp +++ b/source/exhumed/src/menu.cpp @@ -1147,7 +1147,7 @@ void CinemaFadeIn() BlackOut(); paletteSetColorTable(ANIMPAL, cinemapal); - videoSetPalette(0, ANIMPAL, 2+8); + videoSetPalette(0, ANIMPAL, Pal_Fullscreen); #ifdef USE_OPENGL if (videoGetRenderMode() >= REND_POLYMOST) diff --git a/source/exhumed/src/movie.cpp b/source/exhumed/src/movie.cpp index 16177aa77..752f7d0f6 100644 --- a/source/exhumed/src/movie.cpp +++ b/source/exhumed/src/movie.cpp @@ -95,7 +95,7 @@ int ReadFrame(FileReader &fp) c <<= 2; paletteSetColorTable(ANIMPAL, palette); - videoSetPalette(0, ANIMPAL, 2+8); + videoSetPalette(0, ANIMPAL, Pal_Fullscreen); memset(CurFrame, overscanindex, 4); //sizeof(CurFrame)); continue; @@ -222,7 +222,7 @@ void PlayMovie(const char* fileName) int angle = 1536; int z = 0; - videoSetPalette(0, ANIMPAL, 2 + 8); + videoSetPalette(0, ANIMPAL, Pal_Fullscreen); // Read a frame in first if (ReadFrame(fp)) diff --git a/source/glbackend/gl_texture.cpp b/source/glbackend/gl_texture.cpp index 4a5c079ea..0d7f0755c 100644 --- a/source/glbackend/gl_texture.cpp +++ b/source/glbackend/gl_texture.cpp @@ -186,7 +186,7 @@ bool GLInstance::SetTextureInternal(int picnum, FTexture* tex, int palette, int applytint = true; if (!(h.f & HICTINT_APPLYOVERPALSWAP)) usepalswap = 0; } - lookuppal = palmanager.LookupPalette(usepalette, usepalswap, false, g_nontransparent255); + lookuppal = palmanager.LookupPalette(usepalette, usepalswap, false,fixpalette < 0? !!(curpaletteflags & Pal_Fullscreen) : 0); } } diff --git a/source/glbackend/glbackend.h b/source/glbackend/glbackend.h index 8609f09a2..0f4c6e1b4 100644 --- a/source/glbackend/glbackend.h +++ b/source/glbackend/glbackend.h @@ -160,7 +160,6 @@ class GLInstance FTexture* currentTexture = nullptr; int TextureType; int MatrixChange = 0; - bool g_nontransparent255 = false; // Ugh... This is for movie playback and needs to be maintained as global state. // Cached GL state. GLState lastState; @@ -198,14 +197,6 @@ public: void DrawElement(EDrawType type, size_t start, size_t count, PolymostRenderState& renderState); FHardwareTexture* NewTexture(); - void EnableNonTransparent255(bool on) - { - g_nontransparent255 = on; - } - bool NonTransparent255Enabled() - { - return g_nontransparent255; - } void SetVertexBuffer(IVertexBuffer* vb, int offset1, int offset2); void SetIndexBuffer(IIndexBuffer* vb); diff --git a/source/rr/src/anim.cpp b/source/rr/src/anim.cpp index 4096a7fdf..836ad5c7e 100644 --- a/source/rr/src/anim.cpp +++ b/source/rr/src/anim.cpp @@ -339,7 +339,6 @@ int32_t Anim_Play(const char *fn) // OSD_Printf("msecs per frame: %d\n", msecsperframe); - GLInterface.EnableNonTransparent255(true); do { nextframetime += msecsperframe; @@ -421,7 +420,6 @@ int32_t Anim_Play(const char *fn) } } while (timerGetTicks() < nextframetime); } while (running); - GLInterface.EnableNonTransparent255(false); #ifdef DEBUGGINGAIDS animvpx_print_stats(&codec); @@ -478,9 +476,7 @@ int32_t Anim_Play(const char *fn) paletteSetColorTable(ANIMPAL, ANIM_GetPalette(), true); - // setpalette(0L,256L,tempbuf); - GLInterface.EnableNonTransparent255(true); - P_SetGamePalette(g_player[myconnectindex].ps, ANIMPAL, 8 + 2); + P_SetGamePalette(g_player[myconnectindex].ps, ANIMPAL, Pal_Fullscreen); ototalclock = totalclock; @@ -564,7 +560,6 @@ int32_t Anim_Play(const char *fn) } while (i < numframes); end_anim_restore_gl: - GLInterface.EnableNonTransparent255(false); hw_texfilter = ogltexfiltermode; gltexapplyprops(); end_anim: diff --git a/source/rr/src/demo.cpp b/source/rr/src/demo.cpp index efcdb66e8..24cb83719 100644 --- a/source/rr/src/demo.cpp +++ b/source/rr/src/demo.cpp @@ -485,7 +485,7 @@ RECHECK: } fadepal(0,0,0, 0,252,28); - P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 1); // JBF 20040308 + P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 0); // JBF 20040308 G_DrawBackground(); //M_DisplayMenus(); videoNextPage(); diff --git a/source/rr/src/game.h b/source/rr/src/game.h index 1109cf492..b2c0a0a92 100644 --- a/source/rr/src/game.h +++ b/source/rr/src/game.h @@ -22,9 +22,6 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #pragma once -#ifndef game_h_ -#define game_h_ - #ifndef ONLY_USERDEFS #include "premap.h" // XXX #endif @@ -34,6 +31,7 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #include "gamedef.h" #include "net.h" #include "mmulti.h" +#include "palette.h" BEGIN_RR_NS @@ -282,7 +280,7 @@ void G_PrintGameQuotes(int32_t snum); void G_Shutdown(void); void G_UpdatePlayerFromMenu(void); void P_DoQuote(int32_t q,DukePlayer_t *p); -void P_SetGamePalette(DukePlayer_t *player, uint32_t palid, int32_t set); +void P_SetGamePalette(DukePlayer_t* player, uint32_t palid, ESetPalFlags flags); void G_OnMotorcycle(DukePlayer_t *pPlayer, int spriteNum); void G_OffMotorcycle(DukePlayer_t *pPlayer); void G_OnBoat(DukePlayer_t *pPlayer, int spriteNum); @@ -495,6 +493,4 @@ EXTERN_INLINE void SetIfGreater(int32_t *variable, int32_t potentialValue) #endif -#endif - END_RR_NS diff --git a/source/rr/src/net.cpp b/source/rr/src/net.cpp index 9beacc794..b0b9176e7 100644 --- a/source/rr/src/net.cpp +++ b/source/rr/src/net.cpp @@ -164,7 +164,7 @@ void Net_WaitForEverybody(void) } - P_SetGamePalette(g_player[myconnectindex].ps, TITLEPAL, 8+2+1); + P_SetGamePalette(g_player[myconnectindex].ps, TITLEPAL, Pal_Fullscreen); do { @@ -199,7 +199,7 @@ void Net_WaitForEverybody(void) if (i != myconnectindex) Net_SendPacket(i, packbuf, 1); } - P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 8+2+1); + P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 0); return; } } diff --git a/source/rr/src/osdcmds.cpp b/source/rr/src/osdcmds.cpp index a7f6ec6ef..d6109b5e8 100644 --- a/source/rr/src/osdcmds.cpp +++ b/source/rr/src/osdcmds.cpp @@ -326,40 +326,6 @@ static int osdcmd_give(osdcmdptr_t parm) return OSDCMD_SHOWHELP; } -void onvideomodechange(int32_t newmode) -{ - uint8_t palid; - - // XXX? - if (!newmode || g_player[screenpeek].ps->palette < BASEPALCOUNT) - palid = g_player[screenpeek].ps->palette; - else - palid = BASEPAL; - -#ifdef POLYMER - if (videoGetRenderMode() == REND_POLYMER) - { - int32_t i = 0; - - while (i < MAXSPRITES) - { - if (actor[i].lightptr) - { - polymer_deletelight(actor[i].lightId); - actor[i].lightptr = NULL; - actor[i].lightId = -1; - } - i++; - } - } -#endif - - videoSetPalette(0, palid, 0); - g_restorePalette = -1; - g_crosshairSum = -1; -} - - #if !defined NETCODE_DISABLE static int osdcmd_disconnect(osdcmdptr_t UNUSED(parm)) { diff --git a/source/rr/src/premap.cpp b/source/rr/src/premap.cpp index 693e132cb..f75f22909 100644 --- a/source/rr/src/premap.cpp +++ b/source/rr/src/premap.cpp @@ -481,7 +481,7 @@ static void G_DoLoadScreen(const char *statustext, int32_t percent) int32_t i = 0; //g_player[myconnectindex].ps->palette = palette; - P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 1); // JBF 20040308 + P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 0); // JBF 20040308 if (!statustext) { diff --git a/source/rr/src/screens.cpp b/source/rr/src/screens.cpp index 908193256..051e16334 100644 --- a/source/rr/src/screens.cpp +++ b/source/rr/src/screens.cpp @@ -77,7 +77,7 @@ static int32_t G_PlaySoundWhileNoInput(int32_t soundnum) } ////////// -void P_SetGamePalette(DukePlayer_t *player, uint32_t palid, int32_t set) +void P_SetGamePalette(DukePlayer_t *player, uint32_t palid, ESetPalFlags set) { if (palid >= MAXBASEPALS) palid = 0; @@ -737,7 +737,7 @@ void G_DisplayRest(int32_t smoothratio) #endif // g_restorePalette < 0: reset tinting, too (e.g. when loading new game) - P_SetGamePalette(pp, pal, 2 + (g_restorePalette>0)*16); + P_SetGamePalette(pp, pal, (g_restorePalette>0)? Pal_DontResetFade : ESetPalFlags::FromInt(0)); #ifdef SPLITSCREEN_MOD_HACKS if (pp2) // keep first player's pal as its member! @@ -1104,7 +1104,7 @@ void G_DisplayExtraScreens(void) videoSetViewableArea(0, 0, xdim-1, ydim-1); renderFlushPerms(); //g_player[myconnectindex].ps->palette = palette; - P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 1); // JBF 20040308 + P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 0); // JBF 20040308 fadepal(0, 0, 0, 0, 252, 28); inputState.ClearAllInput(); rotatesprite_fs(160<<16, 100<<16, 65536L, 0, 3291, 0, 0, 2+8+64+BGSTRETCH); @@ -1131,7 +1131,7 @@ void G_DisplayExtraScreens(void) videoSetViewableArea(0, 0, xdim-1, ydim-1); renderFlushPerms(); //g_player[myconnectindex].ps->palette = palette; - P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 1); // JBF 20040308 + P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 0); // JBF 20040308 fadepal(0, 0, 0, 0, 252, 28); inputState.ClearAllInput(); totalclock = 0; @@ -1257,7 +1257,7 @@ void G_DisplayLogo(void) { videoClearScreen(0); - P_SetGamePalette(g_player[myconnectindex].ps, DREALMSPAL, 8 + 2 + 1); // JBF 20040308 + P_SetGamePalette(g_player[myconnectindex].ps, DREALMSPAL, Pal_Fullscreen); // JBF 20040308 fadepal(0, 0, 0, 0, 252, 28); renderFlushPerms(); rotatesprite_fs(160 << 16, 100 << 16, 65536L, 0, DREALMS, 0, 0, 2 + 8 + 64 + BGSTRETCH); @@ -1297,7 +1297,7 @@ void G_DisplayLogo(void) videoClearScreen(0); //g_player[myconnectindex].ps->palette = titlepal; - P_SetGamePalette(g_player[myconnectindex].ps, TITLEPAL, 8+2+1); // JBF 20040308 + P_SetGamePalette(g_player[myconnectindex].ps, TITLEPAL, Pal_Fullscreen); // JBF 20040308 renderFlushPerms(); rotatesprite_fs(160<<16, 100<<16, 65536L, 0, BETASCREEN, 0, 0, 2+8+64+BGSTRETCH); inputState.keyFlushChars(); @@ -1397,7 +1397,7 @@ void G_DoOrderScreen(void) videoSetViewableArea(0, 0, xdim-1, ydim-1); - P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 1); // JBF 20040308 + P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 0); // JBF 20040308 for (i=0; i<4; i++) { @@ -1437,7 +1437,7 @@ static void G_BonusCutscenes(void) ud.eog = 0; fadepal(0, 0, 0, 0, 252, 4); inputState.ClearAllInput(); - P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 8+2+1); + P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 0); rotatesprite_fs(0, 0, 65536L, 0, TENSCREEN, 0, 0, 2+8+16+64+128+BGSTRETCH); videoNextPage(); fadepal(0, 0, 0, 252, 0, -4); @@ -1464,7 +1464,7 @@ static void G_BonusCutscenes(void) fadepal(0, 0, 0, 0, 252, 4); videoSetViewableArea(0, 0, xdim-1, ydim-1); inputState.ClearAllInput(); - P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 8 + 2 + 1); + P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 0); rotatesprite_fs(0, 0, 65536L, 0, TENSCREEN, 0, 0, 2 + 8 + 16 + 64 + 128 + BGSTRETCH); videoNextPage(); fadepal(0, 0, 0, 252, 0, -4); @@ -1495,7 +1495,7 @@ static void G_BonusCutscenes(void) 350, 380, VICTORY1+8, 86, 59 // duplicate row to alleviate overflow in the for loop below "boss" }; - P_SetGamePalette(g_player[myconnectindex].ps, ENDINGPAL, 8+2+1); // JBF 20040308 + P_SetGamePalette(g_player[myconnectindex].ps, ENDINGPAL, Pal_2D); // JBF 20040308 videoClearScreen(0L); rotatesprite_fs(0, 50<<16, 65536L, 0, VICTORY1, 0, 0, 2+8+16+64+128+BGSTRETCH); videoNextPage(); @@ -1569,7 +1569,7 @@ static void G_BonusCutscenes(void) } inputState.ClearAllInput(); - P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 8+2+1); // JBF 20040308 + P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 0); // JBF 20040308 rotatesprite_fs(160<<16, 100<<16, 65536L, 0, 3292, 0, 0, 2+8+64+BGSTRETCH); fadepal(0, 0, 0, 252, 0, -4); @@ -1601,7 +1601,7 @@ static void G_BonusCutscenes(void) } inputState.ClearAllInput(); - P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 8+2+1); // JBF 20040308 + P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 0); // JBF 20040308 rotatesprite_fs(160<<16, 100<<16, 65536L, 0, 3293, 0, 0, 2+8+64+BGSTRETCH); fadepal(0, 0, 0, 252, 0, -4); G_HandleEventsWhileNoInput(); @@ -1645,7 +1645,7 @@ static void G_BonusCutscenes(void) inputState.ClearAllInput(); G_FadePalette(0, 0, 0, 0); - P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 8+2+1); // JBF 20040308 + P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 0); // JBF 20040308 // G_FadePalette(0,0,0,252); videoClearScreen(0L); menutext_center(60, GStrings("Thanks to all our")); @@ -1908,7 +1908,7 @@ void G_BonusScreen(int32_t bonusonly) if (!bonusonly) G_BonusCutscenes(); - P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 8+2+1); // JBF 20040308 + P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 0); // JBF 20040308 G_FadePalette(0, 0, 0, 252); // JBF 20031228 inputState.keyFlushChars(); totalclock = 0; @@ -2477,17 +2477,17 @@ void G_BonusScreenRRRA(int32_t bonusonly) Mus_Stop(); inputState.keyFlushChars(); - P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 8+2+1); + P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 0); G_ShowMapFrame(); fadepal(0, 0, 0, 252, 0, -4); - P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 8+2+1); + P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 0); } } if (!bonusonly) G_BonusCutscenes(); - P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 8+2+1); // JBF 20040308 + P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 0); // JBF 20040308 //G_FadePalette(0, 0, 0, 252); // JBF 20031228 inputState.keyFlushChars(); totalclock = 0; @@ -2808,7 +2808,7 @@ void G_BonusScreenRRRA(int32_t bonusonly) videoNextPage(); S_PlaySound(35); G_FadePalette(0, 0, 0, 0); - P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 8+2+1); + P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 0); while (1) { switch (((int32_t) totalclock >> 4) & 1) @@ -2817,14 +2817,14 @@ void G_BonusScreenRRRA(int32_t bonusonly) rotatesprite(0,0,65536,0,RRTILE8677,0,0,2+8+16+64+128,0,0,xdim-1,ydim-1); videoNextPage(); G_FadePalette(0, 0, 0, 0); - P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 8+2+1); + P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 0); Net_GetPackets(); break; case 1: rotatesprite(0,0,65536,0,RRTILE8677+1,0,0,2+8+16+64+128,0,0,xdim-1,ydim-1); videoNextPage(); G_FadePalette(0, 0, 0, 0); - P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 8+2+1); + P_SetGamePalette(g_player[myconnectindex].ps, BASEPAL, 0); Net_GetPackets(); break; } diff --git a/source/rr/src/sector.cpp b/source/rr/src/sector.cpp index 7d39a13fa..4bd925a00 100644 --- a/source/rr/src/sector.cpp +++ b/source/rr/src/sector.cpp @@ -5238,7 +5238,7 @@ void G_Thunder(void) { brightness = 0; g_thunderFlash = 0; - videoSetPalette(0,g_player[screenpeek].ps->palette,32); + videoSetPalette(0,g_player[screenpeek].ps->palette,Pal_SceneBrightness); g_visibility = g_player[screenpeek].ps->visibility; } } @@ -5281,7 +5281,7 @@ void G_Thunder(void) g_visibility = 2048; if (brightness > 8) brightness = 0; - videoSetPalette(brightness,g_player[screenpeek].ps->palette,32); + videoSetPalette(brightness,g_player[screenpeek].ps->palette,Pal_SceneBrightness); } if (g_winderFlash == 1) { diff --git a/source/sw/src/anim.cpp b/source/sw/src/anim.cpp index da13b069a..ce75ad348 100644 --- a/source/sw/src/anim.cpp +++ b/source/sw/src/anim.cpp @@ -260,7 +260,7 @@ playanm(short anim_num) videoClearViewableArea(0L); paletteSetColorTable(ANIMPAL, ANIM_GetPalette()); - videoSetPalette(0, ANIMPAL, 2); + videoSetPalette(0, ANIMPAL, Pal_Fullscreen); if (ANIMnum == 1) { // draw the first frame @@ -273,7 +273,6 @@ playanm(short anim_num) //ototalclock = totalclock + 120*2; ototalclock = (int32_t) totalclock; - GLInterface.EnableNonTransparent255(true); for (i = 1; i < numframes; i++) { while (totalclock < ototalclock) @@ -325,11 +324,10 @@ playanm(short anim_num) ENDOFANIMLOOP: - GLInterface.EnableNonTransparent255(false); twod->ClearScreen(); videoNextPage(); - videoSetPalette(0, BASEPAL, 2); + videoSetPalette(0, BASEPAL, 0); inputState.ClearAllInput(); ANIM_FreeAnim(); diff --git a/source/sw/src/colormap.cpp b/source/sw/src/colormap.cpp index b85fb62ce..9145bcb34 100644 --- a/source/sw/src/colormap.cpp +++ b/source/sw/src/colormap.cpp @@ -439,7 +439,7 @@ void SetPaletteToVESA(unsigned char *pal) VBE_setPalette(0, 256, pal_buff); */ paletteSetColorTable(BASEPAL, pal); - videoSetPalette(0, BASEPAL, 4|2); + videoSetPalette(0, BASEPAL, 0); // fprintf(stderr,"SetPaletteToVESA() called\n"); } diff --git a/source/sw/src/game.cpp b/source/sw/src/game.cpp index 5ae37ef1f..b1bcf1b6c 100644 --- a/source/sw/src/game.cpp +++ b/source/sw/src/game.cpp @@ -1451,7 +1451,7 @@ void LogoLevel(void) c <<= 2; paletteSetColorTable(DREALMSPAL, pal.Data()); - videoSetPalette(0, DREALMSPAL, 2); + videoSetPalette(0, DREALMSPAL, Pal_Fullscreen); } DSPRINTF(ds,"Just read in 3drealms.pal..."); MONO_PRINT(ds); @@ -1490,7 +1490,7 @@ void LogoLevel(void) twod->ClearScreen(); videoNextPage(); - videoSetPalette(0, BASEPAL, 2); + videoSetPalette(0, BASEPAL, 0); // put up a blank screen while loading