mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-11 23:32:04 +00:00
- added Gez's fixed palette flashes for Hexen.
SVN r3585 (trunk)
This commit is contained in:
parent
8b875bc32a
commit
44519f3972
4 changed files with 61 additions and 6 deletions
|
@ -37,9 +37,23 @@ public:
|
|||
arc << CHolyCount;
|
||||
}
|
||||
PalEntry GetBlend ()
|
||||
{
|
||||
if (paletteflash & PF_HEXENWEAPONS)
|
||||
{
|
||||
if (CHolyCount == 3)
|
||||
return PalEntry(128, 70, 70, 70);
|
||||
else if (CHolyCount == 2)
|
||||
return PalEntry(128, 100, 100, 100);
|
||||
else if (CHolyCount == 1)
|
||||
return PalEntry(128, 130, 130, 130);
|
||||
else
|
||||
return PalEntry(0, 0, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
return PalEntry (CHolyCount * 128 / 3, 131, 131, 131);
|
||||
}
|
||||
}
|
||||
BYTE CHolyCount;
|
||||
};
|
||||
|
||||
|
|
|
@ -3,6 +3,13 @@
|
|||
|
||||
#include "d_player.h"
|
||||
|
||||
EXTERN_CVAR (Int, paletteflash)
|
||||
enum PaletteFlashFlags
|
||||
{
|
||||
PF_HEXENWEAPONS = 1,
|
||||
PF_SPECIALDAMAGE = 2,
|
||||
};
|
||||
|
||||
class AHolySpirit : public AActor
|
||||
{
|
||||
DECLARE_CLASS (AHolySpirit, AActor)
|
||||
|
|
|
@ -35,9 +35,23 @@ public:
|
|||
arc << MStaffCount;
|
||||
}
|
||||
PalEntry GetBlend ()
|
||||
{
|
||||
if (paletteflash & PF_HEXENWEAPONS)
|
||||
{
|
||||
if (MStaffCount == 3)
|
||||
return PalEntry(128, 100, 73, 0);
|
||||
else if (MStaffCount == 2)
|
||||
return PalEntry(128, 125, 92, 0);
|
||||
else if (MStaffCount == 1)
|
||||
return PalEntry(128, 150, 110, 0);
|
||||
else
|
||||
return PalEntry(0, 0, 0, 0);
|
||||
}
|
||||
else
|
||||
{
|
||||
return PalEntry (MStaffCount * 128 / 3, 151, 110, 0);
|
||||
}
|
||||
}
|
||||
BYTE MStaffCount;
|
||||
};
|
||||
|
||||
|
|
|
@ -52,6 +52,7 @@
|
|||
#include "v_palette.h"
|
||||
#include "d_player.h"
|
||||
#include "farchive.h"
|
||||
#include "a_hexenglobal.h"
|
||||
|
||||
#include "../version.h"
|
||||
|
||||
|
@ -86,6 +87,8 @@ static int CrosshairNum;
|
|||
int BaseBlendR, BaseBlendG, BaseBlendB;
|
||||
float BaseBlendA;
|
||||
|
||||
CVAR (Int, paletteflash, 0, CVAR_ARCHIVE)
|
||||
|
||||
// Stretch status bar to full screen width?
|
||||
CUSTOM_CVAR (Bool, st_scale, true, CVAR_ARCHIVE)
|
||||
{
|
||||
|
@ -1530,7 +1533,7 @@ void DBaseStatusBar::BlendView (float blend[4])
|
|||
|
||||
AddBlend (BaseBlendR / 255.f, BaseBlendG / 255.f, BaseBlendB / 255.f, BaseBlendA, blend);
|
||||
|
||||
// [RH] All powerups can effect the screen blending now
|
||||
// [RH] All powerups can affect the screen blending now
|
||||
for (AInventory *item = CPlayer->mo->Inventory; item != NULL; item = item->Inventory)
|
||||
{
|
||||
PalEntry color = item->GetBlend ();
|
||||
|
@ -1574,20 +1577,37 @@ void DBaseStatusBar::BlendView (float blend[4])
|
|||
// exact numbers to use here, so I've had to guess by looking at how they
|
||||
// affect the white color in Hexen's palette and picking an alpha value
|
||||
// that seems reasonable.
|
||||
// [Gez] The exact values could be obtained by looking how they affect
|
||||
// each color channel in Hexen's palette.
|
||||
|
||||
if (CPlayer->poisoncount)
|
||||
{
|
||||
cnt = MIN (CPlayer->poisoncount, 64);
|
||||
if (paletteflash & PF_SPECIALDAMAGE)
|
||||
{
|
||||
AddBlend(44/255.f, 92/255.f, 36/255.f, ((cnt + 7) >> 3) * 0.1f, blend);
|
||||
}
|
||||
else
|
||||
{
|
||||
AddBlend (0.04f, 0.2571f, 0.f, cnt/93.2571428571f, blend);
|
||||
}
|
||||
|
||||
}
|
||||
if (CPlayer->hazardcount > 16*TICRATE || (CPlayer->hazardcount & 8))
|
||||
{
|
||||
AddBlend (0.f, 1.f, 0.f, 0.125f, blend);
|
||||
}
|
||||
if (CPlayer->mo->DamageType == NAME_Ice)
|
||||
{
|
||||
if (paletteflash & PF_SPECIALDAMAGE)
|
||||
{
|
||||
AddBlend(0.f, 0.f, 224/255.f, 0.5f, blend);
|
||||
}
|
||||
else
|
||||
{
|
||||
AddBlend (0.25f, 0.25f, 0.853f, 0.4f, blend);
|
||||
}
|
||||
}
|
||||
|
||||
if (screen->Accel2D || (CPlayer->camera != NULL && menuactive == MENU_Off && ConsoleState == c_up))
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue