forked from jaildesigner-jailgames/jaildoctors_dilemma
linter
This commit is contained in:
@@ -56,6 +56,46 @@ void TilemapRenderer::render() {
|
||||
}
|
||||
|
||||
#ifdef _DEBUG
|
||||
// Renderiza las superficies de colisión en modo debug (función helper estática)
|
||||
static void renderDebugCollisionSurfaces(const CollisionMap* collision_map) {
|
||||
auto surface = Screen::get()->getRendererSurface();
|
||||
|
||||
// BottomSurfaces
|
||||
for (auto l : collision_map->getBottomFloors()) {
|
||||
surface->drawLine(l.x1, l.y, l.x2, l.y, static_cast<Uint8>(PaletteColor::BLUE));
|
||||
}
|
||||
|
||||
// TopSurfaces
|
||||
for (auto l : collision_map->getTopFloors()) {
|
||||
surface->drawLine(l.x1, l.y, l.x2, l.y, static_cast<Uint8>(PaletteColor::RED));
|
||||
}
|
||||
|
||||
// LeftSurfaces
|
||||
for (auto l : collision_map->getLeftWalls()) {
|
||||
surface->drawLine(l.x, l.y1, l.x, l.y2, static_cast<Uint8>(PaletteColor::GREEN));
|
||||
}
|
||||
|
||||
// RightSurfaces
|
||||
for (auto l : collision_map->getRightWalls()) {
|
||||
surface->drawLine(l.x, l.y1, l.x, l.y2, static_cast<Uint8>(PaletteColor::MAGENTA));
|
||||
}
|
||||
|
||||
// LeftSlopes
|
||||
for (auto l : collision_map->getLeftSlopes()) {
|
||||
surface->drawLine(l.x1, l.y1, l.x2, l.y2, static_cast<Uint8>(PaletteColor::CYAN));
|
||||
}
|
||||
|
||||
// RightSlopes
|
||||
for (auto l : collision_map->getRightSlopes()) {
|
||||
surface->drawLine(l.x1, l.y1, l.x2, l.y2, static_cast<Uint8>(PaletteColor::YELLOW));
|
||||
}
|
||||
|
||||
// AutoSurfaces (Conveyor Belts)
|
||||
for (auto l : collision_map->getConveyorBeltFloors()) {
|
||||
surface->drawLine(l.x1, l.y, l.x2, l.y, static_cast<Uint8>(PaletteColor::WHITE));
|
||||
}
|
||||
}
|
||||
|
||||
// Redibuja el tilemap (para actualizar modo debug)
|
||||
void TilemapRenderer::redrawMap(const CollisionMap* collision_map) {
|
||||
fillMapTexture(collision_map);
|
||||
@@ -98,58 +138,8 @@ void TilemapRenderer::fillMapTexture(const CollisionMap* collision_map) {
|
||||
#ifdef _DEBUG
|
||||
// Pinta las superficies en el modo debug
|
||||
if (Debug::get()->isEnabled()) {
|
||||
auto surface = Screen::get()->getRendererSurface();
|
||||
|
||||
// BottomSurfaces
|
||||
{
|
||||
for (auto l : collision_map->getBottomFloors()) {
|
||||
surface->drawLine(l.x1, l.y, l.x2, l.y, static_cast<Uint8>(PaletteColor::BLUE));
|
||||
}
|
||||
}
|
||||
|
||||
// TopSurfaces
|
||||
{
|
||||
for (auto l : collision_map->getTopFloors()) {
|
||||
surface->drawLine(l.x1, l.y, l.x2, l.y, static_cast<Uint8>(PaletteColor::RED));
|
||||
}
|
||||
}
|
||||
|
||||
// LeftSurfaces
|
||||
{
|
||||
for (auto l : collision_map->getLeftWalls()) {
|
||||
surface->drawLine(l.x, l.y1, l.x, l.y2, static_cast<Uint8>(PaletteColor::GREEN));
|
||||
}
|
||||
}
|
||||
|
||||
// RightSurfaces
|
||||
{
|
||||
for (auto l : collision_map->getRightWalls()) {
|
||||
surface->drawLine(l.x, l.y1, l.x, l.y2, static_cast<Uint8>(PaletteColor::MAGENTA));
|
||||
}
|
||||
}
|
||||
|
||||
// LeftSlopes
|
||||
{
|
||||
for (auto l : collision_map->getLeftSlopes()) {
|
||||
surface->drawLine(l.x1, l.y1, l.x2, l.y2, static_cast<Uint8>(PaletteColor::CYAN));
|
||||
}
|
||||
}
|
||||
|
||||
// RightSlopes
|
||||
{
|
||||
for (auto l : collision_map->getRightSlopes()) {
|
||||
surface->drawLine(l.x1, l.y1, l.x2, l.y2, static_cast<Uint8>(PaletteColor::YELLOW));
|
||||
}
|
||||
}
|
||||
|
||||
// AutoSurfaces
|
||||
{
|
||||
for (auto l : collision_map->getConveyorBeltFloors()) {
|
||||
surface->drawLine(l.x1, l.y, l.x2, l.y, static_cast<Uint8>(PaletteColor::WHITE));
|
||||
}
|
||||
}
|
||||
renderDebugCollisionSurfaces(collision_map);
|
||||
}
|
||||
|
||||
#endif // _DEBUG
|
||||
Screen::get()->setRendererSurface(previous_renderer);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user