diff options
author | eray orçunus <erayorcunus@gmail.com> | 2020-04-26 12:25:03 +0200 |
---|---|---|
committer | eray orçunus <erayorcunus@gmail.com> | 2020-04-26 12:29:50 +0200 |
commit | 6c1a1f7cd20a2674f33b5318e6e07a3a28d016f6 (patch) | |
tree | 7a01b47b48a106ca6ff9154cc5c14d3baf54c22f /src/skel/crossplatform.h | |
parent | update librw (diff) | |
download | re3-6c1a1f7cd20a2674f33b5318e6e07a3a28d016f6.tar re3-6c1a1f7cd20a2674f33b5318e6e07a3a28d016f6.tar.gz re3-6c1a1f7cd20a2674f33b5318e6e07a3a28d016f6.tar.bz2 re3-6c1a1f7cd20a2674f33b5318e6e07a3a28d016f6.tar.lz re3-6c1a1f7cd20a2674f33b5318e6e07a3a28d016f6.tar.xz re3-6c1a1f7cd20a2674f33b5318e6e07a3a28d016f6.tar.zst re3-6c1a1f7cd20a2674f33b5318e6e07a3a28d016f6.zip |
Diffstat (limited to '')
-rw-r--r-- | src/skel/crossplatform.h | 67 |
1 files changed, 58 insertions, 9 deletions
diff --git a/src/skel/crossplatform.h b/src/skel/crossplatform.h index 1b3ad7d6..342aab4e 100644 --- a/src/skel/crossplatform.h +++ b/src/skel/crossplatform.h @@ -1,5 +1,61 @@ #include <time.h> +// This is the common include for platform/renderer specific skeletons(glfw, win etc.) and cross platform things (like Windows directories wrapper, platform specific global arrays etc.) + +// This only has <windef.h> as Win header. +#ifdef _WIN32 +#include "win.h" +#endif + +#ifdef RW_GL3 +typedef struct +{ + GLFWwindow* window; + RwBool fullScreen; + RwV2d lastMousePos; + double mouseWheel; // glfw doesn't cache it + int8 joy1id; + int8 joy2id; +} +psGlobalType; + +#define PSGLOBAL(var) (((psGlobalType *)(RsGlobal.ps))->var) + +void CapturePad(RwInt32 padID); +void joysChangeCB(int jid, int event); +#endif + +enum eGameState +{ + GS_START_UP = 0, + GS_INIT_LOGO_MPEG, + GS_LOGO_MPEG, + GS_INIT_INTRO_MPEG, + GS_INTRO_MPEG, + GS_INIT_ONCE, + GS_INIT_FRONTEND, + GS_FRONTEND, + GS_INIT_PLAYING_GAME, + GS_PLAYING_GAME, +#ifndef MASTER + GS_ANIMVIEWER, +#endif +}; +extern RwUInt32 gGameState; + +RwBool IsForegroundApp(); +void InitialiseLanguage(); +RwBool _psSetVideoMode(RwInt32 subSystem, RwInt32 videoMode); + +RwChar** _psGetVideoModeList(); +RwInt32 _psGetNumVideModes(); + +void _psSelectScreenVM(RwInt32 videoMode); +void HandleExit(); +void _InputTranslateShiftKeyUpDown(RsKeyCodes* rs); + +// Mostly wrappers around Windows functions + #ifndef MAX_PATH #if !defined _WIN32 || defined __MINGW32__ #define MAX_PATH PATH_MAX @@ -8,8 +64,6 @@ #endif #endif -// Mostly wrappers around Windows functions - // TODO: Remove USEALTERNATIVEWINFUNCS and don't use it anywhere when re3 becomes fully cross-platform, this is for testing // Codes compatible with Windows and Linux #if defined USEALTERNATIVEWINFUNCS || !defined _WIN32 || defined __MINGW32__ @@ -27,18 +81,13 @@ struct SYSTEMTIME { uint16 wMilliseconds; }; +void GetLocalTime_CP(SYSTEMTIME* out); #define GetLocalTime GetLocalTime_CP -#else -#include <Windows.h> +#define OutputDebugString(s) re3_debug("[DBG-2]: " s "\n") #endif -void GetLocalTime_CP(SYSTEMTIME* out); - - // Only runs on GNU/POSIX/etc. #if !defined _WIN32 || defined __MINGW32__ -#define OutputDebugString(s) re3_debug("[DBG-2]: " s "\n") - #include <iostream> #include <dirent.h> #include <sys/types.h> |