diff options
author | Jonas Gunz <himself@jonasgunz.de> | 2019-01-03 21:01:19 +0100 |
---|---|---|
committer | Jonas Gunz <himself@jonasgunz.de> | 2019-01-03 21:01:19 +0100 |
commit | 8134a14d6e3e7f07ba2fbbc2d657789ce441fbc6 (patch) | |
tree | 48444525a680a8f96f72924a2bf0d20c0a7571a3 | |
parent | 32adea5719fbfd07390c7a459ee4a60c48f84835 (diff) | |
download | termgl-8134a14d6e3e7f07ba2fbbc2d657789ce441fbc6.tar.gz |
compatability fixes
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | cObject.cpp | 3 | ||||
-rw-r--r-- | cObjectHandler.h | 4 | ||||
-rw-r--r-- | cRender.h | 2 | ||||
-rw-r--r-- | testobject.h | 3 |
5 files changed, 7 insertions, 7 deletions
@@ -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<cObject*> objects; - vector<vector<unsigned int>> iHitMap; + vector< vector<unsigned int> > iHitMap; cRender *render; unsigned long int iActiveObject; }; @@ -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 <string> 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) |