diff options
| author | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
|---|---|---|
| committer | FluorescentCIAAfricanAmerican <[email protected]> | 2020-04-22 12:56:21 -0400 |
| commit | 3bf9df6b2785fa6d951086978a3e66f49427166a (patch) | |
| tree | 2c0f1f0c63c4832882bc93814ebd2c2b1c6224e5 /thirdparty/stb/tests/caveview/caveview.h | |
| download | archived-source-engine-2018-hl2-src-master.tar.xz archived-source-engine-2018-hl2-src-master.zip | |
Diffstat (limited to 'thirdparty/stb/tests/caveview/caveview.h')
| -rw-r--r-- | thirdparty/stb/tests/caveview/caveview.h | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/thirdparty/stb/tests/caveview/caveview.h b/thirdparty/stb/tests/caveview/caveview.h new file mode 100644 index 0000000..73a71da --- /dev/null +++ b/thirdparty/stb/tests/caveview/caveview.h @@ -0,0 +1,50 @@ +#ifndef INCLUDE_CAVEVIEW_H +#define INCLUDE_CAVEVIEW_H + +#include "stb.h" + +#include "stb_voxel_render.h" + +typedef struct +{ + int cx,cy; + + stbvox_mesh_maker mm; + + uint8 *build_buffer; + uint8 *face_buffer; + + int num_quads; + float transform[3][3]; + float bounds[2][3]; + + uint8 sv_blocktype[34][34][18]; + uint8 sv_lighting [34][34][18]; +} raw_mesh; + +// a 3D checkerboard of empty,solid would be: 32x32x255x6/2 ~= 800000 +// an all-leaf qchunk would be: 32 x 32 x 255 x 6 ~= 1,600,000 + +#define BUILD_QUAD_MAX 400000 +#define BUILD_BUFFER_SIZE (4*4*BUILD_QUAD_MAX) // 4 bytes per vertex, 4 vertices per quad +#define FACE_BUFFER_SIZE ( 4*BUILD_QUAD_MAX) // 4 bytes per quad + + +extern void mesh_init(void); +extern void render_init(void); +extern void world_init(void); +extern void ods(char *fmt, ...); // output debug string +extern void reset_cache_size(int size); + + +extern void render_caves(float pos[3]); + + +#include "cave_parse.h" // fast_chunk + +extern fast_chunk *get_converted_fastchunk(int chunk_x, int chunk_y); +extern void build_chunk(int chunk_x, int chunk_y, fast_chunk *fc_table[4][4], raw_mesh *rm); +extern void reset_cache_size(int size); +extern void deref_fastchunk(fast_chunk *fc); + +#endif
\ No newline at end of file |