From 6cd71a8644049d1951b5a9702a57ad02a7971c1e Mon Sep 17 00:00:00 2001 From: Matthias Braun Date: Tue, 30 Jan 2007 20:57:14 +0000 Subject: [PATCH] fix all cases of not-optimal UV-coordinates SVN-Revision: 4749 --- src/video/image_texture.hpp | 4 ++-- src/video/surface.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/video/image_texture.hpp b/src/video/image_texture.hpp index dccc9bfcc..edd0460b3 100644 --- a/src/video/image_texture.hpp +++ b/src/video/image_texture.hpp @@ -45,12 +45,12 @@ public: float get_uv_right() const { - return image_width / static_cast (get_width()); + return (image_width - 0.5) / static_cast (get_width()); } float get_uv_bottom() const { - return image_height / static_cast (get_height()); + return (image_height - 0.5) / static_cast (get_height()); } void ref() diff --git a/src/video/surface.cpp b/src/video/surface.cpp index 55e17831d..c7b1e1bba 100644 --- a/src/video/surface.cpp +++ b/src/video/surface.cpp @@ -41,8 +41,8 @@ Surface::Surface(const std::string& file) { texture = texture_manager->get(file); texture->ref(); - uv_left = 0; - uv_top = 0; + uv_left = 0.5 / texture->get_width(); + uv_top = 0.5 / texture->get_height(); uv_right = texture->get_uv_right(); uv_bottom = texture->get_uv_bottom(); -- 2.11.0