[colobot] 346/390: Changed terrain UV mapping (fixes #306 for OpenGL engine, will cause similar problem on Direct3D)
Didier Raboud
odyx at moszumanska.debian.org
Fri Jun 12 14:22:03 UTC 2015
This is an automated email from the git hooks/post-receive script.
odyx pushed a commit to branch upstream/latest
in repository colobot.
commit 3164e7256e6702aa4a53c62f0a6eec143ef30e87
Author: Tomasz Kapuściński <tomaszkax86 at gmail.com>
Date: Thu May 7 12:58:05 2015 +0200
Changed terrain UV mapping (fixes #306 for OpenGL engine, will cause similar problem on Direct3D)
---
src/graphics/engine/terrain.cpp | 16 ++++++++++------
src/graphics/opengl/gldevice.cpp | 2 +-
2 files changed, 11 insertions(+), 7 deletions(-)
diff --git a/src/graphics/engine/terrain.cpp b/src/graphics/engine/terrain.cpp
index b58685b..a97b840 100644
--- a/src/graphics/engine/terrain.cpp
+++ b/src/graphics/engine/terrain.cpp
@@ -637,21 +637,25 @@ bool CTerrain::CreateMosaic(int ox, int oy, int step, int objRank,
p1.coord.x -= o.coord.x; p1.coord.z -= o.coord.z;
p2.coord.x -= o.coord.x; p2.coord.z -= o.coord.z;
+ // TODO: Find portable solution
+ //float offset = 0.5f / 256.0f; // Direct3D
+ float offset = 0.0f; // OpenGL
+
if (x == 0)
{
- p1.texCoord.x = 0.0f+(0.5f/256.0f);
- p2.texCoord.x = 0.0f+(0.5f/256.0f);
+ p1.texCoord.x = 0.0f + offset;
+ p2.texCoord.x = 0.0f + offset;
}
if (x == brick)
{
- p1.texCoord.x = 1.0f-(0.5f/256.0f);
- p2.texCoord.x = 1.0f-(0.5f/256.0f);
+ p1.texCoord.x = 1.0f - offset;
+ p2.texCoord.x = 1.0f - offset;
}
if (y == 0)
- p1.texCoord.y = 1.0f-(0.5f/256.0f);
+ p1.texCoord.y = 1.0f - offset;
if (y == brick - step)
- p2.texCoord.y = 0.0f+(0.5f/256.0f);
+ p2.texCoord.y = 0.0f - offset;
if (m_useMaterials)
{
diff --git a/src/graphics/opengl/gldevice.cpp b/src/graphics/opengl/gldevice.cpp
index 582ed26..8809fd2 100644
--- a/src/graphics/opengl/gldevice.cpp
+++ b/src/graphics/opengl/gldevice.cpp
@@ -550,7 +550,7 @@ Texture CGLDevice::CreateTexture(ImageData *data, const TextureCreateParams &par
glBindTexture(GL_TEXTURE_2D, result.id);
// Set texture parameters
- GLint minF = 0, magF = 0;
+ GLint minF = GL_NEAREST, magF = GL_NEAREST;
int mipmapLevel = 1;
switch (params.filter)
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/colobot.git
More information about the Pkg-games-commits
mailing list