From aeda5c74f7031ca0452fd527707349f503d33eb2 Mon Sep 17 00:00:00 2001 From: Sam Hocevar Date: Fri, 8 Mar 2013 11:47:55 +0000 Subject: [PATCH] gpu: ugly hack to avoid sprite artifacts on the PS3. --- src/tileset.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/tileset.cpp b/src/tileset.cpp index 5751e102..bb0cf1a2 100644 --- a/src/tileset.cpp +++ b/src/tileset.cpp @@ -179,7 +179,7 @@ ivec2 TileSet::GetSize(int tileid) const vec2 TileSet::GetImageSize() const { - return vec2(data->isize); + return vec2(PotUp(data->isize.x), PotUp(data->isize.y)); } vec2 TileSet::GetTileSize() const @@ -225,6 +225,14 @@ void TileSet::BlitTile(uint32_t id, vec3 pos, int o, vec2 scale, dtx = -dtx; } +#if 1 + /* HACK: tweak UV values */ + tx += (1.f / 128.f) * dtx; + ty += (1.f / 128.f) * dty; + dtx *= 126.f / 128.f; + dty *= 126.f / 128.f; +#endif + if (!data->img && data->m_texture) { float tmp[10];