From caaf82385b9d1cb9488fbeb262fb4fdb124ddb93 Mon Sep 17 00:00:00 2001 From: fgsfds Date: Thu, 24 Aug 2023 17:53:13 +0200 Subject: [PATCH] port: disable color modulation effects when none are active --- src/game/player.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/game/player.c b/src/game/player.c index 4aa4b8758..ecc9d3330 100644 --- a/src/game/player.c +++ b/src/game/player.c @@ -4491,21 +4491,21 @@ Gfx *playerRenderShield(Gfx *gdl) #ifndef PLATFORM_N64 Gfx *playerSetVisionMode(Gfx *gdl) { - if (g_Vars.currentplayer) { - if (g_Vars.currentplayer->isdead == false - && g_InCutscene == 0 - && (!g_Vars.currentplayer->eyespy || (g_Vars.currentplayer->eyespy && !g_Vars.currentplayer->eyespy->active)) - && ((g_Vars.currentplayer->devicesactive & ~g_Vars.currentplayer->devicesinhibit) & DEVICE_NIGHTVISION)) { - gDPGrayscaleEXT(gdl++, G_ON); + u32 grayscale = G_OFF; + + if (!g_InCutscene && g_Vars.currentplayer && !g_Vars.currentplayer->isdead && + (!g_Vars.currentplayer->eyespy || (g_Vars.currentplayer->eyespy && !g_Vars.currentplayer->eyespy->active))) { + if ((g_Vars.currentplayer->devicesactive & ~g_Vars.currentplayer->devicesinhibit) & DEVICE_NIGHTVISION) { + grayscale = G_ON; gDPSetGrayscaleColorEXT(gdl++, 0x00, 0xFF, 0x00, 0xFF); - } else if (g_Vars.currentplayer->isdead == false - && g_InCutscene == 0 - && (!g_Vars.currentplayer->eyespy || (g_Vars.currentplayer->eyespy && !g_Vars.currentplayer->eyespy->active)) - && ((g_Vars.currentplayer->devicesactive & ~g_Vars.currentplayer->devicesinhibit) & DEVICE_IRSCANNER)) { - gDPGrayscaleEXT(gdl++, G_ON); + } else if ((g_Vars.currentplayer->devicesactive & ~g_Vars.currentplayer->devicesinhibit) & DEVICE_IRSCANNER) { + grayscale = G_ON; gDPSetGrayscaleColorEXT(gdl++, 0xFF, 0x00, 0x00, 0xFF); } } + + gDPGrayscaleEXT(gdl++, grayscale); + return gdl; } #endif