-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathConfigInternal.h
More file actions
26 lines (16 loc) · 860 Bytes
/
ConfigInternal.h
File metadata and controls
26 lines (16 loc) · 860 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#ifndef CONFIGINTERNAL_H
#define CONFIGINTERNAL_H
namespace P3D
{
inline constexpr int constexpr_log2(int v) { return v ? 1 + constexpr_log2(v >> 1) : -1; }
inline constexpr int TEX_SHIFT = constexpr_log2(TEX_SIZE);
inline constexpr int TEX_MASK = (TEX_SIZE-1);
inline constexpr int TEX_SIZE_PIXELS = (TEX_SIZE * TEX_SIZE);
inline constexpr int TEX_SIZE_BYTES = (TEX_SIZE_PIXELS * sizeof(pixel));
inline constexpr int SUBDIVIDE_SPAN_SHIFT = constexpr_log2(SUBDIVIDE_SPAN_LEN);
inline constexpr int FOG_SHIFT = constexpr_log2(FOG_LEVELS);
inline constexpr int LIGHT_SHIFT = constexpr_log2(LIGHT_LEVELS);
inline constexpr fp FOG_MAX = fp(1) - std::numeric_limits<fp>().epsilon();
inline constexpr fp LIGHT_MAX = fp(1) - std::numeric_limits<fp>().epsilon();
}
#endif // CONFIGINTERNAL_H