diff options
| author | esquizo <esquizo+noreply@esquizo.net> | 2026-05-17 16:48:20 -0300 |
|---|---|---|
| committer | esquizo <esquizo+noreply@esquizo.net> | 2026-05-17 16:48:20 -0300 |
| commit | df8e49f5019b6f33a30d4c9372a18d8d372d6af2 (patch) | |
| tree | d8ddd5854a75e8194e74ce905e24202a62c6aa9e /libphysics/test/vis.c | |
| parent | ca457b3d0ed3dc6309e46633a2b467e3f9261753 (diff) | |
libphysics: mudada a interface publica para um id ao invés de um ponteiro
Isso aumenta a portabilidade e facilita appendage de userdata sem
necessariamente alterar o sistema principal
Diffstat (limited to 'libphysics/test/vis.c')
| -rw-r--r-- | libphysics/test/vis.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libphysics/test/vis.c b/libphysics/test/vis.c index 7d6466a..3111005 100644 --- a/libphysics/test/vis.c +++ b/libphysics/test/vis.c @@ -45,11 +45,12 @@ main() #define FLOAT_RAND (2 * (rand() / (float)RAND_MAX) - 1) for(int i = 0; i < SBODY; i++) { - Body *b = phxnew(BTYPE_AABB); - assert(b != NULL); + BodyID b = phxnew(BTYPE_AABB); + assert(b != -1); + phxsetpos(b, rand() % 800, rand() % 600); phxsetsize(b, 16.0, 16.0); - phxapplyaccel(b, (float[]){ 100000 * FLOAT_RAND, 100000 * FLOAT_RAND }); + phxapplyaccel(b, (float[]){ 30000 * FLOAT_RAND, 30000 * FLOAT_RAND }); } phxsetmap(8, 8, (int[]) { @@ -75,7 +76,7 @@ main() old_ticks = new_ticks; phxtick(delta); while(phxnextcollevent(&event)) { - printf("Collision with %p and %p\n", event.body1, event.body2); + printf("Collision with %d and %d\n", event.body1, event.body2); } render(); @@ -106,7 +107,6 @@ 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++) { |
