Fixed: Light levels outside the range [0,255] really do matter.

SVN r3223 (trunk)
This commit is contained in:
Randy Heit 2011-06-11 23:58:33 +00:00
commit ee8ca0de87
11 changed files with 97 additions and 48 deletions

View file

@ -21,7 +21,7 @@ DLightningThinker::DLightningThinker ()
LightningFlashCount = 0;
NextLightningFlash = ((pr_lightning()&15)+5)*35; // don't flash at level start
LightningLightLevels = new BYTE[numsectors + (numsectors+7)/8];
LightningLightLevels = new short[numsectors + (numsectors+7)/8];
memset (LightningLightLevels, 0, numsectors + (numsectors+7)/8);
}
@ -36,7 +36,7 @@ DLightningThinker::~DLightningThinker ()
void DLightningThinker::Serialize (FArchive &arc)
{
int i;
BYTE *lights;
short *lights;
Super::Serialize (arc);
@ -48,12 +48,21 @@ void DLightningThinker::Serialize (FArchive &arc)
{
delete[] LightningLightLevels;
}
LightningLightLevels = new BYTE[numsectors + (numsectors+7)/8];
LightningLightLevels = new short[numsectors + (numsectors+7)/8];
}
lights = LightningLightLevels;
for (i = (numsectors + (numsectors+7)/8); i > 0; ++lights, --i)
{
arc << *lights;
if (SaveVersion < 3223)
{
BYTE bytelight;
arc << bytelight;
*lights = bytelight;
}
else
{
arc << *lights;
}
}
}