diff --git a/const.h b/const.h index c58fad8..5aa1d6b 100644 --- a/const.h +++ b/const.h @@ -19,7 +19,7 @@ typedef struct Vertex2 { #define CHUNK_RADIUS_V 4 // 4 #define TEXT_GAP_H 1 / 3.0 -#define TEXT_GAP_V 1 / 1.0 +#define TEXT_GAP_V 1 / 6.0 #define CHUNK_DIAMETER_H (CHUNK_RADIUS_H * 2 + 1) #define CHUNK_DIAMETER_V (CHUNK_RADIUS_V * 2 + 1) diff --git a/cubes.c b/cubes.c index 5f28c94..644a945 100644 --- a/cubes.c +++ b/cubes.c @@ -32,11 +32,12 @@ void gen_face(Vertex *cube, int i, int x, int y, int z, int x2, int y2, int z2, if (is_text) { a.pos[i]--; int exists = 0; - exists = (cube_exists(x, y, z, dat, ci, read_order) != - cube_exists(a.pos[0], a.pos[1], a.pos[2], dat, ci, read_order)); + int type = cube_exists(x, y, z, dat, ci, read_order); + int typeB = cube_exists(a.pos[0], a.pos[1], a.pos[2], dat, ci, read_order); + exists = ((!!type) != (!!typeB)); - a2.pos[0] = exists ? TEXT_GAP_H * i : -1.0; - a2.pos[1] = exists ? TEXT_GAP_V * i : -1.0; + a2.pos[0] = exists ? TEXT_GAP_H * (type ? (type - 1) : (typeB-1)) : -1.0; + a2.pos[1] = exists ? TEXT_GAP_V * (i + (!!type) * 3) : -1.0; a2.pos[2] = 0; if (!exists) { *j = (*j - 6 * a3); @@ -213,7 +214,7 @@ int gen_cubes(Vertex *cube, Vertex *text, Vertex *cubeO, Vertex *textO, int x, if (cached) { thread_return[a2] = i2[a2 / a3]; thread_id[a2] = -1; - } else if (pos.pos[0] < 0 || pos.pos[1] < 0 || pos.pos[2] < 0 || pos.pos[1] < (y * 0.93)) { + } else if (pos.pos[0] < 0 || pos.pos[1] < 0 || pos.pos[2] < 0 || pos.pos[1] < ((y - CHUNK_LENGTH*CHUNK_RADIUS_V) * 1.1)) { thread_return[a2] = -1; thread_id[a2] = -1; } else { diff --git a/gen.c b/gen.c index a0c9ab8..1ccb55a 100644 --- a/gen.c +++ b/gen.c @@ -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; } \ No newline at end of file diff --git a/test.png b/test.png index e4f774e..a53d88b 100644 Binary files a/test.png and b/test.png differ