aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile4
-rw-r--r--cObject.cpp3
-rw-r--r--cRender.cpp5
3 files changed, 10 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index c265956..069b9c5 100644
--- a/Makefile
+++ b/Makefile
@@ -11,6 +11,10 @@ prog: $(OBJ)
%.o: %.cpp
$(CC) $(CFLAGS) -c $<
+all:
+ make clean
+ make
+
.PHONY: clean
clean:
diff --git a/cObject.cpp b/cObject.cpp
index b293745..118fe6f 100644
--- a/cObject.cpp
+++ b/cObject.cpp
@@ -3,7 +3,6 @@
cObject::cObject(int _sx, int _sy)
{
bSizeSet = false;
- bBlockRender = true; //Block inherited render capabilities of parent
setSize(_sx, _sy);
}
@@ -47,6 +46,8 @@ 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/cRender.cpp b/cRender.cpp
index 6d7a70a..d4f4185 100644
--- a/cRender.cpp
+++ b/cRender.cpp
@@ -47,6 +47,9 @@ cRender::cRender() {}
cRender::~cRender()
{
//Free allocated memory
+ if(bBlockRender)
+ return;
+
for (int i = 0; i < sizeX; i++) {
free(cScreen[i]);
free(wColor[i]);
@@ -58,7 +61,7 @@ cRender::~cRender()
free(bChanged);
setConsoleEcho(true);
-
+
#ifdef __linux__
setConsoleCursor(true);
#endif