feat: remove tower

This commit is contained in:
2021-12-08 15:34:20 +01:00
parent 78cf2d0f18
commit e4a9c5f763
16 changed files with 88 additions and 38 deletions

View File

@@ -12,15 +12,19 @@ namespace render {
class VertexCache {
typedef std::vector<float> Vector;
typedef std::pair<Vector::iterator, Vector::iterator> ElementsIndex;
typedef std::pair<ElementsIndex, ElementsIndex> DataIndex;
struct DataIndex {
Vector position;
Vector color;
};
private:
Vector m_Positions;
Vector m_Colors;
std::size_t m_VertexCount;
std::unordered_map<std::uint64_t, DataIndex> m_Indexes;
std::unique_ptr<GL::VertexArray> m_VertexArray;
public:
VertexCache() : m_VertexCount(0) {}
void addData(std::uint64_t index, std::vector<float> positions, std::vector<float> colors);
void removeData(std::uint64_t index);
void clear();

View File

@@ -71,6 +71,7 @@ private:
void renderMobTooltip() const;
void detectClick();
void detectMobHovering() const;
void removeTower();
glm::vec2 getCursorWorldPos() const;
glm::vec2 getClickWorldPos() const;