From 2cef92223392c184d1b31bc29f38341abe32e882 Mon Sep 17 00:00:00 2001 From: Carlos Sanchez Date: Sat, 21 Sep 2024 01:28:59 -0400 Subject: [PATCH] Render more in terrain --- junk.txt | 15 --------------- notes.txt | 3 +++ terrain.c | 14 +++++++------- 3 files changed, 10 insertions(+), 22 deletions(-) delete mode 100644 junk.txt create mode 100644 notes.txt diff --git a/junk.txt b/junk.txt deleted file mode 100644 index e632dde..0000000 --- a/junk.txt +++ /dev/null @@ -1,15 +0,0 @@ - // haloo3d_print(&pt, "Thi sis a gaint string. I am disylax, I acn'at type, really \n" - // "And this string will just keep going because i need it to take up tons of\n" - // "your time today. fuck you, eat a cock, thank you. just kidding, i love you\n" - // "please have a nice day, but eat a cock if you like that kind of thing. \n" - // "slurp slurp yummy yummy give me treats. i like fat bellies"); - // haloo3d_print(&pt, "Thi sis a gaint string. I am disylax, I acn'at type, really \n" - // "And this string will just keep going because i need it to take up tons of\n" - // "your time today. fuck you, eat a cock, thank you. just kidding, i love you\n" - // "please have a nice day, but eat a cock if you like that kind of thing. \n" - // "slurp slurp yummy yummy give me treats. i like fat bellies"); - // haloo3d_print(&pt, "Thi sis a gaint string. I am disylax, I acn'at type, really \n" - // "And this string will just keep going because i need it to take up tons of\n" - // "your time today. fuck you, eat a cock, thank you. just kidding, i love you\n" - // "please have a nice day, but eat a cock if you like that kind of thing. \n" - // "slurp slurp yummy yummy give me treats. i like fat bellies"); diff --git a/notes.txt b/notes.txt new file mode 100644 index 0000000..355b638 --- /dev/null +++ b/notes.txt @@ -0,0 +1,3 @@ +1) MAKE SURE DEFINES ARE ISOLATED! + Minxrod gave a very useful command to find them: + find . -name '*.[ch]' | xargs grep -n -d recurse '#define .* [-+*/] .*' | grep -v '[(].* [-+*/] .*[)]' diff --git a/terrain.c b/terrain.c index 1fafa51..d6ebc09 100644 --- a/terrain.c +++ b/terrain.c @@ -56,10 +56,10 @@ { .x = 0, .y = 0, .z = -1 } // How big each chunk is (x and y, square). MUST BE POWER OF 2 - 1 #define CHUNKSIZE 7 // This is the width in tiles -#define CHUNKSCALE 1.0 / CHUNKSIZE +#define CHUNKSCALE (1.0 / CHUNKSIZE) // This is how many vertices across a chunk is #define CHUNKVSIZE (CHUNKSIZE + 1) -#define VIEWDISTANCE 10 +#define VIEWDISTANCE 11 #define PLBOXEDGE (VIEWDISTANCE * 2 + 1) #define INIT_NEARCLIP 0.01 #define INIT_FARCLIP 100.0 @@ -82,18 +82,18 @@ #define CLOUDHEIGHT 2 #define CLOUDSTRETCH 2 #define CLOUDCHANCE 0.1 -#define INIT_LIGHTPITCH MPI_2 * 1.65 -#define INIT_LIGHTYAW MPI_2 * 0.65 +#define INIT_LIGHTPITCH (MPI_2 * 1.65) +#define INIT_LIGHTYAW (MPI_2 * 0.65) #define INIT_MINLIGHT 0.2 #define INIT_DITHERSTART 3.5 -#define INIT_DITHEREND VIEWDISTANCE - 0.5 +#define INIT_DITHEREND (VIEWDISTANCE - 1.5) #define MAXTREEPERCELL 9 #define MAXTREEACROSS 3 #define MAXTREECLOSENESS 0.2 // Player things #define INIT_FOV 90.0 -#define INIT_CAMPITCH MPI_2 * 1.3 // MPI_2 * 1.6 // 1.575 +#define INIT_CAMPITCH (MPI_2 * 1.3) // MPI_2 * 1.6 // 1.575 #define INIT_PLAYERHEIGHT 0.65 #define INIT_PLAYERSPEED \ { .x = 0, .y = 0, .z = -1.5 } @@ -217,7 +217,7 @@ void gen_cloud(render_context *ctx, tecs *ecs, struct vec3i pos) { .up = DEFAULTUP, .lookvec = DEFAULTLOOK, .pos = { - .x = pos.x + RANDF(), .y = CLOUDHEIGHT + 0.0 * RANDF(), .z = pos.z}}; + .x = pos.x + RANDF(), .y = CLOUDHEIGHT + 1.0 * RANDF(), .z = pos.z}}; ECS_SETCOMPONENT(ecs, cloudid, ecs_object){ .flatdither = CLOUDTRANSMIN + (CLOUDTRANSMAX - CLOUDTRANSMIN) * RANDF(), .texture = haloo3d_easystore_gettex(&ecs->storage, PALETTEKEY),