holesome/src/debug/grid_debug_layer.cpp

39 lines
809 B
C++
Raw Normal View History

2023-05-03 23:46:41 +02:00
#include "grid_debug_layer.h"
#include "../primitives/circle_object.h"
#include "../config.h"
2023-05-03 23:46:41 +02:00
GridDebugLayer::GridDebugLayer(int minX, int maxX, int minY, int maxY)
{
// Generate markers
for (int x = minX; x <= maxX; x++)
{
for (int y = minY; y <= maxY; y++)
{
auto *gameObject = new CircleObject(DB_ISOPLANE_CORNER_RADIUS, sf::Color::Red);
2023-05-03 23:46:41 +02:00
gameObject->coordinates.set(WorldCoordinates(x, y, 0));
marker.push_back(gameObject);
}
}
}
GridDebugLayer::~GridDebugLayer()
{
for (auto &gameObject: marker)
{
delete gameObject;
}
}
void GridDebugLayer::draw(sf::RenderWindow *window) const
{
for (auto &gameObject: marker)
{
gameObject->draw(window);
}
}
void GridDebugLayer::update() const
{
}