Team Fortress 2 Source Code as on 22/4/2020
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

41 lines
973 B

  1. #ifndef INCLUDE_CAVE_PARSE_H
  2. #define INCLUDE_CAVE_PARSE_H
  3. typedef struct
  4. {
  5. unsigned char block;
  6. unsigned char data;
  7. unsigned char light:4;
  8. unsigned char skylight:4;
  9. } raw_block;
  10. // this is the old fully-decoded chunk
  11. typedef struct
  12. {
  13. int xpos, zpos, max_y;
  14. int height[16][16];
  15. raw_block rb[16][16][256]; // [z][x][y] which becomes [y][x][z] in stb
  16. } chunk;
  17. chunk *get_decoded_chunk(int chunk_x, int chunk_z);
  18. #define NUM_SEGMENTS 16
  19. typedef struct
  20. {
  21. int max_y, xpos, zpos;
  22. unsigned char *blockdata[NUM_SEGMENTS];
  23. unsigned char *data[NUM_SEGMENTS];
  24. unsigned char *skylight[NUM_SEGMENTS];
  25. unsigned char *light[NUM_SEGMENTS];
  26. void *pointer_to_free;
  27. int refcount; // this allows multi-threaded building without wrapping in ANOTHER struct
  28. } fast_chunk;
  29. fast_chunk *get_decoded_fastchunk(int chunk_x, int chunk_z); // cache, never call free()
  30. fast_chunk *get_decoded_fastchunk_uncached(int chunk_x, int chunk_z);
  31. #endif