mirror of
https://github.com/ZDoom/Raze.git
synced 2025-03-13 04:24:39 +00:00
- SpriteSetup and related functions.
This commit is contained in:
parent
0c48b4b2c2
commit
843239d085
3 changed files with 332 additions and 343 deletions
|
@ -48,14 +48,14 @@ void SectorLightShade(DSWActor* actor, short intensity)
|
||||||
{
|
{
|
||||||
if (!TEST_BOOL6(sp))
|
if (!TEST_BOOL6(sp))
|
||||||
sp->sector()->floorpal = sp->pal;
|
sp->sector()->floorpal = sp->pal;
|
||||||
sp->sector()->floorshade = LIGHT_FloorShade(sp) + intensity; // floor change
|
sp->sector()->floorshade = LIGHT_FloorShade(actor) + intensity; // floor change
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!TEST_BOOL3(sp))
|
if (!TEST_BOOL3(sp))
|
||||||
{
|
{
|
||||||
if (!TEST_BOOL6(sp))
|
if (!TEST_BOOL6(sp))
|
||||||
sp->sector()->ceilingpal = sp->pal;
|
sp->sector()->ceilingpal = sp->pal;
|
||||||
sp->sector()->ceilingshade = LIGHT_CeilingShade(sp) + intensity; // ceiling change
|
sp->sector()->ceilingshade = LIGHT_CeilingShade(actor) + intensity; // ceiling change
|
||||||
}
|
}
|
||||||
|
|
||||||
// change wall
|
// change wall
|
||||||
|
@ -285,10 +285,10 @@ void DoLighting(void)
|
||||||
|
|
||||||
case LIGHT_FLICKER:
|
case LIGHT_FLICKER:
|
||||||
|
|
||||||
LIGHT_Tics(sp) += synctics;
|
LIGHT_Tics(itActor) += synctics;
|
||||||
while (LIGHT_Tics(sp) >= LIGHT_MaxTics(sp))
|
while (LIGHT_Tics(itActor) >= LIGHT_MaxTics(sp))
|
||||||
{
|
{
|
||||||
LIGHT_Tics(sp) -= LIGHT_MaxTics(sp);
|
LIGHT_Tics(itActor) -= LIGHT_MaxTics(sp);
|
||||||
|
|
||||||
if ((RANDOM_P2(128 << 8) >> 8) > 64)
|
if ((RANDOM_P2(128 << 8) >> 8) > 64)
|
||||||
{
|
{
|
||||||
|
@ -312,11 +312,11 @@ void DoLighting(void)
|
||||||
|
|
||||||
case LIGHT_FADE:
|
case LIGHT_FADE:
|
||||||
|
|
||||||
LIGHT_Tics(sp) += synctics;
|
LIGHT_Tics(itActor) += synctics;
|
||||||
|
|
||||||
while (LIGHT_Tics(sp) >= LIGHT_MaxTics(sp))
|
while (LIGHT_Tics(itActor) >= LIGHT_MaxTics(sp))
|
||||||
{
|
{
|
||||||
LIGHT_Tics(sp) -= LIGHT_MaxTics(sp);
|
LIGHT_Tics(itActor) -= LIGHT_MaxTics(sp);
|
||||||
|
|
||||||
if (LIGHT_Dir(sp) == 1)
|
if (LIGHT_Dir(sp) == 1)
|
||||||
{
|
{
|
||||||
|
@ -339,11 +339,11 @@ void DoLighting(void)
|
||||||
|
|
||||||
case LIGHT_FADE_TO_ON_OFF:
|
case LIGHT_FADE_TO_ON_OFF:
|
||||||
|
|
||||||
LIGHT_Tics(sp) += synctics;
|
LIGHT_Tics(itActor) += synctics;
|
||||||
|
|
||||||
while (LIGHT_Tics(sp) >= LIGHT_MaxTics(sp))
|
while (LIGHT_Tics(itActor) >= LIGHT_MaxTics(sp))
|
||||||
{
|
{
|
||||||
LIGHT_Tics(sp) -= LIGHT_MaxTics(sp);
|
LIGHT_Tics(itActor) -= LIGHT_MaxTics(sp);
|
||||||
|
|
||||||
if (LIGHT_Dir(sp) == 1)
|
if (LIGHT_Dir(sp) == 1)
|
||||||
{
|
{
|
||||||
|
@ -376,11 +376,11 @@ void DoLighting(void)
|
||||||
|
|
||||||
case LIGHT_FLICKER_ON:
|
case LIGHT_FLICKER_ON:
|
||||||
|
|
||||||
LIGHT_Tics(sp) += synctics;
|
LIGHT_Tics(itActor) += synctics;
|
||||||
|
|
||||||
while (LIGHT_Tics(sp) >= LIGHT_MaxTics(sp))
|
while (LIGHT_Tics(itActor) >= LIGHT_MaxTics(sp))
|
||||||
{
|
{
|
||||||
LIGHT_Tics(sp) -= LIGHT_MaxTics(sp);
|
LIGHT_Tics(itActor) -= LIGHT_MaxTics(sp);
|
||||||
|
|
||||||
if ((RANDOM_P2(128 << 8) >> 8) > 64)
|
if ((RANDOM_P2(128 << 8) >> 8) > 64)
|
||||||
{
|
{
|
||||||
|
|
|
@ -45,10 +45,9 @@ inline int8_t LIGHT_MaxDark(spritetype* sp) { return int8_t(SP_TAG6(sp)); }
|
||||||
#define LIGHT_Dir(sp) (!!(TEST((sp)->extra, SPRX_BOOL10)))
|
#define LIGHT_Dir(sp) (!!(TEST((sp)->extra, SPRX_BOOL10)))
|
||||||
#define LIGHT_DirChange(sp) (FLIP((sp)->extra, SPRX_BOOL10))
|
#define LIGHT_DirChange(sp) (FLIP((sp)->extra, SPRX_BOOL10))
|
||||||
|
|
||||||
#define LIGHT_Shade(sp) ((sp)->shade)
|
int8_t& LIGHT_FloorShade(DSWActor* a) { return a->spr.xoffset; }
|
||||||
#define LIGHT_FloorShade(sp) ((sp)->xoffset)
|
int8_t& LIGHT_CeilingShade(DSWActor* a) { return a->spr.yoffset; }
|
||||||
#define LIGHT_CeilingShade(sp) ((sp)->yoffset)
|
int& LIGHT_Tics(DSWActor* a) { return a->spr.pos.Z; }
|
||||||
#define LIGHT_Tics(sp) ((sp)->pos.Z)
|
|
||||||
|
|
||||||
inline int LIGHT_DiffuseNum(DSWActor* sp) { return SP_TAG3(sp); }
|
inline int LIGHT_DiffuseNum(DSWActor* sp) { return SP_TAG3(sp); }
|
||||||
#define LIGHT_DiffuseMult(sp) (SP_TAG4((sp)))
|
#define LIGHT_DiffuseMult(sp) (SP_TAG4((sp)))
|
||||||
|
|
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue