-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathPrerequisites.h
565 lines (519 loc) · 16.1 KB
/
Prerequisites.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
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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
#ifndef __OgrePrerequisites_H__
#define __OgrePrerequisites_H__
// Platform-specific stuff
#include "Platform.h"
#include "windows.h"
#include <vector>
#include <list>
#include <map>
#include <set>
#include <algorithm>
#include <string>
#include <assert.h>
#include <hash_map>
// configure memory tracking
#if OGRE_DEBUG_MODE
# if OGRE_MEMORY_TRACKER_DEBUG_MODE
# define OGRE_MEMORY_TRACKER 1
# else
# define OGRE_MEMORY_TRACKER 0
# endif
#else
# if OGRE_MEMORY_TRACKER_RELEASE_MODE
# define OGRE_MEMORY_TRACKER 1
# else
# define OGRE_MEMORY_TRACKER 0
# endif
#endif
// Define ogre version
#define OGRE_VERSION_MAJOR 1
#define OGRE_VERSION_MINOR 10
#define OGRE_VERSION_PATCH 2
#define OGRE_VERSION_SUFFIX ""
#define OGRE_VERSION_NAME "Xalafu"
#define OGRE_VERSION ((OGRE_VERSION_MAJOR << 16) | (OGRE_VERSION_MINOR << 8) | OGRE_VERSION_PATCH)
// define the real number values to be used
// default to use 'float' unless precompiler option set
#if OGRE_DOUBLE_PRECISION == 1
/** Software floating point type.
@note Not valid as a pointer to GPU buffers / parameters
*/
typedef double Real;
#else
/** Software floating point type.
@note Not valid as a pointer to GPU buffers / parameters
*/
typedef float Real;
#endif
#if OGRE_COMPILER == OGRE_COMPILER_GNUC && OGRE_COMP_VER >= 310 && !defined(STLPORT)
# if OGRE_COMP_VER >= 430
# define OGRE_HashMap ::std::tr1::unordered_map
# define OGRE_HashMultiMap ::std::tr1::unordered_multimap
# define OGRE_HashSet ::std::tr1::unordered_set
# define OGRE_HashMultiSet ::std::tr1::unordered_multiset
# else
# define OGRE_HashMap ::__gnu_cxx::hash_map
# define OGRE_HashMultiMap ::__gnu_cxx::hash_multimap
# define OGRE_HashSet ::__gnu_cxx::hash_set
# define OGRE_HashMultiSet ::__gnu_cxx::hash_multiset
# endif
#elif OGRE_COMPILER == OGRE_COMPILER_CLANG
# if defined(_LIBCPP_VERSION)
# define OGRE_HashMap ::std::unordered_map
# define OGRE_HashMultiMap ::std::unordered_multimap
# define OGRE_HashSet ::std::unordered_set
# define OGRE_HashMultiSet ::std::unordered_multiset
# else
# define OGRE_HashMap ::std::tr1::unordered_map
# define OGRE_HashMultiMap ::std::tr1::unordered_multimap
# define OGRE_HashSet ::std::tr1::unordered_set
# define OGRE_HashMultiSet ::std::tr1::unordered_multiset
# endif
#else
# if OGRE_COMPILER == OGRE_COMPILER_MSVC && !defined(_STLP_MSVC)
# if _MSC_FULL_VER >= 150030729 // VC++ 9.0 SP1+
# define OGRE_HashMap ::std::tr1::unordered_map
# define OGRE_HashMultiMap ::std::tr1::unordered_multimap
# define OGRE_HashSet ::std::tr1::unordered_set
# define OGRE_HashMultiSet ::std::tr1::unordered_multiset
# elif OGRE_THREAD_PROVIDER == 1
# define OGRE_HashMap ::boost::unordered_map
# define OGRE_HashMultiMap ::boost::unordered_multimap
# define OGRE_HashSet ::boost::unordered_set
# define OGRE_HashMultiSet ::boost::unordered_multiset
# else
# define OGRE_HashMap ::std::unordered_map
# define OGRE_HashMultiMap ::std::unordered_multimap
# define OGRE_HashSet ::std::unordered_set
# define OGRE_HashMultiSet ::std::unordered_multiset
# endif
# else
# define OGRE_HashMap ::std::unordered_map
# define OGRE_HashMultiMap ::std::unordered_multimap
# define OGRE_HashSet ::std::unordered_set
# define OGRE_HashMultiSet ::std::unordered_multiset
# endif
#endif
/** In order to avoid finger-aches :)
*/
typedef unsigned char uchar;
typedef unsigned short ushort;
typedef unsigned int uint;
typedef unsigned long ulong;
#if __cplusplus >= 201103L
#define register
#endif
enum EntityType
{
Static_Entity = 0,
Animate_Entity
};
// Pre-declare classes
// Allows use of pointers in header files without including individual .h
// so decreases dependencies between files
class Angle;
class AnimableValue;
class Animation;
class AnimationState;
class AnimationStateSet;
class AnimationTrack;
class Archive;
class ArchiveFactory;
class ArchiveManager;
class AutoParamDataSource;
class AxisAlignedBox;
class AxisAlignedBoxSceneQuery;
class Billboard;
class BillboardChain;
class BillboardSet;
class Bone;
class Camera;
class Codec;
class ColourValue;
class ConfigDialog;
template <typename T> class Controller;
template <typename T> class ControllerFunction;
class ControllerManager;
template <typename T> class ControllerValue;
class DataStream;
class DefaultWorkQueue;
class Degree;
class DepthBuffer;
class DynLib;
class DynLibManager;
class EdgeData;
class EdgeListBuilder;
class Entity;
class ErrorDialog;
class ExternalTextureSourceManager;
class Factory;
struct FrameEvent;
class FrameListener;
class Frustum;
struct GpuLogicalBufferStruct;
struct GpuNamedConstants;
class GpuProgramParameters;
class GpuSharedParameters;
class GpuProgram;
class GpuProgramManager;
class GpuProgramUsage;
class HardwareIndexBuffer;
class HardwareOcclusionQuery;
class HardwareVertexBuffer;
class HardwarePixelBuffer;
class HardwarePixelBufferSharedPtr;
class HighLevelGpuProgram;
class HighLevelGpuProgramManager;
class HighLevelGpuProgramFactory;
class IndexData;
class InstanceBatch;
class InstanceBatchHW;
class InstanceBatchHW_VTF;
class InstanceBatchShader;
class InstanceBatchVTF;
class InstanceManager;
class InstancedEntity;
class IntersectionSceneQuery;
class IntersectionSceneQueryListener;
class Image;
class KeyFrame;
class Light;
class Log;
class LogManager;
class LodStrategy;
class LodStrategyManager;
class ManualResourceLoader;
class ManualObject;
class Material;
class MaterialManager;
class Math;
class Matrix3;
class Matrix4;
class MemoryDataStream;
class MemoryManager;
class Mesh;
class MeshSerializer;
class MeshSerializerImpl;
class MeshManager;
class MovableObject;
class MovablePlane;
class OctreeSceneNode;
class NodeAnimationTrack;
class NodeKeyFrame;
class NumericAnimationTrack;
class NumericKeyFrame;
class Particle;
class ParticleAffector;
class ParticleAffectorFactory;
class ParticleEmitter;
class ParticleEmitterFactory;
class ParticleSystem;
class ParticleSystemManager;
class ParticleSystemRenderer;
class ParticleSystemRendererFactory;
class ParticleVisualData;
class Pass;
class PatchMesh;
class PixelBox;
class Plane;
class PlaneBoundedVolume;
class Plugin;
class Pose;
class Profile;
class Profiler;
class Quaternion;
class Radian;
class Ray;
class RaySceneQuery;
class RaySceneQueryListener;
class Renderable;
class RenderPriorityGroup;
class RenderQueue;
class RenderQueueGroup;
class RenderQueueInvocation;
class RenderQueueInvocationSequence;
class RenderQueueListener;
class RenderObjectListener;
class RenderSystem;
class RenderSystemCapabilities;
class RenderSystemCapabilitiesManager;
class RenderSystemCapabilitiesSerializer;
class RenderTarget;
class RenderTargetListener;
class RenderTexture;
class RenderToVertexBuffer;
class MultiRenderTarget;
class RenderWindow;
class RenderOperation;
class Resource;
class ResourceBackgroundQueue;
class ResourceGroupManager;
class ResourceManager;
class RibbonTrail;
class Root;
class SceneManager;
class SceneManagerEnumerator;
class SceneNode;
class SceneQuery;
class SceneQueryListener;
class ScriptCompiler;
class ScriptCompilerManager;
class ScriptLoader;
class Serializer;
class ShadowCameraSetup;
class ShadowCaster;
class ShadowRenderable;
class ShadowTextureManager;
class SimpleRenderable;
class SimpleSpline;
class Skeleton;
class SkeletonInstance;
class SkeletonManager;
class Sphere;
class SphereSceneQuery;
class StaticGeometry;
class StreamSerialiser;
class StringConverter;
class StringInterface;
class SubEntity;
class SubMesh;
class TagPoint;
class Technique;
class TempBlendedBufferInfo;
class ExternalTextureSource;
class TextureUnitState;
class Texture;
class TextureManager;
class TransformKeyFrame;
class Timer;
class UserObjectBindings;
class Vector2;
class Vector3;
class Vector4;
class Viewport;
class VertexAnimationTrack;
class VertexBufferBinding;
class VertexData;
class VertexDeclaration;
class VertexMorphKeyFrame;
class WireBoundingBox;
class WorkQueue;
class Compositor;
class CompositorManager;
class CompositorChain;
class CompositorInstance;
class CompositorLogic;
class CompositionTechnique;
class CompositionPass;
class CompositionTargetPass;
class CustomCompositionPass;
template<typename T> class SharedPtr;
typedef SharedPtr<AnimableValue> AnimableValuePtr;
typedef SharedPtr<Compositor> CompositorPtr;
typedef SharedPtr<DataStream> DataStreamPtr;
typedef SharedPtr<GpuProgram> GpuProgramPtr;
typedef SharedPtr<GpuNamedConstants> GpuNamedConstantsPtr;
typedef SharedPtr<GpuLogicalBufferStruct> GpuLogicalBufferStructPtr;
typedef SharedPtr<GpuSharedParameters> GpuSharedParametersPtr;
typedef SharedPtr<GpuProgramParameters> GpuProgramParametersSharedPtr;
typedef SharedPtr<HighLevelGpuProgram> HighLevelGpuProgramPtr;
typedef SharedPtr<Material> MaterialPtr;
typedef SharedPtr<MemoryDataStream> MemoryDataStreamPtr;
typedef SharedPtr<Mesh> MeshPtr;
typedef SharedPtr<PatchMesh> PatchMeshPtr;
typedef SharedPtr<RenderToVertexBuffer> RenderToVertexBufferSharedPtr;
typedef SharedPtr<Resource> ResourcePtr;
typedef SharedPtr<ShadowCameraSetup> ShadowCameraSetupPtr;
typedef SharedPtr<Skeleton> SkeletonPtr;
typedef SharedPtr<Texture> TexturePtr;
/* Include all the standard header *after* all the configuration
settings have been made.
*/
#if OGRE_STRING_USE_CUSTOM_MEMORY_ALLOCATOR
#if OGRE_WCHAR_T_STRINGS
typedef std::basic_string<wchar_t, std::char_traits<wchar_t>, STLAllocator<wchar_t, GeneralAllocPolicy > > _StringBase;
#else
typedef std::basic_string<char, std::char_traits<char>, STLAllocator<char, GeneralAllocPolicy > > _StringBase;
#endif
#if OGRE_WCHAR_T_STRINGS
typedef std::basic_stringstream<wchar_t, std::char_traits<wchar_t>, STLAllocator<wchar_t, GeneralAllocPolicy >> _StringStreamBase;
#else
typedef std::basic_stringstream<char, std::char_traits<char>, STLAllocator<char, GeneralAllocPolicy > > _StringStreamBase;
#endif
#define StdStringT(T) std::basic_string<T, std::char_traits<T>, std::allocator<T> >
#define CustomMemoryStringT(T) std::basic_string<T, std::char_traits<T>, STLAllocator<T,GeneralAllocPolicy> >
template<typename T>
bool operator <(const CustomMemoryStringT(T)& l, const StdStringT(T)& o)
{
return l.compare(0, l.length(), o.c_str(), o.length())<0;
}
template<typename T>
bool operator <(const StdStringT(T)& l, const CustomMemoryStringT(T)& o)
{
return l.compare(0, l.length(), o.c_str(), o.length())<0;
}
template<typename T>
bool operator <=(const CustomMemoryStringT(T)& l, const StdStringT(T)& o)
{
return l.compare(0, l.length(), o.c_str(), o.length()) <= 0;
}
template<typename T>
bool operator <=(const StdStringT(T)& l, const CustomMemoryStringT(T)& o)
{
return l.compare(0, l.length(), o.c_str(), o.length()) <= 0;
}
template<typename T>
bool operator >(const CustomMemoryStringT(T)& l, const StdStringT(T)& o)
{
return l.compare(0, l.length(), o.c_str(), o.length())>0;
}
template<typename T>
bool operator >(const StdStringT(T)& l, const CustomMemoryStringT(T)& o)
{
return l.compare(0, l.length(), o.c_str(), o.length())>0;
}
template<typename T>
bool operator >=(const CustomMemoryStringT(T)& l, const StdStringT(T)& o)
{
return l.compare(0, l.length(), o.c_str(), o.length()) >= 0;
}
template<typename T>
bool operator >=(const StdStringT(T)& l, const CustomMemoryStringT(T)& o)
{
return l.compare(0, l.length(), o.c_str(), o.length()) >= 0;
}
template<typename T>
bool operator ==(const CustomMemoryStringT(T)& l, const StdStringT(T)& o)
{
return l.compare(0, l.length(), o.c_str(), o.length()) == 0;
}
template<typename T>
bool operator ==(const StdStringT(T)& l, const CustomMemoryStringT(T)& o)
{
return l.compare(0, l.length(), o.c_str(), o.length()) == 0;
}
template<typename T>
bool operator !=(const CustomMemoryStringT(T)& l, const StdStringT(T)& o)
{
return l.compare(0, l.length(), o.c_str(), o.length()) != 0;
}
template<typename T>
bool operator !=(const StdStringT(T)& l, const CustomMemoryStringT(T)& o)
{
return l.compare(0, l.length(), o.c_str(), o.length()) != 0;
}
template<typename T>
CustomMemoryStringT(T) operator +=(const CustomMemoryStringT(T)& l, const StdStringT(T)& o)
{
return CustomMemoryStringT(T)(l) += o.c_str();
}
template<typename T>
CustomMemoryStringT(T) operator +=(const StdStringT(T)& l, const CustomMemoryStringT(T)& o)
{
return CustomMemoryStringT(T)(l.c_str()) += o.c_str();
}
template<typename T>
CustomMemoryStringT(T) operator +(const CustomMemoryStringT(T)& l, const StdStringT(T)& o)
{
return CustomMemoryStringT(T)(l) += o.c_str();
}
template<typename T>
CustomMemoryStringT(T) operator +(const StdStringT(T)& l, const CustomMemoryStringT(T)& o)
{
return CustomMemoryStringT(T)(l.c_str()) += o.c_str();
}
template<typename T>
CustomMemoryStringT(T) operator +(const T* l, const CustomMemoryStringT(T)& o)
{
return CustomMemoryStringT(T)(l) += o;
}
#undef StdStringT
#undef CustomMemoryStringT
#else
#if OGRE_WCHAR_T_STRINGS
typedef std::wstring _StringBase;
#else
typedef std::string _StringBase;
#endif
#if OGRE_WCHAR_T_STRINGS
typedef std::basic_stringstream<wchar_t, std::char_traits<wchar_t>, std::allocator<wchar_t> > _StringStreamBase;
#else
typedef std::basic_stringstream<char, std::char_traits<char>, std::allocator<char> > _StringStreamBase;
#endif
#endif
typedef _StringBase String;
typedef _StringStreamBase StringStream;
typedef StringStream stringstream;
#if OGRE_STRING_USE_CUSTOM_MEMORY_ALLOCATOR
namespace std
{
#if (OGRE_COMPILER == OGRE_COMPILER_GNUC && OGRE_COMP_VER >= 430) || OGRE_COMPILER == OGRE_COMPILER_CLANG && !defined(STLPORT) && __cplusplus < 201103L
namespace tr1
{
#endif
template <> struct hash<String>
{
public:
size_t operator()(const String &str) const
{
size_t _Val = 2166136261U;
size_t _First = 0;
size_t _Last = str.size();
size_t _Stride = 1 + _Last / 10;
for (; _First < _Last; _First += _Stride)
_Val = 16777619U * _Val ^ (size_t)str[_First];
return (_Val);
}
};
#if (OGRE_COMPILER == OGRE_COMPILER_GNUC && OGRE_COMP_VER >= 430) || OGRE_COMPILER == OGRE_COMPILER_CLANG && !defined(STLPORT) && __cplusplus < 201103L
}
#endif
}
#endif
//for stl container
#if OGRE_CONTAINERS_USE_CUSTOM_MEMORY_ALLOCATOR
template <typename T, typename A = STLAllocator<T, GeneralAllocPolicy> >
struct deque
{
typedef typename std::deque<T, A> type;
typedef typename std::deque<T, A>::iterator iterator;
typedef typename std::deque<T, A>::const_iterator const_iterator;
};
template <typename T, typename A = STLAllocator<T, GeneralAllocPolicy> >
struct vector
{
typedef typename std::vector<T, A> type;
typedef typename std::vector<T, A>::iterator iterator;
typedef typename std::vector<T, A>::const_iterator const_iterator;
};
template <typename T, typename A = STLAllocator<T, GeneralAllocPolicy> >
struct list
{
typedef typename std::list<T, A> type;
typedef typename std::list<T, A>::iterator iterator;
typedef typename std::list<T, A>::const_iterator const_iterator;
};
template <typename T, typename P = std::less<T>, typename A = STLAllocator<T, GeneralAllocPolicy> >
struct set
{
typedef typename std::set<T, P, A> type;
typedef typename std::set<T, P, A>::iterator iterator;
typedef typename std::set<T, P, A>::const_iterator const_iterator;
};
template <typename K, typename V, typename P = std::less<K>, typename A = STLAllocator<std::pair<const K, V>, GeneralAllocPolicy> >
struct map
{
typedef typename std::map<K, V, P, A> type;
typedef typename std::map<K, V, P, A>::iterator iterator;
typedef typename std::map<K, V, P, A>::const_iterator const_iterator;
};
template <typename K, typename V, typename P = std::less<K>, typename A = STLAllocator<std::pair<const K, V>, GeneralAllocPolicy> >
struct multimap
{
typedef typename std::multimap<K, V, P, A> type;
typedef typename std::multimap<K, V, P, A>::iterator iterator;
typedef typename std::multimap<K, V, P, A>::const_iterator const_iterator;
};
#else
#endif
#endif