deepstone
diff src/mglimpl.h @ 9:bce78aaafc68
foo
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sat, 26 Nov 2011 03:59:48 +0200 |
parents | 0e781cc43178 |
children | 0909996838ff |
line diff
1.1 --- a/src/mglimpl.h Mon Nov 21 12:45:18 2011 +0200 1.2 +++ b/src/mglimpl.h Sat Nov 26 03:59:48 2011 +0200 1.3 @@ -21,6 +21,13 @@ 1.4 #define MATRIX_STACK_SIZE 8 1.5 #define MAX_LIGHTS 4 1.6 1.7 +#define ZTILE_SIZE 16384 1.8 +#define ZTILE_SHIFT 14 1.9 +#define ZTILE_MASK 0x3fff 1.10 + 1.11 +#define ZTILE(x) (((x) & ~ZTILE_MASK) >> ZTILE_SHIFT) 1.12 +#define ZTILE_OFFS(x) ((x) & ZTILE_MASK) 1.13 + 1.14 #define ROUND(x) ((x) >= 0.0 ? (x) + 0.5 : (x) - 0.5) 1.15 1.16 typedef struct { 1.17 @@ -71,7 +78,8 @@ 1.18 struct framebuffer { 1.19 int width, height; 1.20 unsigned char *pixels; 1.21 - unsigned short **zbuf; /* zbuffer broken in 64k tiles */ 1.22 + unsigned short **zbuf; /* zbuffer broken in ZTILE_SIZE tiles */ 1.23 + int num_ztiles; 1.24 }; 1.25 1.26