-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconstants.h
43 lines (33 loc) · 1.17 KB
/
constants.h
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
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#pragma once
#include<variant>
#include<array>
// tile size and scale
constexpr int scaling{3};
constexpr int tileSize{32};
constexpr int scale = scaling*tileSize;
// Grid size
constexpr int gridWidth{8};
constexpr int gridHeight{8};
// Textures
constexpr int maxTextures{10};
// window variables
constexpr std::array<int,2> windowSize = {2 * scale*gridWidth, 2 * scale*gridHeight/2 };
// enum for buttons and menu
enum sectionType {top=0, mid=1, bot=2};
// matrix to transform into isometric + centre grid
constexpr Matrix toIso{
0.5f , -0.5f, -scale/2.0f+windowSize[0]/2.0f, 0.0f,
0.25f, 0.25f, gridHeight*scale/4.0f, 0.0f,
0.0f , 0.0f, 1.0f, 0.0f,
0.0f , 0.0f, 0.0f, 1.0f
};
// matrix to transform from centred isometric grid
constexpr Matrix toGrid{
1.0f , 2.0f, -windowSize[0]/2.0f - gridHeight*scale/2.0f, 0.0f,
-1.0f, 2.0f, -gridHeight*scale/2.0f + windowSize[0]/2.0f, 0.0f,
0.0f , 0.0f, 1.0f, 0.0f,
0.0f , 0.0f, 0.0f, 1.0f
};
// debug output
constexpr bool debug{false};
using Param = std::variant<bool*,int*,float*>;