Browse Source

gpu: ugly hack to avoid sprite artifacts on the PS3.

legacy
Sam Hocevar sam 12 years ago
parent
commit
aeda5c74f7
1 changed files with 9 additions and 1 deletions
  1. +9
    -1
      src/tileset.cpp

+ 9
- 1
src/tileset.cpp View File

@@ -179,7 +179,7 @@ ivec2 TileSet::GetSize(int tileid) const


vec2 TileSet::GetImageSize() const vec2 TileSet::GetImageSize() const
{ {
return vec2(data->isize);
return vec2(PotUp(data->isize.x), PotUp(data->isize.y));
} }


vec2 TileSet::GetTileSize() const vec2 TileSet::GetTileSize() const
@@ -225,6 +225,14 @@ void TileSet::BlitTile(uint32_t id, vec3 pos, int o, vec2 scale,
dtx = -dtx; 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) if (!data->img && data->m_texture)
{ {
float tmp[10]; float tmp[10];


Loading…
Cancel
Save