From 8134a14d6e3e7f07ba2fbbc2d657789ce441fbc6 Mon Sep 17 00:00:00 2001 From: Jonas Gunz Date: Thu, 3 Jan 2019 21:01:19 +0100 Subject: compatability fixes --- Makefile | 2 +- cObject.cpp | 3 +-- cObjectHandler.h | 4 ++-- cRender.h | 2 +- testobject.h | 3 ++- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Makefile b/Makefile index 132f2ec..c265956 100644 --- a/Makefile +++ b/Makefile @@ -1,5 +1,5 @@ CC = /usr/bin/g++ -CFLAGS = -Wall -g +CFLAGS = -Wall -g -std=c++11 LDFLAGS = -lm -lcurses OUTPUT = bin/Engine diff --git a/cObject.cpp b/cObject.cpp index 118fe6f..b293745 100644 --- a/cObject.cpp +++ b/cObject.cpp @@ -3,6 +3,7 @@ cObject::cObject(int _sx, int _sy) { bSizeSet = false; + bBlockRender = true; //Block inherited render capabilities of parent setSize(_sx, _sy); } @@ -46,8 +47,6 @@ void cObject::setSize(int _sx, int _sy) if(bSizeSet) return; - bBlockRender = true; //Block inherited render capabilities of parent - sizeX = _sx; sizeY = _sy; diff --git a/cObjectHandler.h b/cObjectHandler.h index 86034b8..555b373 100644 --- a/cObjectHandler.h +++ b/cObjectHandler.h @@ -10,7 +10,7 @@ using namespace std; -class cObject; //Circular dependency break (Bad practice. I Know.) +//class cObject; //Circular dependency break (Bad practice. I Know.) class cObjectHandler { @@ -49,7 +49,7 @@ private: void buildHitmap(); vector objects; - vector> iHitMap; + vector< vector > iHitMap; cRender *render; unsigned long int iActiveObject; }; diff --git a/cRender.h b/cRender.h index c30a901..209c75b 100644 --- a/cRender.h +++ b/cRender.h @@ -73,7 +73,7 @@ public: //Resizes console window for Windows //Sets Size to Console Window Size for Linux. Writes Error for _sx or _sy smaller than Screen. Get by getLastError() - ~cRender(); + virtual ~cRender(); //frees allocated memory int drawPoint(char _c, sPos _pos, bool _overrideCollision, WORD _color); diff --git a/testobject.h b/testobject.h index 5e5475f..1da8987 100644 --- a/testobject.h +++ b/testobject.h @@ -1,6 +1,7 @@ #pragma once #include "cObject.h" +#include class testobject : cObject { @@ -22,7 +23,7 @@ public: virtual void onClick(sPos _pos, unsigned int _button) { cc++; - drawText(to_string(cc), {2,2}, _COL_RED); + drawText(std::to_string(cc), {2,2}, _COL_RED); } virtual void onChar(unsigned char _c) -- cgit v1.2.3