From 39d055f5d6806d8e063affb9e69c3a3b38e9021d Mon Sep 17 00:00:00 2001 From: Quantum Date: Sun, 1 Aug 2021 21:10:43 -0400 Subject: [PATCH] Cleanup Removed old prints Fixed a possibly uninitialized variable in node.cpp Removed unused `vector2.h` include --- src/entities/rainbow.cpp | 1 - src/entities/rainbow.h | 4 ++-- src/map/node.cpp | 4 +--- src/tiles/rainbow.cpp | 1 - src/tiles/tile.h | 1 - 5 files changed, 3 insertions(+), 8 deletions(-) diff --git a/src/entities/rainbow.cpp b/src/entities/rainbow.cpp index 63e2b2d..c6862dc 100644 --- a/src/entities/rainbow.cpp +++ b/src/entities/rainbow.cpp @@ -8,7 +8,6 @@ void Rainbow::update(double dt) { m_time += dt; if(m_time - m_prev_time > 0.1) { - std::cout << "Entity tick 1 second" << std::endl; m_prev_time = m_time; m_color = Color::from_hsv(rand() % 255, 255, 255); } diff --git a/src/entities/rainbow.h b/src/entities/rainbow.h index 6ba6142..a6381a1 100644 --- a/src/entities/rainbow.h +++ b/src/entities/rainbow.h @@ -5,12 +5,12 @@ namespace entity { class Rainbow : public Entity { public: - Rainbow() : Entity(4) { std::cout << "Rainbow construct" << std::endl; } + Rainbow() : Entity(4) {} Rainbow(const Rainbow &other) = default; Rainbow &operator=(const Rainbow &other) = default; - virtual ~Rainbow() = default; //{ std::cout << "Rainbow destruct" << std::endl; } + virtual ~Rainbow() = default; virtual Rainbow *clone() { return new Rainbow(*this); } diff --git a/src/map/node.cpp b/src/map/node.cpp index bd87b68..8eab066 100644 --- a/src/map/node.cpp +++ b/src/map/node.cpp @@ -12,7 +12,6 @@ Node::Node(const Node &other) { } if(other.m_entity) { - std::cout << "Entity being cloned" << std::endl; m_entity = other.m_entity->clone(); m_entity->set_node(this); } @@ -47,7 +46,6 @@ void Node::set_tile(Tile *tile) { } void Node::set_entity(Entity *entity) { - std::cout << "Entity set!@#?! " << entity << std::endl; if(!entity) return; @@ -92,7 +90,7 @@ std::istream &operator>>(std::istream &is, Node &node) { int id = 0; // TODO: Move / figure this shit out is.read(reinterpret_cast(&id), sizeof(id)); - Tile *tile; + Tile *tile = nullptr; switch(id) { case -1: tile = new Tile(); diff --git a/src/tiles/rainbow.cpp b/src/tiles/rainbow.cpp index 289e526..d7a2ed7 100644 --- a/src/tiles/rainbow.cpp +++ b/src/tiles/rainbow.cpp @@ -2,7 +2,6 @@ #include "entities/rainbow.h" Entity *Rainbow::create_entity() { - std::cout << "Create called" << std::endl; return new entity::Rainbow(); } diff --git a/src/tiles/tile.h b/src/tiles/tile.h index a24d408..23b7f90 100644 --- a/src/tiles/tile.h +++ b/src/tiles/tile.h @@ -4,7 +4,6 @@ #include "entities/entity.h" #include "util/render.h" -#include "util/vector2.h" #define TILE_SIZE 8