add missing tools/pngdump to the repo
[gbajam22] / src / voxscape.h
1 #ifndef VOXSCAPE_H_
2 #define VOXSCAPE_H_
3
4 #include <stdint.h>
5
6 enum {
7         VOX_NEAREST,
8         VOX_LINEAR
9 };
10
11 struct vox_object {
12         int x, y, px, py;
13         int offs;
14         int32_t scale;
15 };
16
17 extern int *projlut;
18
19 int vox_init(int xsz, int ysz, uint8_t *himg, uint8_t *cimg);
20 void vox_destroy(void);
21
22 void vox_framebuf(int xres, int yres, void *fb, int horizon);
23 /* negative height for auto at -h above terrain */
24 int vox_view(int32_t x, int32_t y, int h, int32_t angle);
25 void vox_proj(int fov, int znear, int zfar);
26
27 void vox_render(void);
28
29 void vox_begin(void);
30 void vox_render_slice(int n);
31
32 void vox_sky_solid(uint8_t color);
33 void vox_sky_grad(uint8_t chor, uint8_t ctop);
34
35 void vox_objects(struct vox_object *ptr, int count, int stride);
36
37 int vox_height(int x, int y);
38 int vox_check_vis(int32_t x0, int32_t y0, int32_t x1, int32_t y1);
39
40 #endif  /* VOXSCAPE_H_ */