aboutsummaryrefslogtreecommitdiff
path: root/src/cObjectHandler.cpp
diff options
context:
space:
mode:
authorGravatar Jonas Gunz <himself@jonasgunz.de> 2019-03-06 21:30:57 +0100
committerGravatar Jonas Gunz <himself@jonasgunz.de> 2019-03-06 21:30:57 +0100
commita472dc51a18ad16bd8c72337023a08251a5888a8 (patch)
treee9440f7c00fafdb7826b960e7cb4c59d4723546e /src/cObjectHandler.cpp
parentf8e188f2e6db9049e0c8c4e905e58aaf66e3b6cb (diff)
downloadtermgl-a472dc51a18ad16bd8c72337023a08251a5888a8.tar.gz
Updated Object writing to framebuffer
cObject now handles writing itself to the framebuffer with write() instead of passing the cScreen pointer to cObjectHandler
Diffstat (limited to 'src/cObjectHandler.cpp')
-rw-r--r--src/cObjectHandler.cpp15
1 files changed, 2 insertions, 13 deletions
diff --git a/src/cObjectHandler.cpp b/src/cObjectHandler.cpp
index eca340b..1168b86 100644
--- a/src/cObjectHandler.cpp
+++ b/src/cObjectHandler.cpp
@@ -95,20 +95,9 @@ int cObjectHandler::write()
for (unsigned long int i = 0; i < objects.size(); i++)
{
- if (objects[i]) // Check if objects[i] is existent
+ if (objects[i])
{
- //Draw every Object
- sObject obj = objects[i]->getObject(); //get Object #i
-
- for (int o = 0; o < obj.sizeY; o++) { //y axis
- for (int p = 0; p < obj.sizeX; p++) { //x axis
- if (obj.cScreen[p][o]) { //Dont overwrite empty pixels
- sPos pos{ obj.pos.x + p - cameraPosition.x,
- obj.pos.y + o - cameraPosition.y };
- render->drawPoint(obj.cScreen[p][o], pos, true, obj.wColor[p][o]);
- }
- }
- }
+ objects[i]->write(render, cameraPosition);
}
}