mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-28 06:42:09 +00:00
This commit is contained in:
commit
53c545d045
4 changed files with 297 additions and 167 deletions
|
@ -1652,7 +1652,11 @@ void PPointer::SetPointer(void *base, unsigned offset, TArray<size_t> *special)
|
|||
|
||||
void PPointer::WriteValue(FSerializer &ar, const char *key,const void *addr) const
|
||||
{
|
||||
if (PointedType->IsKindOf(RUNTIME_CLASS(PClass)))
|
||||
if (PointedType->IsKindOf(RUNTIME_CLASS(PClassClass)))
|
||||
{
|
||||
ar(key, *(PClass **)addr);
|
||||
}
|
||||
else if (PointedType->IsKindOf(RUNTIME_CLASS(PClass)))
|
||||
{
|
||||
ar(key, *(DObject **)addr);
|
||||
}
|
||||
|
@ -1671,7 +1675,13 @@ void PPointer::WriteValue(FSerializer &ar, const char *key,const void *addr) con
|
|||
|
||||
bool PPointer::ReadValue(FSerializer &ar, const char *key, void *addr) const
|
||||
{
|
||||
if (PointedType->IsKindOf(RUNTIME_CLASS(PClass)))
|
||||
if (PointedType->IsKindOf(RUNTIME_CLASS(PClassClass)))
|
||||
{
|
||||
bool res = false;
|
||||
::Serialize(ar, key, *(PClass **)addr, (PClass**)nullptr);
|
||||
return res;
|
||||
}
|
||||
else if (PointedType->IsKindOf(RUNTIME_CLASS(PClass)))
|
||||
{
|
||||
bool res = false;
|
||||
::Serialize(ar, key, *(DObject **)addr, nullptr, &res);
|
||||
|
|
|
@ -78,6 +78,7 @@
|
|||
#include "gl/dynlights/gl_dynlight.h"
|
||||
#include "gl/utility/gl_convert.h"
|
||||
#include "gl/utility/gl_templates.h"
|
||||
#include "gl/system//gl_interface.h"
|
||||
|
||||
|
||||
|
||||
|
@ -126,6 +127,10 @@ void AVavoomLightWhite::BeginPlay ()
|
|||
args[LIGHT_GREEN] = 128;
|
||||
args[LIGHT_BLUE] = 128;
|
||||
|
||||
if (gl.legacyMode && (flags4 & MF4_ATTENUATE))
|
||||
{
|
||||
m_Radius[0] = m_Radius[0] * 2 / 3;
|
||||
}
|
||||
Super::BeginPlay();
|
||||
}
|
||||
|
||||
|
@ -139,6 +144,11 @@ void AVavoomLightColor::BeginPlay ()
|
|||
args[LIGHT_GREEN] = l_args[2] >> 1;
|
||||
args[LIGHT_BLUE] = l_args[3] >> 1;
|
||||
|
||||
if (gl.legacyMode && (flags4 & MF4_ATTENUATE))
|
||||
{
|
||||
m_Radius[0] = m_Radius[0] * 2 / 3;
|
||||
}
|
||||
|
||||
Super::BeginPlay();
|
||||
}
|
||||
|
||||
|
@ -194,6 +204,12 @@ void ADynamicLight::BeginPlay()
|
|||
m_Radius[1] = args[LIGHT_SECONDARY_INTENSITY];
|
||||
specialf1 = DAngle(double(SpawnAngle)).Normalized360().Degrees;
|
||||
visibletoplayer = true;
|
||||
|
||||
if (gl.legacyMode && (flags4 & MF4_ATTENUATE))
|
||||
{
|
||||
m_Radius[0] = m_Radius[0] * 2 / 3;
|
||||
m_Radius[1] = m_Radius[1] * 2 / 3;
|
||||
}
|
||||
}
|
||||
|
||||
//==========================================================================
|
||||
|
|
|
@ -56,6 +56,7 @@
|
|||
#include "gl/utility/gl_clock.h"
|
||||
#include "gl/utility/gl_convert.h"
|
||||
#include "gl/data/gl_data.h"
|
||||
#include "gl/system//gl_interface.h"
|
||||
|
||||
int ScriptDepth;
|
||||
void gl_InitGlow(FScanner &sc);
|
||||
|
@ -126,6 +127,7 @@ public:
|
|||
void SetParameter(double p) { m_Param = p; }
|
||||
void SetArg(int arg, BYTE val) { m_Args[arg] = val; }
|
||||
BYTE GetArg(int arg) { return m_Args[arg]; }
|
||||
uint8_t GetAttenuate() const { return m_attenuate; }
|
||||
void SetOffset(float* ft) { m_Pos.X = ft[0]; m_Pos.Z = ft[1]; m_Pos.Y = ft[2]; }
|
||||
void SetSubtractive(bool subtract) { m_subtractive = subtract; }
|
||||
void SetAdditive(bool add) { m_additive = add; }
|
||||
|
@ -310,6 +312,12 @@ void gl_AddLightDefaults(FLightDefaults *defaults)
|
|||
}
|
||||
}
|
||||
|
||||
if (gl.legacyMode && (defaults->GetAttenuate()))
|
||||
{
|
||||
defaults->SetArg(LIGHT_INTENSITY, defaults->GetArg(LIGHT_INTENSITY) * 2 / 3);
|
||||
defaults->SetArg(LIGHT_SECONDARY_INTENSITY, defaults->GetArg(LIGHT_SECONDARY_INTENSITY) * 2 / 3);
|
||||
}
|
||||
|
||||
LightDefaults.Push(defaults);
|
||||
}
|
||||
|
||||
|
@ -437,11 +445,11 @@ void gl_ParsePulseLight(FScanner &sc)
|
|||
defaults->SetOffset(floatTriple);
|
||||
break;
|
||||
case LIGHTTAG_SIZE:
|
||||
intVal = clamp<int>(gl_ParseInt(sc), 0, 255);
|
||||
intVal = clamp<int>(gl_ParseInt(sc), 0, 1024);
|
||||
defaults->SetArg(LIGHT_INTENSITY, intVal);
|
||||
break;
|
||||
case LIGHTTAG_SECSIZE:
|
||||
intVal = clamp<int>(gl_ParseInt(sc), 0, 255);
|
||||
intVal = clamp<int>(gl_ParseInt(sc), 0, 1024);
|
||||
defaults->SetArg(LIGHT_SECONDARY_INTENSITY, intVal);
|
||||
break;
|
||||
case LIGHTTAG_INTERVAL:
|
||||
|
|
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue