123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122 |
-
- #ifndef _GLOBAL_H_
- #define _GLOBAL_H_
-
- #include "config.h"
-
-
- #define DEFAULT_CONFIG_PATH "~/.OpenRaider"
- #define DEFAULT_CONFIG_FILE "OpenRaider.ini"
- #define DEFAULT_WIDTH 640
- #define DEFAULT_HEIGHT 480
-
-
- enum ColorMode {
- GREYSCALE,
- RGB,
- RGBA,
- ARGB,
- BGR,
- BGRA
- };
-
-
- const unsigned char BLACK[] = { 0, 0, 0, 255 };
- const unsigned char GREY[] = { 128, 128, 128, 255 };
- const unsigned char WHITE[] = { 255, 255, 255, 255 };
- const unsigned char RED[] = { 255, 0, 0, 255 };
- const unsigned char GREEN[] = { 0, 255, 0, 255 };
- const unsigned char PURPLE[] = { 77, 77, 128, 255 };
- const unsigned char BLUE[] = { 128, 179, 255, 255 };
- const unsigned char PINK[] = { 255, 0, 255, 255 };
- const unsigned char YELLOW[] = { 255, 255, 0, 255 };
- const unsigned char CYAN[] = { 0, 255, 255, 255 };
-
-
- typedef enum {
- menuAction = 0,
- consoleAction,
- forwardAction,
- backwardAction,
- leftAction,
- rightAction,
- jumpAction,
- crouchAction,
- useAction,
- holsterAction,
- walkAction,
-
- ActionEventCount
- } ActionEvents;
-
-
- typedef enum {
- zeroKey = '0', oneKey = '1', twoKey = '2',
- threeKey = '3', fourKey = '4', fiveKey = '5',
- sixKey = '6', sevenKey = '7', eightKey = '8',
- nineKey = '9', aKey = 'a', bKey = 'b',
- cKey = 'c', dKey = 'd', eKey = 'e', fKey = 'f',
- gKey = 'g', hKey = 'h', iKey = 'i', jKey = 'j',
- kKey = 'k', lKey = 'l', mKey = 'm', nKey = 'n',
- oKey = 'o', pKey = 'p', qKey = 'q', rKey = 'r',
- sKey = 's', tKey = 't', uKey = 'u', vKey = 'v',
- wKey = 'w', xKey = 'x', yKey = 'y', zKey = 'z',
- quoteKey, backslashKey, backspaceKey, capslockKey,
- commaKey, delKey, upKey, downKey, leftKey, rightKey,
- endKey, equalsKey, escapeKey, f1Key, f2Key, f3Key, f4Key, f5Key,
- f6Key, f7Key, f8Key, f9Key, f10Key, f11Key, f12Key, backquoteKey,
- homeKey, insertKey, leftaltKey, leftctrlKey, leftbracketKey,
- leftguiKey, leftshiftKey, minusKey, numlockKey, pagedownKey,
- pageupKey, pauseKey, dotKey, rightaltKey, rightctrlKey, enterKey,
- rightguiKey, rightbracketKey, rightshiftKey, scrolllockKey,
- semicolonKey, slashKey, spaceKey, tabKey,
- leftmouseKey, middlemouseKey, rightmouseKey,
- fourthmouseKey, fifthmouseKey,
- unknownKey
- } KeyboardButton;
-
- ActionEvents stringToActionEvent(const char *action);
-
- KeyboardButton stringToKeyboardButton(const char *key);
-
-
- #ifdef _MSC_VER
- #define __attribute__(x)
- #endif
-
-
- #ifndef NULL
- #define NULL nullptr
- #endif
-
-
- #ifdef __APPLE__
- #include <OpenGL/gl.h>
- #else
- #ifdef _WIN32
- #include <windows.h>
- #endif
- #include <GL/gl.h>
- #include <GL/glext.h>
- #endif
-
-
- #if defined(HAVE_EXECINFO_H) && defined(HAVE_BACKTRACE) && defined(HAVE_BACKTRACE_SYMBOLS)
- #ifndef NDEBUG
- [[noreturn]] void assertImplementation(const char *exp, const char *file, int line);
- #define assert(x) (void)((x) || (assertImplementation(#x, __FILE__, __LINE__),0))
- #else
- #define assert(x)
- #endif
- #else
-
- #include <cassert>
- #endif
-
- #endif
|