This commit is contained in:
onezplpl 2024-07-16 17:53:09 -04:00
parent c4181e5c42
commit 678db8574f
No known key found for this signature in database
GPG key ID: 7EC026A136F9EEC3
6 changed files with 125 additions and 116 deletions

46
cubes.h
View file

@ -1,3 +1,45 @@
#include "const.h"
#ifndef V_CUBES_H
#define V_CUBES_H
#include "linmath.h"
int gen_cubes(Vertex *cube, Vertex *text, Vertex *cubeO, Vertex *textO, int x, int y, int z, int is_purge, int *i2);
#define CHUNK_LENGTH 16
#define CHUNK_RADIUS_H 4 // 8
#define CHUNK_RADIUS_V 4 // 4
#define TEXT_GAP_H 1 / 3.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)
#define CHUNK_ALL CHUNK_DIAMETER_H *CHUNK_DIAMETER_H *CHUNK_DIAMETER_V
#define BLOCK_ALL CHUNK_LENGTH *CHUNK_LENGTH *CHUNK_LENGTH
#define CBLOCK_ALL BLOCK_ALL *CHUNK_ALL
#define CBUF_ALL 2
#define CTRI_ALL CBLOCK_ALL * 18 * sizeof(struct v3f)
struct chunk {
unsigned char exists;
unsigned int x;
unsigned int y;
unsigned int z;
unsigned int blocks[BLOCK_ALL];
};
struct v3f {
vec3 pos;
};
struct v3i {
int pos[3];
};
struct v2f {
vec2 pos;
};
int gen_cubes(struct v3f *cube, struct v3f *text, struct v3f *cubeO,
struct v3f *textO, int x, int y, int z, int is_purge, int *i2);
void free_chunks_old();
#endif