diff --git a/Aquaria/DSQ.cpp b/Aquaria/DSQ.cpp index 294c7eb..ed24966 100644 --- a/Aquaria/DSQ.cpp +++ b/Aquaria/DSQ.cpp @@ -3528,10 +3528,6 @@ bool DSQ::loadTileset(std::string pack, const unsigned char *usedIdx, size_t use et->tc.u2 = et->tc.u1 + cell; et->tc.v2 = et->tc.v1 + cell; - /*et->tc.v2 = 1 - et->tc.v2; - et->tc.v1 = 1 - et->tc.v1; - std::swap(et->tc.v1,et->tc.v2);*/ - et->w = 512*cell; et->h = 512*cell; diff --git a/BBGE/Texture.cpp b/BBGE/Texture.cpp index b8235b8..be70df6 100644 --- a/BBGE/Texture.cpp +++ b/BBGE/Texture.cpp @@ -43,21 +43,6 @@ void TexCoordBox::setStandard() v2 = 1; } -void TexCoordBox::fixflip() -{ - // HACK: partially repeated textures have a weird Y axis. assuming a repeat factor of 0.4, - // instead of texcoords from 0 -> 0.4 everything is biased towards the opposite end, ie. 0.6 -> 1. - // This is especially true for partial repeats, we always need to bias towards the other end. - // I have no idea why this has to be like this for tiles, but this is NOT the case for fonts. - // And NOTE: without this, maps may look deceivingly correct, but they really are not. - const float percentY = v2 - v1; - const float remainder = 1.0f - fmodf(percentY, 1.0f); - v1 += remainder; // bias towards next int - v2 += remainder; - -} - - Texture::Texture() { gltexid = 0; diff --git a/BBGE/Texture.h b/BBGE/Texture.h index 53358b8..6469af0 100644 --- a/BBGE/Texture.h +++ b/BBGE/Texture.h @@ -31,7 +31,6 @@ struct TexCoordBox bool isStandard() const; void setStandard(); - void fixflip(); // call this after setting up, in case flip is desired }; enum TextureLoadResult diff --git a/BBGE/Tile.cpp b/BBGE/Tile.cpp index e599025..246dd6e 100644 --- a/BBGE/Tile.cpp +++ b/BBGE/Tile.cpp @@ -630,7 +630,14 @@ TexCoordBox TileRepeatData::calcTexCoords(const TileData& t) const tc.v1 = texOffY; tc.u2 = (et.w*t.scalex*texscaleX)/tw + texOffX; tc.v2 = (et.h*t.scaley*texscaleY)/th + texOffY; - //tc.fixflip(); + + // HACK: partially repeated textures have a weird Y axis. assuming a repeat factor of 0.4, + // instead of texcoords from 0 -> 0.4 everything is biased towards the opposite end, ie. 0.6 -> 1. + // This is especially true for partial repeats, we always need to bias towards the other end. + // And NOTE: without this, maps may look deceivingly correct, but they really are not. + tc.v2 = 1 - tc.v2; + tc.v1 = 1 - tc.v1; + std::swap(tc.v1, tc.v2); return tc; }