mirror of
https://github.com/1dot13/source.git
synced 2026-09-09 14:46:05 +02:00
- lighting fix: instant on/off of the light sprite is working now
git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@461 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
+36
-1
@@ -869,6 +869,9 @@ BOOLEAN fFake;
|
|||||||
//else
|
//else
|
||||||
ubShadeAdd=ubShade;
|
ubShadeAdd=ubShade;
|
||||||
|
|
||||||
|
// Lesh: it is not recomended due to problems with roof lighting
|
||||||
|
//if ( uiLightType == LIGHT_TYPE_BRIGHT )
|
||||||
|
// ubShadeAdd += -6;
|
||||||
|
|
||||||
if (uiFlags&LIGHT_FAKE)
|
if (uiFlags&LIGHT_FAKE)
|
||||||
{
|
{
|
||||||
@@ -1009,6 +1012,10 @@ BOOLEAN fFake; // only passed in to land and roof layers; others get fed FALSE
|
|||||||
// else
|
// else
|
||||||
ubShadeSubtract=ubShade;
|
ubShadeSubtract=ubShade;
|
||||||
|
|
||||||
|
// Lesh: it is not recomended due to problems with roof lighting
|
||||||
|
//if ( uiLightType == LIGHT_TYPE_BRIGHT )
|
||||||
|
// ubShadeSubtract += -6;
|
||||||
|
|
||||||
if (uiFlags&LIGHT_FAKE)
|
if (uiFlags&LIGHT_FAKE)
|
||||||
{
|
{
|
||||||
fFake = TRUE;
|
fFake = TRUE;
|
||||||
@@ -3460,11 +3467,39 @@ BOOLEAN LightSpritePower(INT32 iSprite, BOOLEAN fOn)
|
|||||||
{
|
{
|
||||||
if(fOn)
|
if(fOn)
|
||||||
{
|
{
|
||||||
LightSprites[iSprite].uiFlags|=(LIGHT_SPR_ON|LIGHT_SPR_REDRAW);
|
//LightSprites[iSprite].uiFlags|=(LIGHT_SPR_ON|LIGHT_SPR_REDRAW);
|
||||||
|
LightSprites[iSprite].uiFlags|=(LIGHT_SPR_ON);
|
||||||
|
//LightSprites[iSprite].uiFlags&=(~LIGHT_SPR_ERASE);
|
||||||
LightSprites[iSprite].iOldX=WORLD_COLS;
|
LightSprites[iSprite].iOldX=WORLD_COLS;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
LightSprites[iSprite].uiFlags&=(~LIGHT_SPR_ON);
|
LightSprites[iSprite].uiFlags&=(~LIGHT_SPR_ON);
|
||||||
|
//LightSprites[iSprite].uiFlags&=(~LIGHT_SPR_ERASE);
|
||||||
|
LightSprites[iSprite].uiFlags|=(LIGHT_SPR_ERASE);
|
||||||
|
}
|
||||||
|
|
||||||
|
if(LightSprites[iSprite].uiFlags&LIGHT_SPR_ACTIVE)
|
||||||
|
{
|
||||||
|
if(LightSprites[iSprite].uiFlags&LIGHT_SPR_ERASE)
|
||||||
|
{
|
||||||
|
if((LightSprites[iSprite].iX < WORLD_COLS) && (LightSprites[iSprite].iY < WORLD_ROWS))
|
||||||
|
{
|
||||||
|
LightErase(LightSprites[iSprite].uiLightType, LightSprites[iSprite].iTemplate, LightSprites[iSprite].iX, LightSprites[iSprite].iY, iSprite);
|
||||||
|
LightSpriteDirty(iSprite);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(LightSprites[iSprite].uiFlags&LIGHT_SPR_ON)
|
||||||
|
{
|
||||||
|
if((LightSprites[iSprite].iX < WORLD_COLS) && (LightSprites[iSprite].iY < WORLD_ROWS))
|
||||||
|
{
|
||||||
|
LightDraw(LightSprites[iSprite].uiLightType, LightSprites[iSprite].iTemplate, LightSprites[iSprite].iX, LightSprites[iSprite].iY, iSprite);
|
||||||
|
LightSprites[iSprite].uiFlags|=LIGHT_SPR_ERASE;
|
||||||
|
LightSpriteDirty(iSprite);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return(TRUE);
|
return(TRUE);
|
||||||
|
|
||||||
|
|||||||
@@ -74,6 +74,9 @@
|
|||||||
#define COLOR_WHITE 208
|
#define COLOR_WHITE 208
|
||||||
#define COLOR_BLACK 72
|
#define COLOR_BLACK 72
|
||||||
|
|
||||||
|
// Lesh: light types - it is not recomended due to problems with roof lighting
|
||||||
|
//#define LIGHT_TYPE_NORMAL 0
|
||||||
|
//#define LIGHT_TYPE_BRIGHT 1
|
||||||
|
|
||||||
// stucture of node in linked list for lights
|
// stucture of node in linked list for lights
|
||||||
typedef struct light_p {
|
typedef struct light_p {
|
||||||
|
|||||||
Reference in New Issue
Block a user