Removed old prints
Fixed a possibly uninitialized variable in node.cpp
Removed unused `vector2.h` include
This commit is contained in:
Thomas Muller 2021-08-01 21:10:43 -04:00
parent 0913c7b05e
commit 39d055f5d6
Signed by: thomas
GPG key ID: AF006EB730564952
5 changed files with 3 additions and 8 deletions

View file

@ -8,7 +8,6 @@ void Rainbow::update(double dt) {
m_time += dt; m_time += dt;
if(m_time - m_prev_time > 0.1) { if(m_time - m_prev_time > 0.1) {
std::cout << "Entity tick 1 second" << std::endl;
m_prev_time = m_time; m_prev_time = m_time;
m_color = Color::from_hsv(rand() % 255, 255, 255); m_color = Color::from_hsv(rand() % 255, 255, 255);
} }

View file

@ -5,12 +5,12 @@ namespace entity {
class Rainbow : public Entity { class Rainbow : public Entity {
public: public:
Rainbow() : Entity(4) { std::cout << "Rainbow construct" << std::endl; } Rainbow() : Entity(4) {}
Rainbow(const Rainbow &other) = default; Rainbow(const Rainbow &other) = default;
Rainbow &operator=(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); } virtual Rainbow *clone() { return new Rainbow(*this); }

View file

@ -12,7 +12,6 @@ Node::Node(const Node &other) {
} }
if(other.m_entity) { if(other.m_entity) {
std::cout << "Entity being cloned" << std::endl;
m_entity = other.m_entity->clone(); m_entity = other.m_entity->clone();
m_entity->set_node(this); m_entity->set_node(this);
} }
@ -47,7 +46,6 @@ void Node::set_tile(Tile *tile) {
} }
void Node::set_entity(Entity *entity) { void Node::set_entity(Entity *entity) {
std::cout << "Entity set!@#?! " << entity << std::endl;
if(!entity) if(!entity)
return; return;
@ -92,7 +90,7 @@ std::istream &operator>>(std::istream &is, Node &node) {
int id = 0; int id = 0;
// TODO: Move / figure this shit out // TODO: Move / figure this shit out
is.read(reinterpret_cast<char *>(&id), sizeof(id)); is.read(reinterpret_cast<char *>(&id), sizeof(id));
Tile *tile; Tile *tile = nullptr;
switch(id) { switch(id) {
case -1: case -1:
tile = new Tile(); tile = new Tile();

View file

@ -2,7 +2,6 @@
#include "entities/rainbow.h" #include "entities/rainbow.h"
Entity *Rainbow::create_entity() { Entity *Rainbow::create_entity() {
std::cout << "Create called" << std::endl;
return new entity::Rainbow(); return new entity::Rainbow();
} }

View file

@ -4,7 +4,6 @@
#include "entities/entity.h" #include "entities/entity.h"
#include "util/render.h" #include "util/render.h"
#include "util/vector2.h"
#define TILE_SIZE 8 #define TILE_SIZE 8