revert latest UV coordinate changes, as they decrease image quality
authorMatthias Braun <matze@braunis.de>
Tue, 30 Jan 2007 22:29:23 +0000 (22:29 +0000)
committerMatthias Braun <matze@braunis.de>
Tue, 30 Jan 2007 22:29:23 +0000 (22:29 +0000)
SVN-Revision: 4751

src/video/image_texture.hpp
src/video/surface.cpp

index edd0460..dccc9bf 100644 (file)
@@ -45,12 +45,12 @@ public:
 
   float get_uv_right() const
   {
-    return (image_width - 0.5) / static_cast<float> (get_width());
+    return image_width / static_cast<float> (get_width());
   }
 
   float get_uv_bottom() const
   {
-    return (image_height - 0.5) / static_cast<float> (get_height());
+    return image_height / static_cast<float> (get_height());
   }
 
   void ref()
index c7b1e1b..23ff693 100644 (file)
@@ -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<float> (texture->get_width());
   float tex_h = static_cast<float> (texture->get_height());
-  uv_left = static_cast<float>(x+0.5) / tex_w;
-  uv_top = static_cast<float>(y+0.5) / tex_h;
-  uv_right = static_cast<float>(x+w-0.5) / tex_w;
-  uv_bottom = static_cast<float>(y+h-0.5) / tex_h;
+  uv_left = static_cast<float>(x) / tex_w;
+  uv_top = static_cast<float>(y) / tex_h;
+  uv_right = static_cast<float>(x+w) / tex_w;
+  uv_bottom = static_cast<float>(y+h) / tex_h;
 
   width = w;
   height = h;