From 04fd3ac0e3ce882cd6bb94432c40618600d19a71 Mon Sep 17 00:00:00 2001 From: Kenneth van Ewijk Date: Fri, 10 Jun 2016 11:59:43 +0200 Subject: [PATCH] Skybox brightness hotfix --- Skybox.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Skybox.cpp b/Skybox.cpp index 2b30899..bd91a23 100644 --- a/Skybox.cpp +++ b/Skybox.cpp @@ -124,10 +124,15 @@ void Skybox::update(float deltaTime, int curr, int max) { targetBrightness = 80 + ((255 - 80) / max) * curr; - if (targetBrightness > brightness) + if (targetBrightness > brightness + 2) { brightness += 20 * deltaTime; } + + if (targetBrightness < brightness - 2) + { + brightness -= 20 * deltaTime; + } } GLuint Skybox::loadTexture(const std::string & fileName) //load the filename named texture