Skip to content

Commit ee38bcd

Browse files
committedJun 14, 2015
Automated whitespace error fix for last commit
1 parent 43fcfbf commit ee38bcd

File tree

4 files changed

+54
-54
lines changed

4 files changed

+54
-54
lines changed
 

‎client/shaders/nodes_shader/opengl_vertex.glsl

+40-40
Original file line numberDiff line numberDiff line change
@@ -14,36 +14,36 @@ varying vec3 eyeVec;
1414
varying vec3 lightVec;
1515
varying vec3 tsEyeVec;
1616
varying vec3 tsLightVec;
17-
varying float generate_heightmaps;
17+
varying float generate_heightmaps;
1818

1919
const float e = 2.718281828459;
2020
const float BS = 10.0;
2121

22-
float smoothCurve(float x)
23-
{
24-
return x * x * (3.0 - 2.0 * x);
22+
float smoothCurve(float x)
23+
{
24+
return x * x * (3.0 - 2.0 * x);
2525
}
26-
float triangleWave(float x)
27-
{
28-
return abs(fract(x + 0.5) * 2.0 - 1.0);
26+
float triangleWave(float x)
27+
{
28+
return abs(fract(x + 0.5) * 2.0 - 1.0);
2929
}
30-
float smoothTriangleWave(float x)
31-
{
32-
return smoothCurve(triangleWave(x)) * 2.0 - 1.0;
30+
float smoothTriangleWave(float x)
31+
{
32+
return smoothCurve(triangleWave(x)) * 2.0 - 1.0;
3333
}
3434

3535
void main(void)
3636
{
3737
gl_TexCoord[0] = gl_MultiTexCoord0;
38-
gl_TexCoord[0].y += 0.008;
39-
40-
#if ((DRAW_TYPE == NDT_NORMAL || DRAW_TYPE == NDT_LIQUID || DRAW_TYPE == NDT_FLOWINGLIQUID) && GENERATE_NORMALMAPS)
41-
generate_heightmaps = 1.0;
42-
#else
43-
generate_heightmaps = 0.0;
44-
#endif
45-
46-
#if ((MATERIAL_TYPE == TILE_MATERIAL_LIQUID_TRANSPARENT || MATERIAL_TYPE == TILE_MATERIAL_LIQUID_OPAQUE) && ENABLE_WAVING_WATER)
38+
gl_TexCoord[0].y += 0.008;
39+
40+
#if ((DRAW_TYPE == NDT_NORMAL || DRAW_TYPE == NDT_LIQUID || DRAW_TYPE == NDT_FLOWINGLIQUID) && GENERATE_NORMALMAPS)
41+
generate_heightmaps = 1.0;
42+
#else
43+
generate_heightmaps = 0.0;
44+
#endif
45+
46+
#if ((MATERIAL_TYPE == TILE_MATERIAL_LIQUID_TRANSPARENT || MATERIAL_TYPE == TILE_MATERIAL_LIQUID_OPAQUE) && ENABLE_WAVING_WATER)
4747
vec4 pos = gl_Vertex;
4848
pos.y -= 2.0;
4949

@@ -87,33 +87,33 @@ void main(void)
8787

8888
vPosition = gl_Position.xyz;
8989
worldPosition = (mWorld * gl_Vertex).xyz;
90-
91-
// Don't generate heightmaps when too far from the eye
92-
float dist = distance (worldPosition, eyePosition);
93-
if (dist > 100.00) {
94-
generate_heightmaps = 0.0;
95-
}
96-
90+
91+
// Don't generate heightmaps when too far from the eye
92+
float dist = distance (worldPosition, eyePosition);
93+
if (dist > 100.00) {
94+
generate_heightmaps = 0.0;
95+
}
96+
9797
vec3 sunPosition = vec3 (0.0, eyePosition.y * BS + 900.0, 0.0);
9898

9999
vec3 normal, tangent, binormal;
100100
normal = normalize(gl_NormalMatrix * gl_Normal);
101-
tangent = normalize(gl_NormalMatrix * gl_MultiTexCoord1.xyz);
102-
binormal = normalize(gl_NormalMatrix * -gl_MultiTexCoord2.xyz);
103-
104-
vec3 v;
101+
tangent = normalize(gl_NormalMatrix * gl_MultiTexCoord1.xyz);
102+
binormal = normalize(gl_NormalMatrix * -gl_MultiTexCoord2.xyz);
103+
104+
vec3 v;
105105

106106
lightVec = sunPosition - worldPosition;
107-
v.x = dot(lightVec, tangent);
108-
v.y = dot(lightVec, binormal);
109-
v.z = dot(lightVec, normal);
110-
tsLightVec = v;
111-
112-
eyeVec = -(gl_ModelViewMatrix * gl_Vertex).xyz;
113-
v.x = dot(eyeVec, tangent);
114-
v.y = dot(eyeVec, binormal);
115-
v.z = dot(eyeVec, normal);
116-
tsEyeVec = v;
107+
v.x = dot(lightVec, tangent);
108+
v.y = dot(lightVec, binormal);
109+
v.z = dot(lightVec, normal);
110+
tsLightVec = v;
111+
112+
eyeVec = -(gl_ModelViewMatrix * gl_Vertex).xyz;
113+
v.x = dot(eyeVec, tangent);
114+
v.y = dot(eyeVec, binormal);
115+
v.z = dot(eyeVec, normal);
116+
tsEyeVec = v;
117117

118118
vec4 color;
119119
float day = gl_Color.r;

‎client/shaders/water_surface_shader/opengl_vertex.glsl

+10-10
Original file line numberDiff line numberDiff line change
@@ -18,23 +18,23 @@ varying vec3 tsLightVec;
1818
const float e = 2.718281828459;
1919
const float BS = 10.0;
2020

21-
float smoothCurve(float x)
22-
{
23-
return x * x * (3.0 - 2.0 * x);
21+
float smoothCurve(float x)
22+
{
23+
return x * x * (3.0 - 2.0 * x);
2424
}
25-
float triangleWave(float x)
26-
{
27-
return abs(fract( x + 0.5 ) * 2.0 - 1.0);
25+
float triangleWave(float x)
26+
{
27+
return abs(fract( x + 0.5 ) * 2.0 - 1.0);
2828
}
29-
float smoothTriangleWave(float x)
30-
{
31-
return smoothCurve(triangleWave( x )) * 2.0 - 1.0;
29+
float smoothTriangleWave(float x)
30+
{
31+
return smoothCurve(triangleWave( x )) * 2.0 - 1.0;
3232
}
3333

3434
void main(void)
3535
{
3636
gl_TexCoord[0] = gl_MultiTexCoord0;
37-
37+
3838
#if (MATERIAL_TYPE == TILE_MATERIAL_LIQUID_TRANSPARENT || MATERIAL_TYPE == TILE_MATERIAL_LIQUID_OPAQUE) && ENABLE_WAVING_WATER
3939
vec4 pos = gl_Vertex;
4040
pos.y -= 2.0;

‎src/mapblock_mesh.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1213,7 +1213,7 @@ MapBlockMesh::MapBlockMesh(MeshMakeData *data, v3s16 camera_offset):
12131213
p.tile.applyMaterialOptions(material);
12141214
}
12151215
}
1216-
1216+
12171217
// Create meshbuffer
12181218
scene::SMeshBufferTangents *buf = new scene::SMeshBufferTangents();
12191219
// Set material

‎src/mesh.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ void scaleMesh(scene::IMesh *mesh, v3f scale)
106106
const u32 stride = getVertexPitchFromType(buf->getVertexType());
107107
u32 vertex_count = buf->getVertexCount();
108108
u8 *vertices = (u8 *)buf->getVertices();
109-
for (u32 i = 0; i < vertex_count; i++)
109+
for (u32 i = 0; i < vertex_count; i++)
110110
((video::S3DVertex *)(vertices + i * stride))->Pos *= scale;
111111

112112
buf->recalculateBoundingBox();
@@ -134,7 +134,7 @@ void translateMesh(scene::IMesh *mesh, v3f vec)
134134
const u32 stride = getVertexPitchFromType(buf->getVertexType());
135135
u32 vertex_count = buf->getVertexCount();
136136
u8 *vertices = (u8 *)buf->getVertices();
137-
for (u32 i = 0; i < vertex_count; i++)
137+
for (u32 i = 0; i < vertex_count; i++)
138138
((video::S3DVertex *)(vertices + i * stride))->Pos += vec;
139139

140140
buf->recalculateBoundingBox();
@@ -160,7 +160,7 @@ void setMeshColor(scene::IMesh *mesh, const video::SColor &color)
160160
const u32 stride = getVertexPitchFromType(buf->getVertexType());
161161
u32 vertex_count = buf->getVertexCount();
162162
u8 *vertices = (u8 *)buf->getVertices();
163-
for (u32 i = 0; i < vertex_count; i++)
163+
for (u32 i = 0; i < vertex_count; i++)
164164
((video::S3DVertex *)(vertices + i * stride))->Color = color;
165165
}
166166
}

0 commit comments

Comments
 (0)
Please sign in to comment.