From 117db06048614b6838bbfd7173aa2a4142c6f987 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Fri, 10 May 2019 01:40:33 +0300 Subject: [PATCH] Disable light-level code as it's not used currently. --- include/corelib.h | 2 +- include/engine.h | 2 +- source/waypoint.cpp | 7 ++++++- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/include/corelib.h b/include/corelib.h index 1bc8151..12b3216 100644 --- a/include/corelib.h +++ b/include/corelib.h @@ -370,7 +370,7 @@ public: red = green = blue = 0; } - inline const int avg (void) const { + inline int avg (void) const { return (red + green + blue) / (sizeof (SimpleColor) / sizeof (int)); } }; diff --git a/include/engine.h b/include/engine.h index 94a4320..e2dc3a9 100644 --- a/include/engine.h +++ b/include/engine.h @@ -407,7 +407,7 @@ private: model_t *m_worldModel; public: - LightMeasure (void) : m_worldModel (nullptr), m_doAnimation (false) { + LightMeasure (void) : m_doAnimation (false), m_worldModel (nullptr) { initializeLightstyles (); m_point.reset (); } diff --git a/source/waypoint.cpp b/source/waypoint.cpp index 25e5297..95ea263 100644 --- a/source/waypoint.cpp +++ b/source/waypoint.cpp @@ -1370,17 +1370,22 @@ void Waypoint::initVisibility (void) { void Waypoint::initLightLevels (void) { // this function get's the light level for each waypoin on the map + // @todo: re-enable when working on flashlights + illum.enableAnimation (false); + return; +#if 0 // no waypoints ? no light levels, and only one-time init if (!m_numWaypoints || !cr::fzero (m_waypointLightLevel[0])) { return; } - engine.print ("!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1"); + // update light levels for all waypoints for (int i = 0; i < m_numWaypoints; i++) { m_waypointLightLevel[i] = illum.getLightLevel (m_paths[i]->origin); } // disable lightstyle animations on finish (will be auto-enabled on mapchange) illum.enableAnimation (false); +#endif } void Waypoint::initTypes (void) {