From db0a09950970688107a2be7f9ad974447482838c Mon Sep 17 00:00:00 2001 From: John Alanbrook Date: Tue, 17 Jan 2023 06:46:40 +0000 Subject: [PATCH] Draw gameobject pos when debug draw enabled --- Makefile | 1 - source/engine/gameobject.c | 5 ++++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index d25d4b6..5dbc0b0 100755 --- a/Makefile +++ b/Makefile @@ -120,7 +120,6 @@ $(BIN)$(DIST): $(BIN)$(NAME) source/shaders/* @mkdir -p $(BIN)dist @cp $(BIN)$(NAME) $(BIN)dist @cp -rf assets/fonts $(BIN)dist - @cp -rf source/scripts $(BIN)dist @cp -rf source/shaders $(BIN)dist @tar czf $(DIST) --directory $(BIN)dist . @mv $(DIST) $(BIN) diff --git a/source/engine/gameobject.c b/source/engine/gameobject.c index 1689da3..af1c19e 100644 --- a/source/engine/gameobject.c +++ b/source/engine/gameobject.c @@ -348,8 +348,11 @@ void body_draw_shapes_dbg(cpBody *body, cpShape *shape, void *data) { void gameobject_draw_debugs() { for (int i = 0; i < arrlen(gameobjects); i++) { - if (!gameobjects[i].body) continue; + cpVect pos = cpBodyGetPosition(gameobjects[i].body); + float color[3] = {0.76f, 0.38f, 1.f}; + draw_point(pos.x, pos.y, 3.f, color); + if (!gameobjects[i].body) continue; cpBodyEachShape(gameobjects[i].body, body_draw_shapes_dbg, NULL); }