forked from OTAcademy/RME
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathdefinitions.h
More file actions
176 lines (146 loc) · 6.15 KB
/
definitions.h
File metadata and controls
176 lines (146 loc) · 6.15 KB
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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
//////////////////////////////////////////////////////////////////////
// This file is part of Remere's Map Editor
//////////////////////////////////////////////////////////////////////
// Remere's Map Editor is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// Remere's Map Editor is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//////////////////////////////////////////////////////////////////////
#ifndef RME_DEFINITIONS_H_
#define RME_DEFINITIONS_H_
#define __W_RME_APPLICATION_NAME__ wxString("OTAcademy Map Editor")
#define __RME_APPLICATION_NAME__ std::string("OTAcademy Map Editor")
// Version info
// xxyyzzt (major, minor, subversion)
#define __RME_VERSION_MAJOR__ 4
#define __RME_VERSION_MINOR__ 1
#define __RME_SUBVERSION__ 2
#define __LIVE_NET_VERSION__ 5
#define MAKE_VERSION_ID(major, minor, subversion) \
((major) * 10000000 + (minor) * 100000 + (subversion) * 1000)
#define __RME_VERSION_ID__ MAKE_VERSION_ID( \
__RME_VERSION_MAJOR__, \
__RME_VERSION_MINOR__, \
__RME_SUBVERSION__ \
)
#define __SITE_URL__ "https://github.com/OTAcademy/RME"
// #define __PRERELEASE__ 1
#ifdef __EXPERIMENTAL__
#define __RME_VERSION__ std::string(i2s(__RME_VERSION_MAJOR__) + "." + i2s(__RME_VERSION_MINOR__) + "." + i2s(__RME_SUBVERSION__) + " BETA")
#define __W_RME_VERSION__ (wxString() << __RME_VERSION_MAJOR__ << "." << __RME_VERSION_MINOR__ << "." << __RME_SUBVERSION__ << " BETA")
#elif __SNAPSHOT__
#define __RME_VERSION__ std::string(i2s(__RME_VERSION_MAJOR__) + "." + i2s(__RME_VERSION_MINOR__) + "." + i2s(__RME_SUBVERSION__) + " - SNAPSHOT")
#define __W_RME_VERSION__ (wxString() << __RME_VERSION_MAJOR__ << "." << __RME_VERSION_MINOR__ << "." << __RME_SUBVERSION__ << " - SNAPSHOT")
#elif __PRERELEASE__
#define __RME_VERSION__ std::string(i2s(__RME_VERSION_MAJOR__) + "." + i2s(__RME_VERSION_MINOR__) + "." + i2s(__RME_SUBVERSION__) + " (Pre-release)")
#define __W_RME_VERSION__ (wxString() << __RME_VERSION_MAJOR__ << "." << __RME_VERSION_MINOR__ << "." << __RME_SUBVERSION__ << " (Pre-release)")
#else
#define __RME_VERSION__ std::string(i2s(__RME_VERSION_MAJOR__) + "." + i2s(__RME_VERSION_MINOR__) + "." + i2s(__RME_SUBVERSION__))
#define __W_RME_VERSION__ (wxString() << __RME_VERSION_MAJOR__ << "." << __RME_VERSION_MINOR__ << "." << __RME_SUBVERSION__)
#endif
// OS
#define OTGZ_SUPPORT 1
#define ASSETS_NAME "Tibia"
#ifdef __VISUALC__
#pragma warning(disable : 4996) // Stupid MSVC complaining 'bout "unsafe" functions
#pragma warning(disable : 4800) // Bool conversion warning
#pragma warning(disable : 4100) // Unused parameter warning ( I like to name unused stuff... )
#pragma warning(disable : 4706) // Assignment within conditional expression
#endif
#ifndef FORCEINLINE
#ifdef __VISUALC__
#define FORCEINLINE __forceinline
#else
#define FORCEINLINE inline
#endif
#endif
// Debug mode?
#if defined __DEBUG__ || defined _DEBUG || defined __DEBUG_MODE__
#undef __DEBUG_MODE__
#define __DEBUG_MODE__ 1
#undef _DEBUG
#define _DEBUG 1
#undef __DEBUG__
#define __DEBUG__ 1
#else
#ifndef __RELEASE__
#define __RELEASE__ 1
#endif
#ifndef NDEBUG
#define NDEBUG 1
#endif
#endif
#ifdef __RELEASE__
#ifdef __VISUALC__
#define _SCL_SECURE 0
#define _SECURE_SCL 0 // They can't even decide on a coherent define interface!
#define _HAS_ITERATOR_DEBUGGING 0
#endif
#endif
#ifndef _DONT_USE_UPDATER_
#if defined __WINDOWS__ && !defined _USE_UPDATER_
#define _USE_UPDATER_
#endif
#endif
#ifndef _DONT_USE_PROCESS_COM
#if defined __WINDOWS__ && !defined _USE_PROCESS_COM
#define _USE_PROCESS_COM
#endif
#endif
// Mathematical constants
#define PI 3.14159265358979323846264338327950288419716939937510
#define DEG2RAD (PI / 180.0)
#define RAD2DEG (180.0 / DEG)
// The height of the map (there should be more checks for this...)
#define MAP_LAYERS 16
#define MAP_MAX_WIDTH 65000
#define MAP_MAX_HEIGHT 65000
#define MAP_MAX_LAYER 15
// The size of the tile in pixels
constexpr int TileSize = 32;
// The default size of sprites
#define SPRITE_PIXELS 32
#define SPRITE_PIXELS_SIZE SPRITE_PIXELS* SPRITE_PIXELS
// The sea layer
#define GROUND_LAYER 7
constexpr int ClientMapWidth = 17;
constexpr int ClientMapHeight = 13;
#define MAP_LOAD_FILE_WILDCARD_OTGZ "OpenTibia Binary Map (*.otbm;*.otgz)|*.otbm;*.otgz"
#define MAP_SAVE_FILE_WILDCARD_OTGZ "OpenTibia Binary Map (*.otbm)|*.otbm|Compressed OpenTibia Binary Map (*.otgz)|*.otgz"
#define MAP_LOAD_FILE_WILDCARD "OpenTibia Binary Map (*.otbm)|*.otbm"
#define MAP_SAVE_FILE_WILDCARD "OpenTibia Binary Map (*.otbm)|*.otbm"
// Lights
constexpr int MaxLightIntensity = 8;
constexpr int PixelFormatRGB = 3;
constexpr int PixelFormatRGBA = 4;
// wxString conversions
#define nstr(str) std::string((const char*)(str.mb_str(wxConvUTF8)))
#define wxstr(str) wxString((str).c_str(), wxConvUTF8)
// increment & decrement definitions
#define IMPLEMENT_INCREMENT_OP(Type) \
namespace { \
Type& operator++(Type& type) { \
return (type = static_cast<Type>(type + 1)); \
} \
Type operator++(Type& type, int) { \
return static_cast<Type>((++type) - 1); \
} \
}
#define IMPLEMENT_DECREMENT_OP(Type) \
namespace { \
Type& operator--(Type& type) { \
return (type = static_cast<Type>(type - 1)); \
} \
Type operator--(Type& type, int) { \
return static_cast<Type>((--type) + 1); \
} \
}
#endif