Skip to content

Instantly share code, notes, and snippets.

@sapier
Created July 17, 2014 19:36
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save sapier/7ccc51c71a31f3ab984c to your computer and use it in GitHub Desktop.
diff --git a/src/mapblock_mesh.cpp b/src/mapblock_mesh.cpp
index 581fb8f..0800259 100644
--- a/src/mapblock_mesh.cpp
+++ b/src/mapblock_mesh.cpp
@@ -32,7 +32,7 @@
#include "settings.h"
#include "util/directiontables.h"
-void applyContrast(video::SColor& color, float factor)
+static void applyContrast(video::SColor& color, float factor)
{
color.setRed(core::clamp(core::round32(color.getRed()*factor), 0, 255));
color.setGreen(core::clamp(core::round32(color.getGreen()*factor), 0, 255));
@@ -1144,21 +1144,21 @@ static void updateAllFastFaceRows(MeshMakeData *data,
{
video::SColor &vc = p.vertices[j].Color;
if(p.vertices[j].Normal.Y > 0.5) {
- applyContrast (vc, 1.2);
+ applyContrast (vc, 1.1);
} else if (p.vertices[j].Normal.Y < -0.5) {
- applyContrast (vc, 0.4);
+ applyContrast (vc, 0.55);
} else if (p.vertices[j].Normal.X > 0.5) {
- applyContrast (vc, 0.6);
+ applyContrast (vc, 0.71);
} else if (p.vertices[j].Normal.X < -0.5) {
- applyContrast (vc, 0.6);
+ applyContrast (vc, 0.71);
} else if (p.vertices[j].Normal.Z > 0.5) {
- applyContrast (vc, 0.8);
+ applyContrast (vc, 0.89);
} else if (p.vertices[j].Normal.Z < -0.5) {
- applyContrast (vc, 0.8);
+ applyContrast (vc, 0.89);
}
if(!enable_shaders)
{
- // - Classic lighting (shaders handle this by themselves)
+ // - Classic lighting (shaders handle this by themselves)
// Set initial real color and store for later updates
u8 day = vc.getRed();
u8 night = vc.getGreen();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment