From e856e2c0543c352b9f877f16cb5d8aefbfbc61ef Mon Sep 17 00:00:00 2001 From: noffie Date: Tue, 18 Mar 2025 23:15:45 +0100 Subject: [PATCH] Fixed overlapping Quads --- assets | 1 + src/Map/Map.cpp | 6 ++---- 2 files changed, 3 insertions(+), 4 deletions(-) create mode 160000 assets diff --git a/assets b/assets new file mode 160000 index 0000000..e0659b2 --- /dev/null +++ b/assets @@ -0,0 +1 @@ +Subproject commit e0659b2375682b03bb5b9fb2b565a9c5975853e8 diff --git a/src/Map/Map.cpp b/src/Map/Map.cpp index 22d0e81..1cd031d 100644 --- a/src/Map/Map.cpp +++ b/src/Map/Map.cpp @@ -63,8 +63,8 @@ MapError Map::populate_vertex_array() { if (atlas_tile >= atlas.wall_tiles + atlas.other_tiles) return {"Map: [Loading] Invalid tile! Tile type does not have a texture", 3}; // add the vertices - const auto xf = static_cast(x); - const auto yf = static_cast(y); + const auto xf = static_cast(x * atlas.tile_size.x); + const auto yf = static_cast(y * atlas.tile_size.y); const uint32_t tile_x = atlas_tile % atlas.tile_count.x; const uint32_t tile_y = atlas_tile / atlas.tile_count.x; const auto tex_x = static_cast(tile_x * atlas.tile_size.x); @@ -85,8 +85,6 @@ MapError Map::populate_vertex_array() { } } - - return {"Map: [Loading] Success", 0}; }