From: Matthias Braun Date: Tue, 30 Jan 2007 22:29:23 +0000 (+0000) Subject: revert latest UV coordinate changes, as they decrease image quality X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=8b0f957dbd41cdc9e0df1b25ef03eb990770005d;p=supertux.git revert latest UV coordinate changes, as they decrease image quality SVN-Revision: 4751 --- diff --git a/src/video/image_texture.hpp b/src/video/image_texture.hpp index edd0460b3..dccc9bfcc 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 - 0.5) / static_cast (get_width()); + return image_width / static_cast (get_width()); } float get_uv_bottom() const { - return (image_height - 0.5) / static_cast (get_height()); + return image_height / static_cast (get_height()); } void ref() diff --git a/src/video/surface.cpp b/src/video/surface.cpp index c7b1e1bba..23ff69389 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.5 / texture->get_width(); - uv_top = 0.5 / texture->get_height(); + uv_left = 0; + uv_top = 0; uv_right = texture->get_uv_right(); uv_bottom = texture->get_uv_bottom(); @@ -57,10 +57,10 @@ Surface::Surface(const std::string& file, int x, int y, int w, int h) float tex_w = static_cast (texture->get_width()); float tex_h = static_cast (texture->get_height()); - uv_left = static_cast(x+0.5) / tex_w; - uv_top = static_cast(y+0.5) / tex_h; - uv_right = static_cast(x+w-0.5) / tex_w; - uv_bottom = static_cast(y+h-0.5) / tex_h; + uv_left = static_cast(x) / tex_w; + uv_top = static_cast(y) / tex_h; + uv_right = static_cast(x+w) / tex_w; + uv_bottom = static_cast(y+h) / tex_h; width = w; height = h;