From 66cc4fcb5f080ac02e2cd159911a9bb4892032d7 Mon Sep 17 00:00:00 2001 From: Maximilian Giller Date: Sat, 17 Jun 2023 21:25:33 +0200 Subject: [PATCH] Hiding debug render elements --- src/config.h | 2 ++ src/game/camera/tracking_view.cpp | 4 ++-- src/game/level/level_loader.cpp | 2 +- src/levels.hpp | 29 +++++++++++++++++++---------- 4 files changed, 24 insertions(+), 13 deletions(-) diff --git a/src/config.h b/src/config.h index a0d6572..c8a9ebd 100644 --- a/src/config.h +++ b/src/config.h @@ -53,5 +53,7 @@ // DEBUG #define DB_CIRCLE_RADIUS 1 +#define DB_WORLD_GRID_RENDER false +#define DB_TRACKING_VIEW_CENTER false #endif //HOLESOME_CONFIG_H diff --git a/src/game/camera/tracking_view.cpp b/src/game/camera/tracking_view.cpp index daaafa5..4c27e39 100644 --- a/src/game/camera/tracking_view.cpp +++ b/src/game/camera/tracking_view.cpp @@ -96,7 +96,7 @@ sf::Vector2f TrackingView::getCenter() const void TrackingView::followTrackables() { auto trackingPoint = getTrackingArea().getCenter(); - if (DEVELOPER_MODE) + if (DB_TRACKING_VIEW_CENTER) { marker->coordinates->setIsometric(IsometricCoordinates(trackingPoint)); } @@ -137,7 +137,7 @@ void TrackingView::moveCenter(sf::Vector2 delta) void TrackingView::draw(sf::RenderWindow *window) { - if (!DEVELOPER_MODE) + if (!DB_TRACKING_VIEW_CENTER) { return; } diff --git a/src/game/level/level_loader.cpp b/src/game/level/level_loader.cpp index 1733788..c74df78 100644 --- a/src/game/level/level_loader.cpp +++ b/src/game/level/level_loader.cpp @@ -22,7 +22,7 @@ void LevelLoader::loadLevel(const LevelConfig &levelConfig) // Add basic game objects game->addGameObject(SpriteFactory::createTileMap(levelConfig.tileMapConfig)); - if (DEVELOPER_MODE) + if (DB_WORLD_GRID_RENDER) { game->addGameObject(std::make_shared(0, 50, 0, 50)); } diff --git a/src/levels.hpp b/src/levels.hpp index c6625d6..5c255ea 100644 --- a/src/levels.hpp +++ b/src/levels.hpp @@ -10,16 +10,25 @@ std::map const all_levels = { {"default", LevelConfig("Default", {{0, 0}}, { CollectableInLevel("box", {5, 5})}, - TileMapConfig("iso-tiles", {{4, 4, 4, 4, 4, 4, 4, 4, 4, 4}, - {4, 4, 4, 4, 4, 4, 4, 4, 4, 4}, - {4, 4, 4, 4, 4, 4, 4, 4, 4, 4}, - {4, 4, 4, 4, 4, 4, 4, 4, 4, 4}, - {4, 4, 4, 4, 4, 4, 4, 4, 4, 4}, - {4, 4, 4, 4, 4, 4, 4, 4, 4, 4}, - {4, 0, 4, 4, 4, 4, 4, 4, 4, 4}, - {4, 4, 4, 4, 4, 4, 4, 4, 4, 4}, - {4, 1, 4, 4, 4, 4, 4, 4, 4, 4}, - {4, 4, 4, 4, 4, 4, 4, 4, 4, 4}}) + TileMapConfig("iso-tiles", {{4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4}, + {4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4}, + {4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4}, + {4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4}, + {4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4}, + {4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4}, + {4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4}, + {4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4}, + {4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4}, + {4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4}, + {4, 4, 4, 4, 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