summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSergeanur <s.anureev@yandex.ua>2021-07-08 02:37:14 +0200
committerSergeanur <s.anureev@yandex.ua>2021-07-08 02:37:14 +0200
commit72f67809059c732588ac29eedf8a10f9156b27b4 (patch)
treeb71ff78f38f6bbea9c032fdbd9e799616524b5a7 /src
parentfix macro redefinition warnings on win-glfw build (diff)
downloadre3-72f67809059c732588ac29eedf8a10f9156b27b4.tar
re3-72f67809059c732588ac29eedf8a10f9156b27b4.tar.gz
re3-72f67809059c732588ac29eedf8a10f9156b27b4.tar.bz2
re3-72f67809059c732588ac29eedf8a10f9156b27b4.tar.lz
re3-72f67809059c732588ac29eedf8a10f9156b27b4.tar.xz
re3-72f67809059c732588ac29eedf8a10f9156b27b4.tar.zst
re3-72f67809059c732588ac29eedf8a10f9156b27b4.zip
Diffstat (limited to '')
-rw-r--r--src/control/Script.cpp15
-rw-r--r--src/core/Frontend.cpp10
2 files changed, 6 insertions, 19 deletions
diff --git a/src/control/Script.cpp b/src/control/Script.cpp
index 1eee1c9e..76ab9471 100644
--- a/src/control/Script.cpp
+++ b/src/control/Script.cpp
@@ -2208,21 +2208,16 @@ void CRunningScript::Init()
int scriptToLoad = 0;
const char *scriptfile = "main.scm";
-#ifdef _WIN32
-extern "C" __declspec(dllimport) short __stdcall GetAsyncKeyState(int);
-#endif
-
int open_script()
{
- // glfwGetKey doesn't work because of CGame::Initialise is blocking
-#ifdef _WIN32
- if (GetAsyncKeyState('G') & 0x8000)
+ // glfwGetKey doesn't work because of CGame::Initialise is blocking
+ CPad::UpdatePads();
+ if (CPad::GetPad(0)->GetChar('G'))
scriptToLoad = 0;
- if (GetAsyncKeyState('R') & 0x8000)
+ if (CPad::GetPad(0)->GetChar('R'))
scriptToLoad = 1;
- if (GetAsyncKeyState('D') & 0x8000)
+ if (CPad::GetPad(0)->GetChar('D'))
scriptToLoad = 2;
-#endif
switch (scriptToLoad) {
case 0: scriptfile = "main.scm"; break;
case 1: scriptfile = "freeroam_miami.scm"; break;
diff --git a/src/core/Frontend.cpp b/src/core/Frontend.cpp
index 13db6b98..632a69ab 100644
--- a/src/core/Frontend.cpp
+++ b/src/core/Frontend.cpp
@@ -4558,19 +4558,11 @@ CMenuManager::ProcessUserInput(uint8 goDown, uint8 goUp, uint8 optionSelected, u
#ifdef USE_DEBUG_SCRIPT_LOADER
if (m_nCurrScreen == MENUPAGE_START_MENU || m_nCurrScreen == MENUPAGE_NEW_GAME || m_nCurrScreen == MENUPAGE_NEW_GAME_RELOAD) {
-#ifdef RW_GL3
- if (glfwGetKey(PSGLOBAL(window), GLFW_KEY_R) == GLFW_PRESS) {
+ if (CPad::GetPad(0)->GetChar('R')) {
scriptToLoad = 1;
DoSettingsBeforeStartingAGame();
return;
}
-#elif defined _WIN32
- if (GetAsyncKeyState('R') & 0x8000) {
- scriptToLoad = 1;
- DoSettingsBeforeStartingAGame();
- return;
- }
-#endif
}
#endif