caveview.h
This file
Path
tests/caveview/caveview.h
50 lines · 1.2 KiB · C
Last changed by
Not known.
History of this fileTake it
The walk stopped after 200 commits: lines older than aeec66c point at it.
Merge branch 'randlong' of https://github.com/flibitijibibo/stb into workingSean Barrettbefore adoptionaeec66c
lines 1–50why, one step back1#ifndef INCLUDE_CAVEVIEW_H2#define INCLUDE_CAVEVIEW_H34#include "stb.h"56#include "stb_voxel_render.h"78typedef struct9{10 int cx,cy;1112 stbvox_mesh_maker mm;1314 uint8 *build_buffer;15 uint8 *face_buffer;1617 int num_quads;18 float transform[3][3];19 float bounds[2][3];2021 uint8 sv_blocktype[34][34][18];22 uint8 sv_lighting [34][34][18];23} raw_mesh;2425// a 3D checkerboard of empty,solid would be: 32x32x255x6/2 ~= 80000026// an all-leaf qchunk would be: 32 x 32 x 255 x 6 ~= 1,600,0002728#define BUILD_QUAD_MAX 40000029#define BUILD_BUFFER_SIZE (4*4*BUILD_QUAD_MAX) // 4 bytes per vertex, 4 vertices per quad30#define FACE_BUFFER_SIZE ( 4*BUILD_QUAD_MAX) // 4 bytes per quad313233extern void mesh_init(void);34extern void render_init(void);35extern void world_init(void);36extern void ods(char *fmt, ...); // output debug string37extern void reset_cache_size(int size);383940extern void render_caves(float pos[3]);414243#include "cave_parse.h" // fast_chunk4445extern fast_chunk *get_converted_fastchunk(int chunk_x, int chunk_y);46extern void build_chunk(int chunk_x, int chunk_y, fast_chunk *fc_table[4][4], raw_mesh *rm);47extern void reset_cache_size(int size);48extern void deref_fastchunk(fast_chunk *fc);4950#endif