Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions SDL2Example/src/MapLayer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ bool MapLayer::create(const tmx::Map& map, std::uint32_t layerIndex, const std::
//tex coords
auto idIndex = (tileIDs[idx].ID - ts.getFirstGID());
float u = static_cast<float>(idIndex % tileCountX);
float v = static_cast<float>(idIndex / tileCountY);
float v = static_cast<float>(idIndex / tileCountX);
u *= mapTileSize.x; //TODO we should be using the tile set size, as this may be different from the map's grid size
v *= mapTileSize.y;

Expand Down Expand Up @@ -131,4 +131,4 @@ void MapLayer::draw(SDL_Renderer* renderer) const
{
SDL_RenderGeometry(renderer, s.texture, s.vertexData.data(), static_cast<std::int32_t>(s.vertexData.size()), nullptr, 0);
}
}
}