From ed983935ecaa9ef2fd73391d757dd4dbc69f7a87 Mon Sep 17 00:00:00 2001 From: Magnus Norddahl Date: Sat, 3 Nov 2018 19:35:46 +0100 Subject: [PATCH] - class Init functions are so 1995 --- src/level/level_light.cpp | 6 ++---- src/lightmap/lightsurface.cpp | 14 +++++--------- src/lightmap/lightsurface.h | 3 +-- 3 files changed, 8 insertions(+), 15 deletions(-) diff --git a/src/level/level_light.cpp b/src/level/level_light.cpp index cdd4caf..3df76d3 100644 --- a/src/level/level_light.cpp +++ b/src/level/level_light.cpp @@ -274,8 +274,7 @@ void FLevel::CreateLights() desc.rgb.y = ((lightcolor >> 8) & 0xff) / 255.0f; desc.rgb.z = (lightcolor & 0xff) / 255.0f; - auto lightSurface = std::make_unique(); - lightSurface->Init(desc, surface, true); + auto lightSurface = std::make_unique(desc, surface, true); lightSurface->Subdivide(16); //lightSurface->CreateCenterOrigin(); lightSurfaces.push_back(std::move(lightSurface)); @@ -338,8 +337,7 @@ void FLevel::CreateLights() desc.rgb.y = ((lightcolor >> 8) & 0xff) / 255.0f; desc.rgb.z = (lightcolor & 0xff) / 255.0f; - auto lightSurface = std::make_unique(); - lightSurface->Init(desc, surface, false); + auto lightSurface = std::make_unique(desc, surface, false); lightSurface->Subdivide(16); lightSurfaces.push_back(std::move(lightSurface)); numSurfLights++; diff --git a/src/lightmap/lightsurface.cpp b/src/lightmap/lightsurface.cpp index b13860e..dfb0d8a 100644 --- a/src/lightmap/lightsurface.cpp +++ b/src/lightmap/lightsurface.cpp @@ -36,15 +36,7 @@ #include "level/level.h" #include "lightsurface.h" -kexLightSurface::kexLightSurface() -{ -} - -kexLightSurface::~kexLightSurface() -{ -} - -void kexLightSurface::Init(const surfaceLightDef &lightSurfaceDef, surface_t *surface, const bool bWall) +kexLightSurface::kexLightSurface(const surfaceLightDef &lightSurfaceDef, surface_t *surface, const bool bWall) { this->intensity = lightSurfaceDef.intensity; this->distance = lightSurfaceDef.distance; @@ -53,6 +45,10 @@ void kexLightSurface::Init(const surfaceLightDef &lightSurfaceDef, surface_t *su this->bWall = bWall; } +kexLightSurface::~kexLightSurface() +{ +} + // Creates a single origin point if we're not intending on subdividing this light surface void kexLightSurface::CreateCenterOrigin() { diff --git a/src/lightmap/lightsurface.h b/src/lightmap/lightsurface.h index 3422766..0cccdf5 100644 --- a/src/lightmap/lightsurface.h +++ b/src/lightmap/lightsurface.h @@ -35,10 +35,9 @@ struct surfaceLightDef; class kexLightSurface { public: - kexLightSurface(); + kexLightSurface(const surfaceLightDef &lightSurfaceDef, surface_t *surface, const bool bWall); ~kexLightSurface(); - void Init(const surfaceLightDef &lightSurfaceDef, surface_t *surface, const bool bWall); void Subdivide(const float divide); void CreateCenterOrigin(); float TraceSurface(FLevel *doomMap, const surface_t *surface, const kexVec3 &origin);