From a5f417b1e5d5bef14dc9fc596fb416a98a7fd144 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Fri, 3 Feb 2017 10:13:16 +0100 Subject: [PATCH] - removed all uses of BYTE as function return value or functio parameter from the dynamic light code. These were truncating the actual light values. --- src/gl/dynlights/a_dynlight.cpp | 4 ++-- src/gl/dynlights/gl_dynlight.cpp | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/gl/dynlights/a_dynlight.cpp b/src/gl/dynlights/a_dynlight.cpp index e5db739be..1255401ae 100644 --- a/src/gl/dynlights/a_dynlight.cpp +++ b/src/gl/dynlights/a_dynlight.cpp @@ -266,7 +266,7 @@ void ADynamicLight::Tick() case FlickerLight: { - BYTE rnd = randLight(); + int rnd = randLight(); float pct = specialf1 / 360.f; m_currentRadius = float(args[LIGHT_INTENSITY + (rnd >= pct * 255)]); @@ -293,7 +293,7 @@ void ADynamicLight::Tick() // These need some more work elsewhere case ColorFlickerLight: { - BYTE rnd = randLight(); + int rnd = randLight(); float pct = specialf1/360.f; m_currentRadius = m_Radius[rnd >= pct * 255]; diff --git a/src/gl/dynlights/gl_dynlight.cpp b/src/gl/dynlights/gl_dynlight.cpp index c4bef2051..7a548eaa2 100644 --- a/src/gl/dynlights/gl_dynlight.cpp +++ b/src/gl/dynlights/gl_dynlight.cpp @@ -126,8 +126,8 @@ public: void ApplyProperties(ADynamicLight * light) const; FName GetName() const { return m_Name; } 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]; } + void SetArg(int arg, int val) { m_Args[arg] = val; } + int 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; } @@ -648,7 +648,7 @@ void gl_ParseFlickerLight2(FScanner &sc) } if (defaults->GetArg(LIGHT_SECONDARY_INTENSITY) < defaults->GetArg(LIGHT_INTENSITY)) { - BYTE v = defaults->GetArg(LIGHT_SECONDARY_INTENSITY); + int v = defaults->GetArg(LIGHT_SECONDARY_INTENSITY); defaults->SetArg(LIGHT_SECONDARY_INTENSITY, defaults->GetArg(LIGHT_INTENSITY)); defaults->SetArg(LIGHT_INTENSITY, v); }