From 1ed03f97b85da7a61593640b7b143c0198c218f5 Mon Sep 17 00:00:00 2001 From: Carlos Sanchez Date: Mon, 26 Aug 2024 01:28:02 -0400 Subject: [PATCH] Small cleanup + fixes --- ecs2_comps.h => old/ecs2_comps.h | 0 scene.c | 11 +++++++++-- scene_freecam.c | 3 ++- 3 files changed, 11 insertions(+), 3 deletions(-) rename ecs2_comps.h => old/ecs2_comps.h (100%) diff --git a/ecs2_comps.h b/old/ecs2_comps.h similarity index 100% rename from ecs2_comps.h rename to old/ecs2_comps.h diff --git a/scene.c b/scene.c index 7a767ff..119d88c 100644 --- a/scene.c +++ b/scene.c @@ -20,7 +20,7 @@ // IDK you probably have to change this based on your display. // Maybe there's a way to fix this? -#define UNIGIBITDEPTH 32 +#define UNIGIBITDEPTH 0 #define TARGETFPS 60 #define DITHERSTART 100 @@ -82,7 +82,9 @@ int main(int argc, char **argv) { haloo3d_gen_sloped(models + 2, PLANESIZE, 1.0, 1.25); haloo3d_fb_init_tex(textures + 3, 8, 8); memcpy(textures[3].buffer, redflower, sizeof(uint16_t) * 64); - haloo3d_gen_crossquad(models + 3, textures + 3); + haloo3d_gen_crossquad(models + 3, textures + 3, + (struct vec3){.x = 0, .y = 0, .z = 0}); + eprintf("Initialized models + textures"); camset cams[MAXCAM]; int numcams = readcam(cams, MAXCAM, argv[3]); @@ -127,6 +129,7 @@ int main(int argc, char **argv) { #endif objects[0].pos.y = 1; vec3(objects[1].scale.v, SKYSCALE, SKYSCALE, SKYSCALE); + eprintf("Initialized object instances\n"); // Now we create a framebuffer to draw the triangle into haloo3d_fb fb; @@ -202,6 +205,8 @@ int main(int argc, char **argv) { mat4_inverse(matrixcam, matrixcam); mat4_multiply(matrixscreen, perspective, matrixcam); + // eprintf("BEGIN ITERATE OBJECTS\n"); + // Iterate over objects for (int i = 0; i < NUMINSTANCES; i++) { // Setup final model matrix and the precalced vertices @@ -236,10 +241,12 @@ int main(int argc, char **argv) { totaldrawn++; // We still have to convert the points into the view haloo3d_facef_viewport_into(outfaces[ti], WIDTH, HEIGHT); + // eprintf("RENDER TRI\n"); TRIFUNC(&fb, &rendersettings, outfaces[ti]); } } } + // eprintf("OBJECTS COMPLETE\n"); haloo3d_print(&t, "Last frame: %05.2f (%05.2f)\nTris: %d / %d\nVerts: %d\n", lastframe, sumframe, totaldrawn, totalfaces, totalverts); diff --git a/scene_freecam.c b/scene_freecam.c index 04618fd..41cc63a 100644 --- a/scene_freecam.c +++ b/scene_freecam.c @@ -80,7 +80,8 @@ int main(int argc, char **argv) { haloo3d_gen_sloped(models + 2, PLANESIZE, 1.0, 1.25); haloo3d_fb_init_tex(textures + 3, 8, 8); memcpy(textures[3].buffer, redflower, sizeof(uint16_t) * 64); - haloo3d_gen_crossquad(models + 3, textures + 3); + haloo3d_gen_crossquad(models + 3, textures + 3, + (struct vec3){.x = 0, .y = 0, .z = 0}); // Create the camera matrix, which DOES change. In this one, // we move the camera instead of the model