Quellcode durchsuchen

Skybox brightness hotfix

Kenneth van Ewijk vor 9 Jahren
Ursprung
Commit
04fd3ac0e3
1 geänderte Dateien mit 6 neuen und 1 gelöschten Zeilen
  1. 6 1
      Skybox.cpp

+ 6 - 1
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