gwnavruntime/base/types.h Source File
Go to the documentation of this file.
8 #ifndef Navigation_Types_H
9 #define Navigation_Types_H
14 #if defined(KY_OS_XBOX360)
15 # include <ppcintrinsics.h>
18 #if defined(KY_OS_PS3)
19 # include <ppu_intrinsics.h>
27 #if defined(KY_BUILD_SHIPPING)
28 # define KY_NO_LOG_OUTPUT
33 #if defined (KY_OS_WIN32)
51 #if defined(KY_OS_XBOX360)
60 typedef signed char KyInt8;
68 #if defined (KY_OS_WIIU)
77 typedef signed char KyInt8;
85 #if defined(KY_OS_LINUX) && defined(KY_64BIT_POINTERS)
94 typedef signed char KyInt8;
103 #if defined(KY_OS_LINUX) && !defined(KY_64BIT_POINTERS)
108 typedef unsigned long long KyUInt64;
112 typedef signed char KyInt8;
120 #if defined(KY_OS_MAC) && defined(KY_64BIT_POINTERS)
129 typedef signed char KyInt8;
137 #if defined (KY_OS_MAC) && !defined(KY_64BIT_POINTERS)
142 typedef unsigned long long KyUInt64;
146 typedef signed char KyInt8;
154 #if defined (KY_OS_IPHONE)
159 typedef unsigned long long KyUInt64;
163 typedef signed char KyInt8;
171 #if defined (KY_OS_PSVITA)
176 typedef unsigned long long KyUInt64;
180 typedef signed char KyInt8;
189 #if defined (KY_OS_PS3)
194 typedef unsigned long long KyUInt64;
198 typedef signed char KyInt8;
206 #if defined (KY_OS_ORBIS)
211 typedef unsigned long long KyUInt64;
215 typedef signed char KyInt8;
224 #define KyInt32MAXVAL 0x7FFFFFFF
225 #define KyInt32MINVAL 0x80000000
226 #define KyUInt32MAXVAL 0xFFFFFFFF
227 #define KyFloat32MAXVAL 3.402823466e+38f
228 #define KyInt16MAXVAL 0x7FFF
229 #define KyInt16MINVAL 0x8000
230 #define KyUInt16MAXVAL 0xFFFF
231 #define KyInt8MAXVAL 0x7F
232 #define KyInt8MINVAL 0x80
233 #define KyUInt8MAXVAL 0xFF
234 #define KyInt64MAXVAL 0x7FFFFFFFFFFFFFFFLL
235 #define KyUInt64MAXVAL 0xFFFFFFFFFFFFFFFFULL
240 #if defined(KY_BUILD_RELEASE)
241 # define KY_PERF_MARKERS_ENABLED
272 #define KY_ERROR Kaim::Result::Failure
273 #define KY_SUCCESS Kaim::Result::Success
274 #define KY_FAILED(expression) (Kaim::Result::Fail(expression))
275 #define KY_SUCCEEDED(expression) (Kaim::Result::Check(expression))
278 #define KY_FORWARD_ERROR_NO_LOG(expression) { KyResult result = (expression); if (result == KY_ERROR) { return result; }}
286 #ifndef KY_DEPRECATED
287 # if (defined (KY_OS_WIN32) || defined (KY_OS_XBOX360)) && !defined (KY_CC_GNU)
288 # define KY_DEPRECATED(f) __declspec(deprecated) f
289 # elif defined(KY_OS_LINUX) || defined(KY_OS_MAC) || defined (KY_OS_PS3) || defined (KY_CC_GNU)
290 # define KY_DEPRECATED(f) f __attribute__ ((deprecated))
292 # define KY_DEPRECATED(f) f
296 #if 0 // Following shows how to use macro KY_DEPRECATED
320 #if defined(KY_CC_MSVC)
321 # define KY_MACRO_START \
323 KY_PUSH_COMPILE_WARNING \
324 KY_PRAGMA_WARNING_DISABLE(4127)
325 # define KY_MACRO_END \
327 KY_POP_COMPILE_WARNING
329 # define KY_MACRO_START do {
330 # define KY_MACRO_END } while(0)
336 #if defined(KY_CC_MSVC)
337 # define KY_DISABLE_ALIGN_WARNING_START KY_PUSH_COMPILE_WARNING KY_PRAGMA_WARNING_DISABLE(4324) // structure was padded due to __declspec(align())
338 # define KY_DISABLE_ALIGN_WARNING_END KY_POP_COMPILE_WARNING
340 # define KY_DISABLE_ALIGN_WARNING_START
341 # define KY_DISABLE_ALIGN_WARNING_END
347 #if (defined (KY_OS_WIN32) || defined (KY_OS_XBOX360)) && !defined (KY_CC_GNU)
348 # define KY_FORCE_ALIGNMENT(alignment, declaration) __declspec(align(alignment)) declaration
349 #elif defined(KY_OS_LINUX) || defined(KY_OS_MAC) || defined (KY_OS_PS3) || defined (KY_OS_WII) || defined (KY_CC_GNU) || defined (KY_OS_PSVITA)
350 # define KY_FORCE_ALIGNMENT(alignment, declaration) declaration __attribute__((aligned(alignment)))
359 template<
typename T, KyUInt32 N>
386 #define KY_CLASS_WITHOUT_COPY(ClassName) \
388 ClassName(const ClassName& rhs); \
389 ClassName& operator=(const ClassName& rhs);
438 #define KY_EXIT_CLASS_TEMPLATE_SCOPE_BASE(classname, functionname, templateDeclareParam, templateUseParam) \
439 template templateDeclareParam \
440 struct classname##_##functionname##_OnExit { \
441 classname templateUseParam * self; \
442 classname##_##functionname##_OnExit(classname templateUseParam * self_) : self(self_) {} \
443 ~classname##_##functionname##_OnExit() \
447 #define KY_EXIT_CLASS_TEMPLATE_SCOPE_BEGIN(classname, functionname, templateParamName) \
448 KY_EXIT_CLASS_TEMPLATE_SCOPE_BASE(classname, functionname, <typename templateParamName>, <templateParamName>)
452 #define KY_EXIT_CLASS_SCOPE_BEGIN(classname, functionname) \
453 struct classname##_##functionname##_OnExit { \
455 classname##_##functionname##_OnExit(classname* self_) : self(self_) {} \
456 ~classname##_##functionname##_OnExit() \
459 #define KY_EXIT_CLASS_SCOPE_END \
464 #define KY_EXIT_SCOPE_TEMPLATE_INSTANCE(classname, functionname, templateParamName) \
465 classname##_##functionname##_OnExit <templateParamName> classname##_##functionname##_OnExit_Instance(this);
468 #define KY_EXIT_SCOPE_INSTANCE(classname, functionname) \
469 classname##_##functionname##_OnExit classname##_##functionname##_OnExit_Instance(this);
472 #define KY_EXIT_SCOPE_BEGIN(classname) \
473 KY_EXIT_CLASS_SCOPE_BEGIN(classname, local)
476 #define KY_EXIT_SCOPE_END(classname) \
477 KY_EXIT_CLASS_SCOPE_END \
478 KY_EXIT_SCOPE_INSTANCE(classname, local)
487 #define KY_TRAVERSE_LOGIC(ClassName, costMode, canEnterMode) \
490 KY_CLASS_WITHOUT_COPY(ClassName) \
492 friend class TraverseLogicObsoleteChecker; \
493 typedef ClassName<canEnterMode> BaseClass; \
495 typedef costMode CostMultiplierUsage; \
496 typedef canEnterMode CanEnterNavTagMode; \
500 #endif // Navigation_Types_H
static const KyFloat32 KY_PI
Stores the value of pi.
Definition: types.h:370
KyInt32 KyResult
Defines a type that can be returned by methods or functions in the Gameware Navigation SDK to indicat...
Definition: types.h:254
static const KyResult Failure
Indicates that the requested operation could not be successfully completed. This return indicates the...
Definition: types.h:261
int KyInt32
Type used internally to represent a 32-bit integer.
Definition: types.h:35
unsigned __int64 KyUInt64
Type used internally to represent an unsigned 64-bit integer.
Definition: types.h:38
unsigned char KyUInt8
Type used internally to represent an unsigned 8-bit integer.
Definition: types.h:41
bool Fail(KyResult result)
Returns true if the specified result code indicates that the requested operation failed.
Definition: types.h:268
Definition: gamekitcrowddispersion.h:20
#define KY_DEPRECATED(f)
Macro to mark a function, class or method as deprecated.
Definition: types.h:289
KyUInt32 ArraySize(T(&)[N])
Returns the size of a fixed-size array.
Definition: types.h:361
unsigned short KyUInt16
Type used internally to represent an unsigned 16-bit integer.
Definition: types.h:40
const KyFloat32 KY_PI_DIVIDED_BY_180
Stores the value of KY_PI divided by 180.
Definition: types.h:376
signed char KyInt8
Type used internally to represent an 8-bit integer.
Definition: types.h:42
unsigned int KyUInt32
Type used internally to represent an unsigned 32-bit integer.
Definition: types.h:36
static const KyFloat32 KY_2_PI
Stores the value of twice pi.
Definition: types.h:373
static const KyResult Success
Indicates that the requested operation was successfully completed.
Definition: types.h:260
bool Check(KyResult result)
Returns true if the specified result code indicates that the requested operation successfully complet...
Definition: types.h:265
double KyFloat64
Type used internally to represent a 64-bit floating-point number.
Definition: types.h:44
__int64 KyInt64
Type used internally to represent a 64-bit integer.
Definition: types.h:37
short KyInt16
Type used internally to represent a 16-bit integer.
Definition: types.h:39
float KyFloat32
Type used internally to represent a 32-bit floating-point number.
Definition: types.h:43
KyFloat32 GetRadiansFromDegrees(KyFloat32 degrees)
Returns angle in radians converted from angle in degrees.
Definition: types.h:379