mirror of
https://github.com/ZDoom/ZDRay.git
synced 2024-11-22 20:11:11 +00:00
- use subdivide on line surface lights as well
- removed some dead code
This commit is contained in:
parent
a034992280
commit
dce5c510e3
4 changed files with 6 additions and 20 deletions
|
@ -288,12 +288,8 @@ struct thingLight_t
|
|||
|
||||
struct surfaceLightDef
|
||||
{
|
||||
int tag;
|
||||
float distance;
|
||||
float intensity;
|
||||
bool bIgnoreFloor;
|
||||
bool bIgnoreCeiling;
|
||||
bool bNoCenterPoint;
|
||||
kexVec3 rgb;
|
||||
};
|
||||
|
||||
|
|
|
@ -45,14 +45,13 @@ kexLightSurface::~kexLightSurface()
|
|||
{
|
||||
}
|
||||
|
||||
void kexLightSurface::Init(const surfaceLightDef &lightSurfaceDef, surface_t *surface, const bool bWall, const bool bNoCenterPoint)
|
||||
void kexLightSurface::Init(const surfaceLightDef &lightSurfaceDef, surface_t *surface, const bool bWall)
|
||||
{
|
||||
this->intensity = lightSurfaceDef.intensity;
|
||||
this->distance = lightSurfaceDef.distance;
|
||||
this->rgb = lightSurfaceDef.rgb;
|
||||
this->surface = surface;
|
||||
this->bWall = bWall;
|
||||
this->bNoCenterPoint = bNoCenterPoint;
|
||||
}
|
||||
|
||||
// Creates a single origin point if we're not intending on subdividing this light surface
|
||||
|
|
|
@ -39,7 +39,7 @@ public:
|
|||
kexLightSurface();
|
||||
~kexLightSurface();
|
||||
|
||||
void Init(const surfaceLightDef &lightSurfaceDef, surface_t *surface, const bool bWall, const bool bNoCenterPoint);
|
||||
void Init(const surfaceLightDef &lightSurfaceDef, surface_t *surface, const bool bWall);
|
||||
void Subdivide(const float divide);
|
||||
void CreateCenterOrigin();
|
||||
float TraceSurface(FLevel *doomMap, kexTrace &trace, const surface_t *surface, const kexVec3 &origin);
|
||||
|
@ -48,7 +48,6 @@ public:
|
|||
const float Intensity() const { return intensity; }
|
||||
const kexVec3 GetRGB() const { return rgb; }
|
||||
const bool IsAWall() const { return bWall; }
|
||||
const bool NoCenterPoint() const { return bNoCenterPoint; }
|
||||
const surface_t *Surface() const { return surface; }
|
||||
const vertexBatch_t Origins() const { return origins; }
|
||||
|
||||
|
@ -60,7 +59,6 @@ private:
|
|||
float intensity;
|
||||
kexVec3 rgb;
|
||||
bool bWall;
|
||||
bool bNoCenterPoint;
|
||||
vertexBatch_t origins;
|
||||
surface_t *surface;
|
||||
};
|
||||
|
|
|
@ -272,19 +272,16 @@ void FLevel::CreateLights()
|
|||
if (lightdistance > 0.0f && lightintensity > 0.0f && lightcolor != 0)
|
||||
{
|
||||
surfaceLightDef desc;
|
||||
desc.tag = 0;
|
||||
desc.intensity = lightintensity;
|
||||
desc.distance = lightdistance;
|
||||
desc.bIgnoreCeiling = false;
|
||||
desc.bIgnoreFloor = false;
|
||||
desc.bNoCenterPoint = false;
|
||||
desc.rgb.x = ((lightcolor >> 16) & 0xff) / 255.0f;
|
||||
desc.rgb.y = ((lightcolor >> 8) & 0xff) / 255.0f;
|
||||
desc.rgb.z = (lightcolor & 0xff) / 255.0f;
|
||||
|
||||
kexLightSurface *lightSurface = new kexLightSurface();
|
||||
lightSurface->Init(desc, surface, true, false);
|
||||
lightSurface->CreateCenterOrigin();
|
||||
lightSurface->Init(desc, surface, true);
|
||||
lightSurface->Subdivide(16);
|
||||
//lightSurface->CreateCenterOrigin();
|
||||
lightSurfaces.Push(lightSurface);
|
||||
numSurfLights++;
|
||||
}
|
||||
|
@ -339,18 +336,14 @@ void FLevel::CreateLights()
|
|||
if (lightdistance > 0.0f && lightintensity > 0.0f && lightcolor != 0)
|
||||
{
|
||||
surfaceLightDef desc;
|
||||
desc.tag = 0;
|
||||
desc.intensity = lightintensity;
|
||||
desc.distance = lightdistance;
|
||||
desc.bIgnoreCeiling = false;
|
||||
desc.bIgnoreFloor = false;
|
||||
desc.bNoCenterPoint = false;
|
||||
desc.rgb.x = ((lightcolor >> 16) & 0xff) / 255.0f;
|
||||
desc.rgb.y = ((lightcolor >> 8) & 0xff) / 255.0f;
|
||||
desc.rgb.z = (lightcolor & 0xff) / 255.0f;
|
||||
|
||||
kexLightSurface *lightSurface = new kexLightSurface();
|
||||
lightSurface->Init(desc, surface, false, desc.bNoCenterPoint);
|
||||
lightSurface->Init(desc, surface, false);
|
||||
lightSurface->Subdivide(16);
|
||||
lightSurfaces.Push(lightSurface);
|
||||
numSurfLights++;
|
||||
|
|
Loading…
Reference in a new issue