Draw gameobject pos when debug draw enabled
This commit is contained in:
parent
5085597eeb
commit
db0a099509
1
Makefile
1
Makefile
|
@ -120,7 +120,6 @@ $(BIN)$(DIST): $(BIN)$(NAME) source/shaders/*
|
||||||
@mkdir -p $(BIN)dist
|
@mkdir -p $(BIN)dist
|
||||||
@cp $(BIN)$(NAME) $(BIN)dist
|
@cp $(BIN)$(NAME) $(BIN)dist
|
||||||
@cp -rf assets/fonts $(BIN)dist
|
@cp -rf assets/fonts $(BIN)dist
|
||||||
@cp -rf source/scripts $(BIN)dist
|
|
||||||
@cp -rf source/shaders $(BIN)dist
|
@cp -rf source/shaders $(BIN)dist
|
||||||
@tar czf $(DIST) --directory $(BIN)dist .
|
@tar czf $(DIST) --directory $(BIN)dist .
|
||||||
@mv $(DIST) $(BIN)
|
@mv $(DIST) $(BIN)
|
||||||
|
|
|
@ -348,8 +348,11 @@ void body_draw_shapes_dbg(cpBody *body, cpShape *shape, void *data) {
|
||||||
|
|
||||||
void gameobject_draw_debugs() {
|
void gameobject_draw_debugs() {
|
||||||
for (int i = 0; i < arrlen(gameobjects); i++) {
|
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);
|
cpBodyEachShape(gameobjects[i].body, body_draw_shapes_dbg, NULL);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue