multiple textures

This commit is contained in:
onezplpl 2024-07-15 12:22:23 -04:00
parent 1223b56652
commit 579eb9f540
No known key found for this signature in database
GPG key ID: 7EC026A136F9EEC3
4 changed files with 9 additions and 8 deletions

4
gen.c
View file

@ -139,7 +139,7 @@ Chunk fetch_chunk(int x, int y, int z, int ci, int h, int r_order) {
for (int y2 = 0; y2 < CHUNK_LENGTH; y2++) {
int y3 = y2 + y * CHUNK_LENGTH;
chunk.blocks[c] = (y3 < h);
chunk.blocks[c] = (y3 < h) ? (((int)((hp + 64.0) * 2.98) % 3) + 1) : 0;
c++;
}
}
@ -182,5 +182,5 @@ int cube_exists(int x, int y, int z, Chunk dat, int ci, int r_order) {
int h = dat.blocks[(y % CHUNK_LENGTH) + (z % CHUNK_LENGTH) * CHUNK_LENGTH +
(x % CHUNK_LENGTH) * CHUNK_LENGTH * CHUNK_LENGTH];
return !!h;
return h;
}