Draw gameobject pos when debug draw enabled

This commit is contained in:
John Alanbrook 2023-01-17 06:46:40 +00:00
parent 5085597eeb
commit db0a099509
2 changed files with 4 additions and 2 deletions

View file

@ -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)

View file

@ -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);
}