summaryrefslogtreecommitdiff
path: root/libphysics/test
diff options
context:
space:
mode:
authoresquizo <esquizo+noreply@esquizo.net>2026-05-17 12:21:44 -0300
committeresquizo <esquizo+noreply@esquizo.net>2026-05-17 12:22:15 -0300
commitca457b3d0ed3dc6309e46633a2b467e3f9261753 (patch)
treea362a1ac4ce80cfe28129a2153989396f0255d79 /libphysics/test
parentb67f9b6b48715b325c3a2b3b5274467c778917a5 (diff)
libphysics: consertada a colisão com o tilemap
O tamanho do mapa não tava sendo configurado nas variáveis
Diffstat (limited to 'libphysics/test')
-rw-r--r--libphysics/test/vis.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/libphysics/test/vis.c b/libphysics/test/vis.c
index d1f3f6f..7d6466a 100644
--- a/libphysics/test/vis.c
+++ b/libphysics/test/vis.c
@@ -61,7 +61,6 @@ main()
0, 1, 1, 0, 0, 1, 1, 0,
0, 1, 1, 0, 0, 1, 1, 0,
0, 0, 1, 0, 0, 0, 1, 0,
- 0, 0, 0, 0, 0, 0, 0, 0,
});
running = 1;
@@ -107,6 +106,16 @@ render(void)
SDL_SetRenderDrawColor(renderer, 0x00, 0x00, 0x00, 0xFF);
SDL_RenderClear(renderer);
+
+ SDL_SetRenderDrawColor(renderer, 0xFF, 0x00, 0xFF, 0xFF);
+ for(int y = 0; y < phxmapheight; y++)
+ for(int x = 0; x < phxmapwidth; x++) {
+ if(!phxmapbuffer[x + y * phxmapwidth])
+ continue;
+
+ renderrect((vec2){ x * 32, y * 32 }, (vec2){ 16, 16 });
+ }
+
SDL_SetRenderDrawColor(renderer, 0xFF, 0xFF, 0xFF, 0xFF);
for(int i = 0; i < phxbodypoolsize; i++) {
vec2 p, s;
@@ -115,6 +124,5 @@ render(void)
continue;
renderrect(b->pos, b->size);
}
-
SDL_RenderPresent(renderer);
}