Small cleanup + fixes
This commit is contained in:
parent
cf54dd083d
commit
1ed03f97b8
11
scene.c
11
scene.c
@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
// IDK you probably have to change this based on your display.
|
// IDK you probably have to change this based on your display.
|
||||||
// Maybe there's a way to fix this?
|
// Maybe there's a way to fix this?
|
||||||
#define UNIGIBITDEPTH 32
|
#define UNIGIBITDEPTH 0
|
||||||
#define TARGETFPS 60
|
#define TARGETFPS 60
|
||||||
|
|
||||||
#define DITHERSTART 100
|
#define DITHERSTART 100
|
||||||
@ -82,7 +82,9 @@ int main(int argc, char **argv) {
|
|||||||
haloo3d_gen_sloped(models + 2, PLANESIZE, 1.0, 1.25);
|
haloo3d_gen_sloped(models + 2, PLANESIZE, 1.0, 1.25);
|
||||||
haloo3d_fb_init_tex(textures + 3, 8, 8);
|
haloo3d_fb_init_tex(textures + 3, 8, 8);
|
||||||
memcpy(textures[3].buffer, redflower, sizeof(uint16_t) * 64);
|
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];
|
camset cams[MAXCAM];
|
||||||
int numcams = readcam(cams, MAXCAM, argv[3]);
|
int numcams = readcam(cams, MAXCAM, argv[3]);
|
||||||
@ -127,6 +129,7 @@ int main(int argc, char **argv) {
|
|||||||
#endif
|
#endif
|
||||||
objects[0].pos.y = 1;
|
objects[0].pos.y = 1;
|
||||||
vec3(objects[1].scale.v, SKYSCALE, SKYSCALE, SKYSCALE);
|
vec3(objects[1].scale.v, SKYSCALE, SKYSCALE, SKYSCALE);
|
||||||
|
eprintf("Initialized object instances\n");
|
||||||
|
|
||||||
// Now we create a framebuffer to draw the triangle into
|
// Now we create a framebuffer to draw the triangle into
|
||||||
haloo3d_fb fb;
|
haloo3d_fb fb;
|
||||||
@ -202,6 +205,8 @@ int main(int argc, char **argv) {
|
|||||||
mat4_inverse(matrixcam, matrixcam);
|
mat4_inverse(matrixcam, matrixcam);
|
||||||
mat4_multiply(matrixscreen, perspective, matrixcam);
|
mat4_multiply(matrixscreen, perspective, matrixcam);
|
||||||
|
|
||||||
|
// eprintf("BEGIN ITERATE OBJECTS\n");
|
||||||
|
|
||||||
// Iterate over objects
|
// Iterate over objects
|
||||||
for (int i = 0; i < NUMINSTANCES; i++) {
|
for (int i = 0; i < NUMINSTANCES; i++) {
|
||||||
// Setup final model matrix and the precalced vertices
|
// Setup final model matrix and the precalced vertices
|
||||||
@ -236,10 +241,12 @@ int main(int argc, char **argv) {
|
|||||||
totaldrawn++;
|
totaldrawn++;
|
||||||
// We still have to convert the points into the view
|
// We still have to convert the points into the view
|
||||||
haloo3d_facef_viewport_into(outfaces[ti], WIDTH, HEIGHT);
|
haloo3d_facef_viewport_into(outfaces[ti], WIDTH, HEIGHT);
|
||||||
|
// eprintf("RENDER TRI\n");
|
||||||
TRIFUNC(&fb, &rendersettings, outfaces[ti]);
|
TRIFUNC(&fb, &rendersettings, outfaces[ti]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// eprintf("OBJECTS COMPLETE\n");
|
||||||
|
|
||||||
haloo3d_print(&t, "Last frame: %05.2f (%05.2f)\nTris: %d / %d\nVerts: %d\n",
|
haloo3d_print(&t, "Last frame: %05.2f (%05.2f)\nTris: %d / %d\nVerts: %d\n",
|
||||||
lastframe, sumframe, totaldrawn, totalfaces, totalverts);
|
lastframe, sumframe, totaldrawn, totalfaces, totalverts);
|
||||||
|
@ -80,7 +80,8 @@ int main(int argc, char **argv) {
|
|||||||
haloo3d_gen_sloped(models + 2, PLANESIZE, 1.0, 1.25);
|
haloo3d_gen_sloped(models + 2, PLANESIZE, 1.0, 1.25);
|
||||||
haloo3d_fb_init_tex(textures + 3, 8, 8);
|
haloo3d_fb_init_tex(textures + 3, 8, 8);
|
||||||
memcpy(textures[3].buffer, redflower, sizeof(uint16_t) * 64);
|
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,
|
// Create the camera matrix, which DOES change. In this one,
|
||||||
// we move the camera instead of the model
|
// we move the camera instead of the model
|
||||||
|
Loading…
Reference in New Issue
Block a user