From 02385dde14db5666941832b76ea75aa258fbef44 Mon Sep 17 00:00:00 2001 From: DirtBagXon Date: Wed, 11 Sep 2024 00:03:01 +0100 Subject: [PATCH] 0.3a-3d64a8d --- Config/Supermodel.ini | 2 +- Src/Graphics/New3D/R3DFrameBuffers.cpp | 2 +- Src/Inputs/Input.cpp | 7 +++++-- Src/Inputs/Input.h | 3 ++- Src/Inputs/Inputs.cpp | 6 ++++++ Src/Version.h | 2 +- 6 files changed, 16 insertions(+), 6 deletions(-) diff --git a/Config/Supermodel.ini b/Config/Supermodel.ini index 9a566ea..e06741e 100644 --- a/Config/Supermodel.ini +++ b/Config/Supermodel.ini @@ -54,7 +54,7 @@ PortOut = 1971 AddressOut = "127.0.0.1" ; Common -InputUIExit = "KEY_ESCAPE,JOY1_BUTTON10+JOY1_BUTTON9" +InputUIExit = "JOY1_BUTTON10+JOY1_BUTTON9" InputStart1 = "KEY_1,JOY1_BUTTON9" InputStart2 = "KEY_2,JOY2_BUTTON9" InputCoin1 = "KEY_3,JOY1_BUTTON10" diff --git a/Src/Graphics/New3D/R3DFrameBuffers.cpp b/Src/Graphics/New3D/R3DFrameBuffers.cpp index 09ed950..0cadb3e 100644 --- a/Src/Graphics/New3D/R3DFrameBuffers.cpp +++ b/Src/Graphics/New3D/R3DFrameBuffers.cpp @@ -229,7 +229,7 @@ void R3DFrameBuffers::AllocShaderBase() )glsl"; m_shaderBase.LoadShaders(vertexShader, fragmentShader); - m_shaderBase.uniformLoc[0] = m_shaderTrans.GetUniformLocation("tex1"); + m_shaderBase.uniformLoc[0] = m_shaderBase.GetUniformLocation("tex1"); } void R3DFrameBuffers::AllocShaderTrans() diff --git a/Src/Inputs/Input.cpp b/Src/Inputs/Input.cpp index 2b44556..192ea01 100644 --- a/Src/Inputs/Input.cpp +++ b/Src/Inputs/Input.cpp @@ -164,7 +164,10 @@ void CInput::LoadFromConfig(const Util::Config::Node &config) { // If found, then set mapping string mapping = node->ValueAs(); - SetMapping(mapping.c_str()); + if (strcmp(id, "UIExit") == 0) + AppendMapping(mapping.c_str()); + else + SetMapping(mapping.c_str()); return; } } @@ -210,4 +213,4 @@ bool CInput::SendForceFeedbackCmd(ForceFeedbackCmd ffCmd) if (m_source == NULL) return false; return m_source->SendForceFeedbackCmd(ffCmd); -} \ No newline at end of file +} diff --git a/Src/Inputs/Input.h b/Src/Inputs/Input.h index 4f0b7af..1c58b71 100644 --- a/Src/Inputs/Input.h +++ b/Src/Inputs/Input.h @@ -29,6 +29,7 @@ #ifndef INCLUDED_INPUT_H #define INCLUDED_INPUT_H +#include #include "InputSource.h" #include "Types.h" #include "Game.h" @@ -211,7 +212,7 @@ inline bool CInput::IsUIInput() inline bool CInput::IsConfigurable() { // All inputs except UI and virtual ones can be configured by the user - return (gameFlags != Game::INPUT_UI) && !(flags & INPUT_FLAGS_VIRTUAL); + return ((strcmp(id, "UIExit") == 0) || ((gameFlags != Game::INPUT_UI) && !(flags & INPUT_FLAGS_VIRTUAL))); } inline bool CInput::IsVirtual() diff --git a/Src/Inputs/Inputs.cpp b/Src/Inputs/Inputs.cpp index d3235bc..4100fef 100644 --- a/Src/Inputs/Inputs.cpp +++ b/Src/Inputs/Inputs.cpp @@ -722,6 +722,12 @@ void CInputs::PrintInputs(const Game *game) const char *groupLabel = NULL; for (vector::iterator it = m_inputs.begin(); it != m_inputs.end(); ++it) { + if (strcmp((*it)->id, "UIExit") == 0) + { + printf("Exit Assignment:\n"); + printf(" %s = %s\n", (*it)->label, (*it)->GetMapping()); + } + if (!(*it)->IsConfigurable() || !((*it)->gameFlags & gameFlags)) continue; diff --git a/Src/Version.h b/Src/Version.h index 80ee26e..122f9a2 100644 --- a/Src/Version.h +++ b/Src/Version.h @@ -29,7 +29,7 @@ #define INCLUDED_VERSION_H #ifndef SUPERMODEL_VERSION -#define SUPERMODEL_VERSION "0.3a-706969a-mm DirtBagXon (Sinden)" +#define SUPERMODEL_VERSION "0.3a-3d64a8d-mm DirtBagXon (Sinden)" #endif #endif // INCLUDED_VERSION_H