diff options
author | heavydemon21 <nielsstunnebrink1@gmail.com> | 2024-12-22 13:48:46 +0100 |
---|---|---|
committer | heavydemon21 <nielsstunnebrink1@gmail.com> | 2024-12-22 13:48:46 +0100 |
commit | 6a7e06f875d789af0e8f9b5ce0ad24b9eaa96d25 (patch) | |
tree | 07397ab46e2518fde4140777e2e181cde8ad938e /mwe/resource-manager/map_layer.cpp | |
parent | 296c80edd6727d6808ed0c98c001a8b456f1c037 (diff) | |
parent | 61148c757a1f742ff09e40e5347e74e638c7371c (diff) |
Merge branch 'master' into niels/UI
Diffstat (limited to 'mwe/resource-manager/map_layer.cpp')
-rw-r--r-- | mwe/resource-manager/map_layer.cpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/mwe/resource-manager/map_layer.cpp b/mwe/resource-manager/map_layer.cpp index 17792a6..82f8f24 100644 --- a/mwe/resource-manager/map_layer.cpp +++ b/mwe/resource-manager/map_layer.cpp @@ -9,8 +9,9 @@ MapLayer::MapLayer() {} MapLayer::~MapLayer() { m_subsets.clear(); } -bool MapLayer::create(const tmx::Map & map, std::uint32_t layerIndex, - const std::vector<TextureMap *> & textures) { +bool MapLayer::create( + const tmx::Map & map, std::uint32_t layerIndex, const std::vector<TextureMap *> & textures +) { const auto & layers = map.getLayers(); assert(layers[layerIndex]->getType() == tmx::Layer::Type::Tile); @@ -68,9 +69,10 @@ bool MapLayer::create(const tmx::Map & map, std::uint32_t layerIndex, verts.emplace_back(vert); vert = {{tilePosX + mapTileSize.x, tilePosY}, vertColour, {u + uNorm, v}}; verts.emplace_back(vert); - vert = {{tilePosX + mapTileSize.x, tilePosY + mapTileSize.y}, - vertColour, - {u + uNorm, v + vNorm}}; + vert + = {{tilePosX + mapTileSize.x, tilePosY + mapTileSize.y}, + vertColour, + {u + uNorm, v + vNorm}}; verts.emplace_back(vert); } } @@ -89,7 +91,9 @@ bool MapLayer::create(const tmx::Map & map, std::uint32_t layerIndex, void MapLayer::draw(SDL_Renderer * renderer) const { assert(renderer); for (const auto & s : m_subsets) { - SDL_RenderGeometry(renderer, s.texture, s.vertexData.data(), - static_cast<std::int32_t>(s.vertexData.size()), nullptr, 0); + SDL_RenderGeometry( + renderer, s.texture, s.vertexData.data(), + static_cast<std::int32_t>(s.vertexData.size()), nullptr, 0 + ); } } |