diff options
author | Roman Masanin <36927roma@gmail.com> | 2020-09-28 02:40:58 +0200 |
---|---|---|
committer | Roman Masanin <36927roma@gmail.com> | 2020-09-28 02:40:58 +0200 |
commit | 1ea89f5aedbefccd21ad6a7be49afa898a2ab9c4 (patch) | |
tree | 093a94660e494cc1c83ac9d43fc1be520809926f /src/skel/glfw | |
parent | fix for frequency misscalculation (diff) | |
parent | Fixes: PS2/PS2-like menu, Hud, new sliding text found (diff) | |
download | re3-1ea89f5aedbefccd21ad6a7be49afa898a2ab9c4.tar re3-1ea89f5aedbefccd21ad6a7be49afa898a2ab9c4.tar.gz re3-1ea89f5aedbefccd21ad6a7be49afa898a2ab9c4.tar.bz2 re3-1ea89f5aedbefccd21ad6a7be49afa898a2ab9c4.tar.lz re3-1ea89f5aedbefccd21ad6a7be49afa898a2ab9c4.tar.xz re3-1ea89f5aedbefccd21ad6a7be49afa898a2ab9c4.tar.zst re3-1ea89f5aedbefccd21ad6a7be49afa898a2ab9c4.zip |
Diffstat (limited to 'src/skel/glfw')
-rw-r--r-- | src/skel/glfw/glfw.cpp | 117 |
1 files changed, 108 insertions, 9 deletions
diff --git a/src/skel/glfw/glfw.cpp b/src/skel/glfw/glfw.cpp index 920bb8a9..b9dbf5ac 100644 --- a/src/skel/glfw/glfw.cpp +++ b/src/skel/glfw/glfw.cpp @@ -1,5 +1,15 @@ #if defined RW_GL3 && !defined LIBRW_SDL2 +#ifdef _WIN32 +#include <windows.h> +#include <mmsystem.h> +#include <shellapi.h> +#include <windowsx.h> +#include <basetsd.h> +#include <regstr.h> +#include <shlobj.h> +#endif + #define WITHWINDOWS #include "common.h" @@ -812,12 +822,28 @@ void joysChangeCB(int jid, int event); bool IsThisJoystickBlacklisted(int i) { - const char *joyname = glfwGetJoystickName(i); + if (glfwJoystickIsGamepad(i)) + return false; + + const char* joyname = glfwGetJoystickName(i); // this is just a keyboard and mouse // Microsoft Microsoft® 2.4GHz Transceiver v8.0 Consumer Control // Microsoft Microsoft® 2.4GHz Transceiver v8.0 System Control - if(strstr(joyname, "2.4GHz Transceiver")) + if (strstr(joyname, "2.4GHz Transceiver")) + return true; + // COMPANY USB Device System Control + // COMPANY USB Device Consumer Control + if (strstr(joyname, "COMPANY USB")) + return true; + // i.e. Synaptics TM2438-005 + if (strstr(joyname, "Synaptics ")) + return true; + // i.e. ELAN Touchscreen + if (strstr(joyname, "ELAN ")) + return true; + // i.e. Primax Electronics, Ltd HP Wireless Keyboard Mouse Kit Consumer Control + if (strstr(joyname, "Keyboard")) return true; return false; @@ -1180,7 +1206,11 @@ void resizeCB(GLFWwindow* window, int width, int height) { * memory things don't work. */ /* redraw window */ - if (RwInitialised && (gGameState == GS_PLAYING_GAME || gGameState == GS_ANIMVIEWER)) + if (RwInitialised && (gGameState == GS_PLAYING_GAME +#ifndef MASTER + || gGameState == GS_ANIMVIEWER +#endif + )) { RsEventHandler((gGameState == GS_PLAYING_GAME ? rsIDLE : rsANIMVIEWER), (void*)TRUE); } @@ -1610,6 +1640,72 @@ main(int argc, char *argv[]) break; } + case GS_INIT_LOGO_MPEG: + { + //if (!startupDeactivate) + // PlayMovieInWindow(cmdShow, "movies\\Logo.mpg"); + gGameState = GS_LOGO_MPEG; + TRACE("gGameState = GS_LOGO_MPEG;"); + break; + } + + case GS_LOGO_MPEG: + { +// CPad::UpdatePads(); + +// if (startupDeactivate || ControlsManager.GetJoyButtonJustDown() != 0) + ++gGameState; +// else if (CPad::GetPad(0)->GetLeftMouseJustDown()) +// ++gGameState; +// else if (CPad::GetPad(0)->GetEnterJustDown()) +// ++gGameState; +// else if (CPad::GetPad(0)->GetCharJustDown(' ')) +// ++gGameState; +// else if (CPad::GetPad(0)->GetAltJustDown()) +// ++gGameState; +// else if (CPad::GetPad(0)->GetTabJustDown()) +// ++gGameState; + + break; + } + + case GS_INIT_INTRO_MPEG: + { +//#ifndef NO_MOVIES +// CloseClip(); +// CoUninitialize(); +//#endif +// +// if (CMenuManager::OS_Language == LANG_FRENCH || CMenuManager::OS_Language == LANG_GERMAN) +// PlayMovieInWindow(cmdShow, "movies\\GTAtitlesGER.mpg"); +// else +// PlayMovieInWindow(cmdShow, "movies\\GTAtitles.mpg"); + + gGameState = GS_INTRO_MPEG; + TRACE("gGameState = GS_INTRO_MPEG;"); + break; + } + + case GS_INTRO_MPEG: + { +// CPad::UpdatePads(); +// +// if (startupDeactivate || ControlsManager.GetJoyButtonJustDown() != 0) + ++gGameState; +// else if (CPad::GetPad(0)->GetLeftMouseJustDown()) +// ++gGameState; +// else if (CPad::GetPad(0)->GetEnterJustDown()) +// ++gGameState; +// else if (CPad::GetPad(0)->GetCharJustDown(' ')) +// ++gGameState; +// else if (CPad::GetPad(0)->GetAltJustDown()) +// ++gGameState; +// else if (CPad::GetPad(0)->GetTabJustDown()) +// ++gGameState; + + break; + } + case GS_INIT_ONCE: { //CoUninitialize(); @@ -1625,7 +1721,6 @@ main(int argc, char *argv[]) #else LoadingScreen(nil, nil, "loadsc0"); #endif - if ( !CGame::InitialiseOnceAfterRW() ) RsGlobal.quit = TRUE; @@ -1638,6 +1733,7 @@ main(int argc, char *argv[]) break; } +#ifndef PS2_MENU case GS_INIT_FRONTEND: { LoadingScreen(nil, nil, "loadsc0"); @@ -1658,7 +1754,6 @@ main(int argc, char *argv[]) break; } -#ifndef PS2_MENU case GS_FRONTEND: { if(!glfwGetWindowAttrib(PSGLOBAL(window), GLFW_ICONIFIED)) @@ -1818,8 +1913,10 @@ main(int argc, char *argv[]) { if ( gGameState == GS_PLAYING_GAME ) CGame::ShutDown(); +#ifndef MASTER else if ( gGameState == GS_ANIMVIEWER ) CAnimViewer::Shutdown(); +#endif CTimer::Stop(); @@ -1843,8 +1940,10 @@ main(int argc, char *argv[]) if ( gGameState == GS_PLAYING_GAME ) CGame::ShutDown(); +#ifndef MASTER else if ( gGameState == GS_ANIMVIEWER ) CAnimViewer::Shutdown(); +#endif DMAudio.Terminate(); @@ -1932,11 +2031,11 @@ void CapturePad(RwInt32 padID) // Gamepad axes are guaranteed to return 0.0f if that particular gamepad doesn't have that axis. if ( glfwPad != -1 ) { - leftStickPos.x = ControlsManager.m_NewState.isGamepad ? gamepadState.axes[0] : numAxes >= 0 ? axes[0] : 0.0f; - leftStickPos.y = ControlsManager.m_NewState.isGamepad ? gamepadState.axes[1] : numAxes >= 1 ? axes[1] : 0.0f; + leftStickPos.x = ControlsManager.m_NewState.isGamepad ? gamepadState.axes[0] : numAxes >= 1 ? axes[0] : 0.0f; + leftStickPos.y = ControlsManager.m_NewState.isGamepad ? gamepadState.axes[1] : numAxes >= 2 ? axes[1] : 0.0f; - rightStickPos.x = ControlsManager.m_NewState.isGamepad ? gamepadState.axes[2] : numAxes >= 2 ? axes[2] : 0.0f; - rightStickPos.y = ControlsManager.m_NewState.isGamepad ? gamepadState.axes[3] : numAxes >= 3 ? axes[3] : 0.0f; + rightStickPos.x = ControlsManager.m_NewState.isGamepad ? gamepadState.axes[2] : numAxes >= 3 ? axes[2] : 0.0f; + rightStickPos.y = ControlsManager.m_NewState.isGamepad ? gamepadState.axes[3] : numAxes >= 4 ? axes[3] : 0.0f; } { |