diff options
author | Jonas Gunz <himself@jonasgunz.de> | 2019-03-06 22:59:13 +0100 |
---|---|---|
committer | Jonas Gunz <himself@jonasgunz.de> | 2019-03-06 22:59:13 +0100 |
commit | 98da4bb94fbd2e65b1634f01519e3bbd59b76592 (patch) | |
tree | b70d3c45d6df559fea00bc4b5aa792ae259c3275 /src/cObject.cpp | |
parent | a472dc51a18ad16bd8c72337023a08251a5888a8 (diff) | |
download | termgl-98da4bb94fbd2e65b1634f01519e3bbd59b76592.tar.gz |
converting size variables to unsigned #1
Diffstat (limited to 'src/cObject.cpp')
-rw-r--r-- | src/cObject.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/cObject.cpp b/src/cObject.cpp index 217affc..bba7509 100644 --- a/src/cObject.cpp +++ b/src/cObject.cpp @@ -32,6 +32,7 @@ sObject cObject::getObject() { return sObject{pos, wColor, cScreen, sizeX, sizeY}; } + void cObject::write(cRender *_render, sPos _cameraPosition) { if(!bSizeSet) @@ -51,7 +52,7 @@ void cObject::write(cRender *_render, sPos _cameraPosition) //protected cObject::cObject() : pos({0,0}) , bSizeSet(false){} -void cObject::setSize(int _sx, int _sy) +void cObject::setSize(unsigned int _sx, unsigned int _sy) { if(bSizeSet) return; @@ -63,16 +64,16 @@ void cObject::setSize(int _sx, int _sy) //Initialize 2D array cScreen = (char**) malloc(sizeof *cScreen * _sx); - for (int i = 0; i < _sx; i++) + for (unsigned 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++) + for (unsigned 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; + cScreen[o][i] = 0; wColor[o][i] = _COL_DEFAULT; } } |