diff --git a/Makefile b/Makefile index 52dab14..3a97413 100644 --- a/Makefile +++ b/Makefile @@ -5,8 +5,6 @@ RAYOBJECTS= obj/rcore.o obj/rshapes.o obj/rtextures.o obj/rtext.o obj/utils.o ob #RAYOPT= -O3 RAYOPT= -ggdb -CFLAGS= -std=c++23 - all: setup main run setup: @@ -44,6 +42,8 @@ SRCDIR = src OBJDIR = obj INCLUDE = -Iinc +CFLAGS= -std=c++23 -Wall -Werror + SOURCES = $(wildcard $(SRCDIR)/*.cpp) OBJECTS = $(patsubst $(SRCDIR)/%.cpp,$(OBJDIR)/%.o,$(SOURCES)) diff --git a/main.cpp b/main.cpp index 3d324c1..cbff358 100644 --- a/main.cpp +++ b/main.cpp @@ -3,7 +3,7 @@ int main(void) { - char *name = "treender"; + char name[] = "treender"; int screenWidth = 800; int screenHeight = 800; @@ -20,7 +20,7 @@ int main(void) tree.newTree(); int yPos = (screenHeight - screenWidth) / 2; - Rectangle dest = {yPos, 0, screenWidth, screenWidth}; + Rectangle dest = {0, (float)yPos, (float)screenWidth, (float)screenWidth}; float rotation = 0.0f; while (!WindowShouldClose()) { @@ -29,6 +29,7 @@ int main(void) tree.newTree(); } BeginDrawing(); + ClearBackground(WHITE); tree.draw(dest, rotation); EndDrawing(); } diff --git a/src/Tree.cpp b/src/Tree.cpp index 2a969d0..eaca11b 100644 --- a/src/Tree.cpp +++ b/src/Tree.cpp @@ -82,7 +82,7 @@ void Tree::drawBranch() void Tree::drawTree() { - draw_calls.push_back((DrawArgs){start, 0, size / 4, 1}); + draw_calls.push_back((DrawArgs){start, 0, (float)size / 4, 1}); while (!draw_calls.empty()) {