VoxelFarmConfig.h
1 /*
2  * Configuration properties for VoxelFarm library
3  */
4 
5 #pragma once
6 
7 #ifndef VOXELFARM_VOXELFARMCONFIG_H
8 #define VOXELFARM_VOXELFARMCONFIG_H
9 
10 #include <set>
11 #include <map>
12 #include <vector>
13 #include <list>
14 #include <string>
15 #include <queue>
16 #include <deque>
17 
18 namespace VoxelFarm
19 {
20  /************************************************************************/
21  /* Memory management */
22  /************************************************************************/
23 #define VF_NEW new
24 #define VF_DELETE delete
25 
26 #define VOXELFARM_USE_DEFAULT_ALLOC 1
27 #define VF_RAWALLOC(bytes) (VoxelFarm::MallocDefault(bytes))
28 #define VF_RAWCALLOC(num, bytes) (VoxelFarm::CallocDefault(num, bytes))
29 #define VF_RAWREALLOC(ptr, bytes) (VoxelFarm::ReallocDefault(ptr, bytes))
30 #define VF_ALLOC(typ, num) ((typ *)VF_RAWALLOC((num) * sizeof(typ)))
31 #define VF_FREE(ptr) (free((ptr)))
32 
33  /************************************************************************/
34  /* Basic types */
35  /************************************************************************/
36 
37  typedef signed char int8_t;
38  typedef unsigned char uint8_t;
39 
40  typedef signed short int16_t;
41  typedef unsigned short uint16_t;
42 
43  typedef signed int int32_t;
44  typedef unsigned int uint32_t;
45 
46  typedef signed __int64 int64_t;
47  typedef unsigned __int64 uint64_t;
48 
49  typedef float float32_t;
50  typedef double float64_t;
51 
52  /************************************************************************/
53  /* Containers */
54  /************************************************************************/
55  template <typename T>
56  using TVector = std::vector<T>;
57 
58  template <typename T>
59  using TList = std::list<T>;
60 
61  template <typename K, typename V>
62  using TMap = std::map<K, V>;
63 
64  template <typename K>
65  using TSet = std::set<K>;
66 
67  template <typename K>
68  using TQueue = std::queue<K>;
69 
70  template <typename K>
71  using TDeque = std::deque<K>;
72 
73  typedef std::string String;
74 
75  /************************************************************************/
76  /* Map size */
77  /************************************************************************/
78 
81  static const int8_t LEVELS = 13;
82 
84  static const int8_t LOD_0 = 2;
85 
87  static const float64_t CELL_SIZE = 30.0;
88 }
89 
90 #include "VoxelFarm.h"
91 
92 #endif // VOXELFARM_VOXELFARMCONFIG_H
Contains all classes and functions for the VoxelFarm engine.