diff options
author | jonas <himself@jonasgunz.de> | 2018-12-27 00:26:34 +0100 |
---|---|---|
committer | jonas <himself@jonasgunz.de> | 2018-12-27 00:26:34 +0100 |
commit | 7015245de4af673af3e6fa62d5d0f9c2e0c2a8a1 (patch) | |
tree | 8bec5d1716eebb0fedc75dcc036385443b1ecea5 /AmpelJonas/cObject.cpp | |
parent | 616951a353caf398908e6e6ce7dddf34a65513e5 (diff) | |
download | termgl-7015245de4af673af3e6fa62d5d0f9c2e0c2a8a1.tar.gz |
cleaned working tree
Diffstat (limited to 'AmpelJonas/cObject.cpp')
-rw-r--r-- | AmpelJonas/cObject.cpp | 59 |
1 files changed, 0 insertions, 59 deletions
diff --git a/AmpelJonas/cObject.cpp b/AmpelJonas/cObject.cpp deleted file mode 100644 index 8b18e41..0000000 --- a/AmpelJonas/cObject.cpp +++ /dev/null @@ -1,59 +0,0 @@ -#include "cObject.h" - -cObject::cObject(int _sx, int _sy) -{ - bBlockRender = true; //Block inherited render capabilities of parent - - sizeX = _sx; - sizeY = _sy; - - //Initialize 2D array - cScreen = (char**) malloc(sizeof *cScreen * _sx); - for (int i = 0; i < _sx; i++) - cScreen[i] = (char*)malloc(sizeof *cScreen[i] * _sy); - - wColor = (WORD**)malloc(sizeof *wColor * _sx); - for (int i = 0; i < _sx; i++) - wColor[i] = (WORD*)malloc(sizeof *wColor[i] * _sy); - - for (int i = 0; i < sizeY; i++) { - for (int o = 0; o < sizeX; o++) { - cScreen[o][i] = NULL; - wColor[o][i] = _COL_DEFAULT; - } - } -} - -cObject::~cObject() -{ - for (int i = 0; i < sizeX; i++) { - free(cScreen[i]); - free(wColor[i]); - } - - free(cScreen); - free(wColor); -} - -sPos cObject::getPosition() -{ - return pos; -} - -void cObject::setPosition(sPos _pos) -{ - pos = _pos; -} - - -void cObject::setPosition(int _x, int _y) -{ - pos.x = _x; - pos.y = _y; -} - - -sObject cObject::getObject() -{ - return sObject{pos, wColor, cScreen, sizeX, sizeY}; -} |