-
Notifications
You must be signed in to change notification settings - Fork 224
/
definitions.h
139 lines (119 loc) · 4.65 KB
/
definitions.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
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
//////////////////////////////////////////////////////////////////////
// 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("Remere's Map Editor")
// Version info
// xxyyzzt (major, minor, subversion)
#define __RME_VERSION_MAJOR__ 3
#define __RME_VERSION_MINOR__ 8
#define __RME_SUBVERSION__ 0
#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__)
#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")
#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 0
#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
#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"
// 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