mirror of
https://github.com/ZDoom/raze-gles.git
synced 2024-11-11 07:11:39 +00:00
Lunatic: on palfrom from CON or C, set palsfade{speed,next} and regard prio.
git-svn-id: https://svn.eduke32.com/eduke32@3927 1a8010ca-5511-0410-912e-c29ae57300e0
This commit is contained in:
parent
184a7322de
commit
44f71d313f
3 changed files with 20 additions and 7 deletions
|
@ -1291,8 +1291,12 @@ local player_mt = {
|
|||
-- INTERNAL and CON-only.
|
||||
_palfrom = function(p, f, r,g,b)
|
||||
local pals = p._pals
|
||||
pals.f = f
|
||||
pals.r, pals.g, pals.b = r, g, b
|
||||
-- Assume that CON's palfrom starts with prio 0 and speed 0.
|
||||
if (pals.f == 0 or p._palsfadeprio <= 0) then
|
||||
pals.f = f
|
||||
pals.r, pals.g, pals.b = r, g, b
|
||||
p._palsfadespeed, p._palsfadenext = 0, 0
|
||||
end
|
||||
end,
|
||||
},
|
||||
|
||||
|
|
|
@ -588,7 +588,7 @@ gameevent
|
|||
|
||||
local r, g, b = testbit(neww, 1), testbit(neww, 2), testbit(neww, 4)
|
||||
local speed = FADE_SPEED[neww] or 1
|
||||
player[pli]:fadecol(0.5, r, g, b, speed, neww)
|
||||
player[pli]:fadecol(0.5, r, g, b, speed, neww-5)
|
||||
end
|
||||
}
|
||||
|
||||
|
|
|
@ -347,10 +347,19 @@ static inline int32_t A_Shoot(int32_t i, int32_t atwith)
|
|||
|
||||
static inline void P_PalFrom(DukePlayer_t *p, uint8_t f, uint8_t r, uint8_t g, uint8_t b)
|
||||
{
|
||||
p->pals.f = f;
|
||||
p->pals.r = r;
|
||||
p->pals.g = g;
|
||||
p->pals.b = b;
|
||||
#ifdef LUNATIC
|
||||
// Compare with defs.ilua: player[]:_palfrom().
|
||||
if (p->pals.f == 0 || p->palsfadeprio <= 0)
|
||||
#endif
|
||||
{
|
||||
p->pals.f = f;
|
||||
p->pals.r = r;
|
||||
p->pals.g = g;
|
||||
p->pals.b = b;
|
||||
#ifdef LUNATIC
|
||||
p->palsfadespeed = p->palsfadenext = 0;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
|
||||
int32_t A_GetHitscanRange(int32_t i);
|
||||
|
|
Loading…
Reference in a new issue