diff --git a/Core/Core.cpp b/Core/Core.cpp index 454694e676..36d108efc7 100644 --- a/Core/Core.cpp +++ b/Core/Core.cpp @@ -23,7 +23,6 @@ #include "base/NativeApp.h" #include "base/display.h" #include "base/timeutil.h" -#include "input/input_state.h" #include "thread/threadutil.h" #include "profiler/profiler.h" @@ -191,25 +190,25 @@ bool UpdateScreenScale(int width, int height) { return false; } -void UpdateRunLoop(InputState *input_state) { +void UpdateRunLoop() { if (windowHidden && g_Config.bPauseWhenMinimized) { sleep_ms(16); return; } - NativeUpdate(*input_state); + NativeUpdate(); if (GetUIState() != UISTATE_EXIT) { NativeRender(graphicsContext); } } -void Core_RunLoop(GraphicsContext *ctx, InputState *input_state) { +void Core_RunLoop(GraphicsContext *ctx) { graphicsContext = ctx; while ((GetUIState() != UISTATE_INGAME || !PSP_IsInited()) && GetUIState() != UISTATE_EXIT) { time_update(); #if defined(USING_WIN_UI) double startTime = time_now_d(); - UpdateRunLoop(input_state); + UpdateRunLoop(); // Simple throttling to not burn the GPU in the menu. time_update(); @@ -221,13 +220,13 @@ void Core_RunLoop(GraphicsContext *ctx, InputState *input_state) { ctx->SwapBuffers(); } #else - UpdateRunLoop(input_state); + UpdateRunLoop(); #endif } while (!coreState && GetUIState() == UISTATE_INGAME) { time_update(); - UpdateRunLoop(input_state); + UpdateRunLoop(); #if defined(USING_WIN_UI) if (!windowHidden && !Core_IsStepping()) { ctx->SwapBuffers(); @@ -268,7 +267,7 @@ static inline void CoreStateProcessed() { } // Some platforms, like Android, do not call this function but handle things on their own. -void Core_Run(GraphicsContext *ctx, InputState *input_state) +void Core_Run(GraphicsContext *ctx) { #if defined(_DEBUG) host->UpdateDisassembly(); @@ -283,7 +282,7 @@ reswitch: if (GetUIState() == UISTATE_EXIT) { return; } - Core_RunLoop(ctx, input_state); + Core_RunLoop(ctx); #if defined(USING_QT_UI) && !defined(MOBILE_DEVICE) return; #else @@ -295,7 +294,7 @@ reswitch: { case CORE_RUNNING: // enter a fast runloop - Core_RunLoop(ctx, input_state); + Core_RunLoop(ctx); break; // We should never get here on Android. diff --git a/Core/Core.h b/Core/Core.h index 889e05ccbe..98262f7beb 100644 --- a/Core/Core.h +++ b/Core/Core.h @@ -21,11 +21,10 @@ #include "Core/CoreParameter.h" class GraphicsContext; -struct InputState; // called from emu thread -void UpdateRunLoop(InputState *input_state); -void Core_Run(GraphicsContext *ctx, InputState *input_state); +void UpdateRunLoop(); +void Core_Run(GraphicsContext *ctx); void Core_Stop(); void Core_ErrorPause(); // For platforms that don't call Core_Run diff --git a/Core/Host.h b/Core/Host.h index 45c83c9c5c..0b9b78f92e 100644 --- a/Core/Host.h +++ b/Core/Host.h @@ -20,7 +20,6 @@ #include #include "Common/CommonTypes.h" -struct InputState; class GraphicsContext; // TODO: Whittle this down. Collecting a bunch of random stuff like this isn't good design :P @@ -41,7 +40,7 @@ public: virtual void UpdateSound() {} virtual void GoFullscreen(bool) {} virtual void ShutdownSound() = 0; - virtual void PollControllers(InputState &input_state) {} + virtual void PollControllers() {} virtual void ToggleDebugConsoleVisibility() {} //this is sent from EMU thread! Make sure that Host handles it properly! diff --git a/Qt/mainwindow.h b/Qt/mainwindow.h index 2a7245bce2..51ffceb0de 100644 --- a/Qt/mainwindow.h +++ b/Qt/mainwindow.h @@ -146,7 +146,6 @@ private: QString currentLanguage; CoreState nextState; - InputState input_state; GlobalUIState lastUIState; Debugger_Disasm *dialogDisasm; diff --git a/UI/ControlMappingScreen.cpp b/UI/ControlMappingScreen.cpp index bc3feb5753..f5688f14a2 100644 --- a/UI/ControlMappingScreen.cpp +++ b/UI/ControlMappingScreen.cpp @@ -41,7 +41,7 @@ class ControlMapper : public UI::LinearLayout { public: ControlMapper(ControlMappingScreen *ctrlScreen, int pspKey, std::string keyName, ScreenManager *scrm, UI::LinearLayoutParams *layoutParams = 0); - virtual void Update(const InputState &input); + void Update() override; int GetPspKey() const { return pspKey_; } private: void Refresh(); @@ -74,7 +74,7 @@ ControlMapper::ControlMapper(ControlMappingScreen *ctrlScreen, int pspKey, std:: Refresh(); } -void ControlMapper::Update(const InputState &input) { +void ControlMapper::Update() { if (refresh_) { refresh_ = false; Refresh(); @@ -371,7 +371,7 @@ public: curX_(0.0f), curY_(0.0f), maxCount_(500) {} void Draw(UIContext &dc) override; - void Update(const InputState &input_state) override; + void Update() override; void Axis(const AxisInput &input) override { // TODO: Check input.deviceId? if (input.axisId == xAxis_) { @@ -427,7 +427,7 @@ void JoystickHistoryView::Draw(UIContext &dc) { } } -void JoystickHistoryView::Update(const InputState &input_state) { +void JoystickHistoryView::Update() { locations_.push_back(Location(curX_, curY_)); if ((int)locations_.size() > maxCount_) { locations_.pop_front(); diff --git a/UI/DevScreens.cpp b/UI/DevScreens.cpp index c1ea62e1f5..b6e6a77e19 100644 --- a/UI/DevScreens.cpp +++ b/UI/DevScreens.cpp @@ -168,8 +168,8 @@ void LogScreen::UpdateLog() { toBottom_ = true; } -void LogScreen::update(InputState &input) { - UIDialogScreenWithBackground::update(input); +void LogScreen::update() { + UIDialogScreenWithBackground::update(); if (toBottom_) { toBottom_ = false; scroll_->ScrollToBottom(); diff --git a/UI/DevScreens.h b/UI/DevScreens.h index 682ae316b8..a79ef3135f 100644 --- a/UI/DevScreens.h +++ b/UI/DevScreens.h @@ -63,7 +63,7 @@ class LogScreen : public UIDialogScreenWithBackground { public: LogScreen() : toBottom_(false) {} void CreateViews() override; - void update(InputState &input) override; + void update() override; private: void UpdateLog(); diff --git a/UI/EmuScreen.cpp b/UI/EmuScreen.cpp index 1f0ea194cc..a6046f7a04 100644 --- a/UI/EmuScreen.cpp +++ b/UI/EmuScreen.cpp @@ -785,11 +785,11 @@ UI::EventReturn EmuScreen::OnDevTools(UI::EventParams ¶ms) { return UI::EVENT_DONE; } -void EmuScreen::update(InputState &input) { +void EmuScreen::update() { if (bootPending_) bootGame(gamePath_); - UIScreen::update(input); + UIScreen::update(); // Simply forcibly update to the current screen size every frame. Doesn't cost much. // If bounds is set to be smaller than the actual pixel resolution of the display, respect that. diff --git a/UI/EmuScreen.h b/UI/EmuScreen.h index 0d57297d48..6e10258572 100644 --- a/UI/EmuScreen.h +++ b/UI/EmuScreen.h @@ -35,7 +35,7 @@ public: EmuScreen(const std::string &filename); ~EmuScreen(); - void update(InputState &input) override; + void update() override; void render() override; void deviceLost() override; void deviceRestore() override; diff --git a/UI/GameScreen.cpp b/UI/GameScreen.cpp index 74d8d5fcbb..f1ce8a66be 100644 --- a/UI/GameScreen.cpp +++ b/UI/GameScreen.cpp @@ -188,8 +188,8 @@ UI::EventReturn GameScreen::OnDeleteConfig(UI::EventParams &e) return UI::EVENT_DONE; } -void GameScreen::update(InputState &input) { - UIScreen::update(input); +void GameScreen::update() { + UIScreen::update(); I18NCategory *ga = GetI18NCategory("Game"); diff --git a/UI/GameScreen.h b/UI/GameScreen.h index d0c3a3d2ac..2d70834d0d 100644 --- a/UI/GameScreen.h +++ b/UI/GameScreen.h @@ -33,7 +33,7 @@ public: GameScreen(const std::string &gamePath); ~GameScreen(); - virtual void update(InputState &input); + virtual void update(); virtual std::string tag() const { return "game"; } diff --git a/UI/GameSettingsScreen.cpp b/UI/GameSettingsScreen.cpp index 41a538ab25..42d542036f 100644 --- a/UI/GameSettingsScreen.cpp +++ b/UI/GameSettingsScreen.cpp @@ -953,8 +953,8 @@ UI::EventReturn GameSettingsScreen::OnDumpNextFrameToLog(UI::EventParams &e) { return UI::EVENT_DONE; } -void GameSettingsScreen::update(InputState &input) { - UIScreen::update(input); +void GameSettingsScreen::update() { + UIScreen::update(); g_Config.iForceMaxEmulatedFPS = cap60FPS_ ? 60 : 0; g_Config.iFpsLimit = (iAlternateSpeedPercent_ * 60) / 100; diff --git a/UI/GameSettingsScreen.h b/UI/GameSettingsScreen.h index f37e6284fe..6ed2a8542e 100644 --- a/UI/GameSettingsScreen.h +++ b/UI/GameSettingsScreen.h @@ -28,7 +28,7 @@ class GameSettingsScreen : public UIDialogScreenWithGameBackground { public: GameSettingsScreen(std::string gamePath, std::string gameID = "", bool editThenRestore = false); - virtual void update(InputState &input); + virtual void update(); virtual void onFinish(DialogResult result); UI::Event OnRecentChanged; diff --git a/UI/GamepadEmu.cpp b/UI/GamepadEmu.cpp index 8e6cbfe291..577185e26f 100644 --- a/UI/GamepadEmu.cpp +++ b/UI/GamepadEmu.cpp @@ -41,7 +41,7 @@ void GamepadView::Touch(const TouchInput &input) { secondsWithoutTouch_ = 0.0f; } -void GamepadView::Update(const InputState &input) { +void GamepadView::Update() { const float now = time_now(); float delta = now - lastFrameTime_; if (delta > 0) { diff --git a/UI/GamepadEmu.h b/UI/GamepadEmu.h index 377ca06433..00d28d9ab8 100644 --- a/UI/GamepadEmu.h +++ b/UI/GamepadEmu.h @@ -31,7 +31,7 @@ public: bool Key(const KeyInput &input) override { return false; } - void Update(const InputState &input) override; + void Update() override; protected: float GetButtonOpacity(); diff --git a/UI/InstallZipScreen.cpp b/UI/InstallZipScreen.cpp index 14a00827d3..353a71878f 100644 --- a/UI/InstallZipScreen.cpp +++ b/UI/InstallZipScreen.cpp @@ -76,7 +76,7 @@ UI::EventReturn InstallZipScreen::OnInstall(UI::EventParams ¶ms) { return UI::EVENT_DONE; } -void InstallZipScreen::update(InputState &input) { +void InstallZipScreen::update() { I18NCategory *iz = GetI18NCategory("InstallZip"); using namespace UI; @@ -95,5 +95,5 @@ void InstallZipScreen::update(InputState &input) { MainScreen::showHomebrewTab = true; } } - UIScreen::update(input); + UIScreen::update(); } diff --git a/UI/InstallZipScreen.h b/UI/InstallZipScreen.h index 41d55346a0..b84d91e21f 100644 --- a/UI/InstallZipScreen.h +++ b/UI/InstallZipScreen.h @@ -27,7 +27,7 @@ class InstallZipScreen : public UIDialogScreenWithBackground { public: InstallZipScreen(std::string zipPath) : installChoice_(0), doneView_(0), zipPath_(zipPath), installStarted_(false), deleteZipFile_(false) {} - virtual void update(InputState &input) override; + virtual void update() override; virtual bool key(const KeyInput &key) override; protected: diff --git a/UI/MainScreen.cpp b/UI/MainScreen.cpp index 12f0e117e1..61857c93fd 100644 --- a/UI/MainScreen.cpp +++ b/UI/MainScreen.cpp @@ -132,7 +132,7 @@ public: return Clickable::Key(key); } - void Update(const InputState &input_state) override { + void Update() override { // Hold button for 1.5 seconds to launch the game options if (holdEnabled_ && holdStart_ != 0.0 && holdStart_ < time_now_d() - 1.5) { TriggerOnHoldClick(); @@ -949,8 +949,8 @@ void MainScreen::sendMessage(const char *message, const char *value) { } } -void MainScreen::update(InputState &input) { - UIScreen::update(input); +void MainScreen::update() { + UIScreen::update(); UpdateUIState(UISTATE_MENU); bool vertical = UseVerticalLayout(); if (vertical != lastVertical_) { @@ -1239,9 +1239,9 @@ void UmdReplaceScreen::CreateViews() { root_->Add(rightColumn); } -void UmdReplaceScreen::update(InputState &input) { +void UmdReplaceScreen::update() { UpdateUIState(UISTATE_PAUSEMENU); - UIScreen::update(input); + UIScreen::update(); } UI::EventReturn UmdReplaceScreen::OnGameSelected(UI::EventParams &e) { diff --git a/UI/MainScreen.h b/UI/MainScreen.h index 94292f684d..b80bfae5e9 100644 --- a/UI/MainScreen.h +++ b/UI/MainScreen.h @@ -82,7 +82,7 @@ public: protected: void CreateViews() override; void DrawBackground(UIContext &dc) override; - void update(InputState &input) override; + void update() override; void sendMessage(const char *message, const char *value) override; void dialogFinished(const Screen *dialog, DialogResult result) override; @@ -129,7 +129,7 @@ public: protected: void CreateViews() override; - void update(InputState &input) override; + void update() override; //virtual void sendMessage(const char *message, const char *value); private: diff --git a/UI/MiscScreens.cpp b/UI/MiscScreens.cpp index ff2ae0b0fc..49e0e526fd 100644 --- a/UI/MiscScreens.cpp +++ b/UI/MiscScreens.cpp @@ -413,8 +413,8 @@ void LogoScreen::Next() { const float logoScreenSeconds = 2.5f; -void LogoScreen::update(InputState &input_state) { - UIScreen::update(input_state); +void LogoScreen::update() { + UIScreen::update(); frames_++; if (frames_ > 60 * logoScreenSeconds) { Next(); @@ -558,8 +558,8 @@ UI::EventReturn CreditsScreen::OnOK(UI::EventParams &e) { return UI::EVENT_DONE; } -void CreditsScreen::update(InputState &input_state) { - UIScreen::update(input_state); +void CreditsScreen::update() { + UIScreen::update(); UpdateUIState(UISTATE_MENU); frames_++; } diff --git a/UI/MiscScreens.h b/UI/MiscScreens.h index 5a8ea26515..f1508cdf0f 100644 --- a/UI/MiscScreens.h +++ b/UI/MiscScreens.h @@ -116,7 +116,7 @@ public: : frames_(0), switched_(false) {} bool key(const KeyInput &key) override; bool touch(const TouchInput &touch) override; - void update(InputState &input) override; + void update() override; void render() override; void sendMessage(const char *message, const char *value) override; void CreateViews() override {} @@ -130,7 +130,7 @@ private: class CreditsScreen : public UIDialogScreenWithBackground { public: CreditsScreen() : frames_(0) {} - void update(InputState &input) override; + void update() override; void render() override; void CreateViews() override; diff --git a/UI/NativeApp.cpp b/UI/NativeApp.cpp index 84ac0b1e92..03955a9197 100644 --- a/UI/NativeApp.cpp +++ b/UI/NativeApp.cpp @@ -864,7 +864,7 @@ void HandleGlobalMessage(const std::string &msg, const std::string &value) { } } -void NativeUpdate(InputState &input) { +void NativeUpdate() { PROFILE_END_FRAME(); { @@ -877,7 +877,7 @@ void NativeUpdate(InputState &input) { } g_DownloadManager.Update(); - screenManager->update(input); + screenManager->update(); } void NativeDeviceLost() { diff --git a/UI/PauseScreen.cpp b/UI/PauseScreen.cpp index 2a4c5e0493..e726863a76 100644 --- a/UI/PauseScreen.cpp +++ b/UI/PauseScreen.cpp @@ -264,9 +264,9 @@ UI::EventReturn SaveSlotView::OnScreenshotClick(UI::EventParams &e) { return UI::EVENT_DONE; } -void GamePauseScreen::update(InputState &input) { +void GamePauseScreen::update() { UpdateUIState(UISTATE_PAUSEMENU); - UIScreen::update(input); + UIScreen::update(); if (finishNextFrame_) { screenManager()->finishDialog(this, DR_CANCEL); diff --git a/UI/PauseScreen.h b/UI/PauseScreen.h index b30aecce65..817486c8ab 100644 --- a/UI/PauseScreen.h +++ b/UI/PauseScreen.h @@ -34,7 +34,7 @@ public: protected: virtual void CreateViews() override; - virtual void update(InputState &input) override; + virtual void update() override; virtual void sendMessage(const char *message, const char *value) override; void CallbackDeleteConfig(bool yes); diff --git a/UI/RemoteISOScreen.cpp b/UI/RemoteISOScreen.cpp index d591450335..e18d93a0d3 100644 --- a/UI/RemoteISOScreen.cpp +++ b/UI/RemoteISOScreen.cpp @@ -342,8 +342,8 @@ static bool LoadGameList(const std::string &host, int port, std::vectorAdd(rightColumnItems); } -void RemoteISOConnectScreen::update(InputState &input) { +void RemoteISOConnectScreen::update() { I18NCategory *sy = GetI18NCategory("System"); - UIScreenWithBackground::update(input); + UIScreenWithBackground::update(); ScanStatus s = GetStatus(); switch (s) { diff --git a/UI/RemoteISOScreen.h b/UI/RemoteISOScreen.h index 9ceb5c0877..75b34ff968 100644 --- a/UI/RemoteISOScreen.h +++ b/UI/RemoteISOScreen.h @@ -30,7 +30,7 @@ public: RemoteISOScreen(); protected: - void update(InputState &input) override; + void update() override; void CreateViews() override; UI::EventReturn HandleStartServer(UI::EventParams &e); @@ -57,7 +57,7 @@ public: ~RemoteISOConnectScreen() override; protected: - void update(InputState &input) override; + void update() override; void CreateViews() override; ScanStatus GetStatus(); @@ -93,4 +93,4 @@ protected: UI::EventReturn OnChangeRemoteISOSubdir(UI::EventParams &e); -}; \ No newline at end of file +}; diff --git a/UI/ReportScreen.cpp b/UI/ReportScreen.cpp index 6309a1d6ec..320c845d30 100644 --- a/UI/ReportScreen.cpp +++ b/UI/ReportScreen.cpp @@ -41,7 +41,7 @@ public: Event OnChoice; protected: - void Update(const InputState &input_state) override; + void Update() override; virtual void SetupChoices(); virtual int TotalChoices() { @@ -73,8 +73,8 @@ RatingChoice::RatingChoice(const char *captionKey, int *value, LayoutParams *lay SetupChoices(); } -void RatingChoice::Update(const InputState &input_state) { - LinearLayout::Update(input_state); +void RatingChoice::Update() { + LinearLayout::Update(); for (int i = 0; i < TotalChoices(); i++) { StickyChoice *chosen = GetChoice(i); @@ -160,7 +160,7 @@ ReportScreen::ReportScreen(const std::string &gamePath) ratingEnabled_ = enableReporting_; } -void ReportScreen::update(InputState &input) { +void ReportScreen::update() { if (screenshot_) { if (includeScreenshot_) { screenshot_->SetVisibility(V_VISIBLE); @@ -168,7 +168,7 @@ void ReportScreen::update(InputState &input) { screenshot_->SetVisibility(V_GONE); } } - UIScreenWithGameBackground::update(input); + UIScreenWithGameBackground::update(); } EventReturn ReportScreen::HandleChoice(EventParams &e) { @@ -332,7 +332,7 @@ void ReportFinishScreen::CreateViews() { rightColumn->Add(rightColumnItems); } -void ReportFinishScreen::update(InputState &input) { +void ReportFinishScreen::update() { I18NCategory *rp = GetI18NCategory("Reporting"); if (!setStatus_) { @@ -353,7 +353,7 @@ void ReportFinishScreen::update(InputState &input) { } } - UIScreenWithGameBackground::update(input); + UIScreenWithGameBackground::update(); } UI::EventReturn ReportFinishScreen::HandleViewFeedback(UI::EventParams &e) { diff --git a/UI/ReportScreen.h b/UI/ReportScreen.h index 0acfbb36ae..74d4aab703 100644 --- a/UI/ReportScreen.h +++ b/UI/ReportScreen.h @@ -28,7 +28,7 @@ public: ReportScreen(const std::string &gamePath); protected: - void update(InputState &input) override; + void update() override; void CreateViews() override; void UpdateSubmit(); @@ -56,7 +56,7 @@ public: ReportFinishScreen(const std::string &gamePath); protected: - void update(InputState &input) override; + void update() override; void CreateViews() override; UI::EventReturn HandleViewFeedback(UI::EventParams &e); diff --git a/UI/Store.cpp b/UI/Store.cpp index 7d2c76d4a2..3081e5ed1c 100644 --- a/UI/Store.cpp +++ b/UI/Store.cpp @@ -175,12 +175,12 @@ public: ProductItemView(const StoreEntry &entry, UI::LayoutParams *layoutParams = 0) : UI::Choice(entry.name, layoutParams), entry_(entry) {} - virtual void GetContentDimensions(const UIContext &dc, float &w, float &h) const { + void GetContentDimensions(const UIContext &dc, float &w, float &h) const override { w = 300; h = 164; } - virtual void Update(const InputState &input_state); - virtual void Draw(UIContext &dc); + void Update() override; + void Draw(UIContext &dc) override; StoreEntry GetEntry() const { return entry_; } @@ -193,8 +193,8 @@ void ProductItemView::Draw(UIContext &dc) { // dc.DrawText(entry_.name.c_str(), bounds_.centerX(), bounds_.centerY(), 0xFFFFFFFF, ALIGN_CENTER); } -void ProductItemView::Update(const InputState &input_state) { - View::Update(input_state); +void ProductItemView::Update() { + View::Update(); } // This is a "details" view of a game. Lets you install it. @@ -205,7 +205,7 @@ public: CreateViews(); } - virtual void Update(const InputState &input_state); + void Update() override; UI::Event OnClickLaunch; @@ -263,7 +263,7 @@ void ProductView::CreateViews() { Add(new TextView(temp)); } -void ProductView::Update(const InputState &input_state) { +void ProductView::Update() { if (wasInstalled_ != IsGameInstalled()) { CreateViews(); } @@ -272,7 +272,7 @@ void ProductView::Update(const InputState &input_state) { } if (cancelButton_ && g_GameManager.GetState() != GameManagerState::DOWNLOADING) cancelButton_->SetVisibility(UI::V_GONE); - View::Update(input_state); + View::Update(); } UI::EventReturn ProductView::OnInstall(UI::EventParams &e) { @@ -336,8 +336,8 @@ StoreScreen::~StoreScreen() { } // Handle async download tasks -void StoreScreen::update(InputState &input) { - UIDialogScreenWithBackground::update(input); +void StoreScreen::update() { + UIDialogScreenWithBackground::update(); g_DownloadManager.Update(); diff --git a/UI/Store.h b/UI/Store.h index 9e55531ba7..a7eae478b6 100644 --- a/UI/Store.h +++ b/UI/Store.h @@ -62,11 +62,11 @@ public: StoreScreen(); ~StoreScreen(); - virtual void update(InputState &input); - virtual std::string tag() const { return "store"; } + void update() override; + std::string tag() const override { return "store"; } protected: - virtual void CreateViews(); + void CreateViews() override; UI::EventReturn OnGameSelected(UI::EventParams &e); UI::EventReturn OnRetry(UI::EventParams &e); UI::EventReturn OnGameLaunch(UI::EventParams &e); diff --git a/UI/TiltAnalogSettingsScreen.cpp b/UI/TiltAnalogSettingsScreen.cpp index 52411f0df7..2e7d4add46 100644 --- a/UI/TiltAnalogSettingsScreen.cpp +++ b/UI/TiltAnalogSettingsScreen.cpp @@ -55,10 +55,6 @@ void TiltAnalogSettingsScreen::CreateViews() { settings->Add(new Choice(di->T("Back")))->OnClick.Handle(this, &UIScreen::OnBack); } -void TiltAnalogSettingsScreen::update(InputState &input) { - UIScreen::update(input); -} - bool TiltAnalogSettingsScreen::axis(const AxisInput &axis) { if (axis.deviceId == DEVICE_ID_ACCELEROMETER) { // Historically, we've had X and Y swapped, likely due to portrait vs landscape. diff --git a/UI/TiltAnalogSettingsScreen.h b/UI/TiltAnalogSettingsScreen.h index 0e9e39d981..172675c2c6 100644 --- a/UI/TiltAnalogSettingsScreen.h +++ b/UI/TiltAnalogSettingsScreen.h @@ -27,7 +27,6 @@ public: TiltAnalogSettingsScreen() : currentTiltX_(0), currentTiltY_(0) {} void CreateViews() override; - void update(InputState &input) override; bool axis(const AxisInput &axis) override; private: diff --git a/Windows/DinputDevice.cpp b/Windows/DinputDevice.cpp index d2923b20ff..8d0f2cd953 100644 --- a/Windows/DinputDevice.cpp +++ b/Windows/DinputDevice.cpp @@ -221,7 +221,7 @@ inline float LinearMaps(short val, short a0, short a1, short b0, short b1) { return b0 + (((val - a0) * (b1 - b0)) / (a1 - a0)); } -int DinputDevice::UpdateState(InputState &input_state) { +int DinputDevice::UpdateState() { if (!pJoystick) return -1; DIJOYSTATE2 js; @@ -234,7 +234,7 @@ int DinputDevice::UpdateState(InputState &input_state) { if(FAILED(pJoystick->GetDeviceState(sizeof(DIJOYSTATE2), &js))) return -1; - ApplyButtons(js, input_state); + ApplyButtons(js); if (analog) { AxisInput axis; @@ -308,7 +308,7 @@ int DinputDevice::UpdateState(InputState &input_state) { return -1; } -void DinputDevice::ApplyButtons(DIJOYSTATE2 &state, InputState &input_state) { +void DinputDevice::ApplyButtons(DIJOYSTATE2 &state) { BYTE *buttons = state.rgbButtons; u32 downMask = 0x80; diff --git a/Windows/DinputDevice.h b/Windows/DinputDevice.h index 98cb294725..5e94e424eb 100644 --- a/Windows/DinputDevice.h +++ b/Windows/DinputDevice.h @@ -32,11 +32,11 @@ public: //getDevices(), enumerates all devices if not done yet DinputDevice(int devnum); ~DinputDevice(); - virtual int UpdateState(InputState &input_state); + virtual int UpdateState(); virtual bool IsPad() { return true; } static size_t getNumPads(); private: - void ApplyButtons(DIJOYSTATE2 &state, InputState &input_state); + void ApplyButtons(DIJOYSTATE2 &state); //unfortunate and unclean way to keep only one DirectInput instance around static LPDIRECTINPUT8 getPDI(); //unfortunate and unclean way to keep track of the number of devices and the diff --git a/Windows/EmuThread.cpp b/Windows/EmuThread.cpp index 6280066bba..b57f7af6aa 100644 --- a/Windows/EmuThread.cpp +++ b/Windows/EmuThread.cpp @@ -32,8 +32,6 @@ static std::mutex emuThreadLock; static HANDLE emuThread; static volatile long emuThreadReady; -InputState input_state; - extern std::vector GetWideCmdLine(); enum EmuThreadStatus : long @@ -191,7 +189,7 @@ unsigned int WINAPI TheThread(void *) if (!Core_IsActive()) UpdateUIState(UISTATE_MENU); - Core_Run(graphicsContext, &input_state); + Core_Run(graphicsContext); } shutdown: diff --git a/Windows/InputDevice.cpp b/Windows/InputDevice.cpp index e334ddf992..c9eae63f54 100644 --- a/Windows/InputDevice.cpp +++ b/Windows/InputDevice.cpp @@ -37,14 +37,9 @@ static std::mutex inputMutex; static std::condition_variable inputEndCond; static bool focused = true; -extern InputState input_state; - inline static void ExecuteInputPoll() { - // Hm, we may hold the input_state lock for quite a while (time it takes to poll all devices)... - // If that becomes an issue, maybe should poll to a copy of inputstate and only hold the lock while - // copying that one to the real one? if (host && (focused || !g_Config.bGamepadOnlyFocused)) { - host->PollControllers(input_state); + host->PollControllers(); } } diff --git a/Windows/InputDevice.h b/Windows/InputDevice.h index fd48e3f2e5..7bd007d4b8 100644 --- a/Windows/InputDevice.h +++ b/Windows/InputDevice.h @@ -22,12 +22,10 @@ #include "Common/CommonTypes.h" -struct InputState; - class InputDevice { public: enum { UPDATESTATE_SKIP_PAD = 0x1234}; - virtual int UpdateState(InputState &input_state) = 0; + virtual int UpdateState() = 0; virtual bool IsPad() = 0; static void BeginPolling(); diff --git a/Windows/KeyboardDevice.cpp b/Windows/KeyboardDevice.cpp index de6a680582..af20067b54 100644 --- a/Windows/KeyboardDevice.cpp +++ b/Windows/KeyboardDevice.cpp @@ -117,7 +117,7 @@ std::map windowsTransTable = InitConstMap (VK_LBUTTON, NKCODE_EXT_MOUSEBUTTON_1) (VK_RBUTTON, NKCODE_EXT_MOUSEBUTTON_2); -int KeyboardDevice::UpdateState(InputState &input_state) { +int KeyboardDevice::UpdateState() { // Nothing to do, all done in WM_INPUT return 0; } diff --git a/Windows/KeyboardDevice.h b/Windows/KeyboardDevice.h index ff63395335..0b8fcca808 100644 --- a/Windows/KeyboardDevice.h +++ b/Windows/KeyboardDevice.h @@ -7,7 +7,7 @@ extern std::map windowsTransTable; class KeyboardDevice : public InputDevice { public: - virtual int UpdateState(InputState &input_state); + virtual int UpdateState(); virtual bool IsPad() { return false; } private: diff --git a/Windows/WindowsHost.cpp b/Windows/WindowsHost.cpp index 7494e74836..93339462c5 100644 --- a/Windows/WindowsHost.cpp +++ b/Windows/WindowsHost.cpp @@ -196,14 +196,14 @@ void WindowsHost::SetDebugMode(bool mode) { PostDialogMessage(disasmWindow[i], WM_DEB_SETDEBUGLPARAM, 0, (LPARAM)mode); } -void WindowsHost::PollControllers(InputState &input_state) { +void WindowsHost::PollControllers() { bool doPad = true; for (auto iter = this->input.begin(); iter != this->input.end(); iter++) { auto device = *iter; if (!doPad && device->IsPad()) continue; - if (device->UpdateState(input_state) == InputDevice::UPDATESTATE_SKIP_PAD) + if (device->UpdateState() == InputDevice::UPDATESTATE_SKIP_PAD) doPad = false; } diff --git a/Windows/WindowsHost.h b/Windows/WindowsHost.h index 775af65a48..ae53d893f0 100644 --- a/Windows/WindowsHost.h +++ b/Windows/WindowsHost.h @@ -41,7 +41,7 @@ public: // If returns false, will return a null context bool InitGraphics(std::string *error_message, GraphicsContext **ctx) override; - void PollControllers(InputState &input_state) override; + void PollControllers() override; void ShutdownGraphics() override; void InitSound() override; diff --git a/Windows/XinputDevice.cpp b/Windows/XinputDevice.cpp index faa125539e..2dda4f159d 100644 --- a/Windows/XinputDevice.cpp +++ b/Windows/XinputDevice.cpp @@ -200,7 +200,7 @@ bool NormalizedDeadzoneDiffers(u8 x1, u8 x2, const u8 thresh) { return false; } -int XinputDevice::UpdateState(InputState &input_state) { +int XinputDevice::UpdateState() { if (!s_pXInputDLL) return 0; @@ -212,7 +212,7 @@ int XinputDevice::UpdateState(InputState &input_state) { continue; DWORD dwResult = PPSSPP_XInputGetState(i, &state); if (dwResult == ERROR_SUCCESS) { - UpdatePad(i, state, input_state); + UpdatePad(i, state); anySuccess = true; } } @@ -221,13 +221,13 @@ int XinputDevice::UpdateState(InputState &input_state) { return anySuccess ? UPDATESTATE_SKIP_PAD : 0; } -void XinputDevice::UpdatePad(int pad, const XINPUT_STATE &state, InputState &input_state) { +void XinputDevice::UpdatePad(int pad, const XINPUT_STATE &state) { static bool notified = false; if (!notified) { notified = true; KeyMap::NotifyPadConnected("Xbox 360 Pad"); } - ApplyButtons(pad, state, input_state); + ApplyButtons(pad, state); const float STICK_DEADZONE = g_Config.fXInputAnalogDeadzone; const int STICK_INV_MODE = g_Config.iXInputAnalogInverseMode; @@ -288,7 +288,7 @@ void XinputDevice::UpdatePad(int pad, const XINPUT_STATE &state, InputState &inp this->check_delay[pad] = 0; } -void XinputDevice::ApplyButtons(int pad, const XINPUT_STATE &state, InputState &input_state) { +void XinputDevice::ApplyButtons(int pad, const XINPUT_STATE &state) { u32 buttons = state.Gamepad.wButtons; u32 downMask = buttons & (~prevButtons[pad]); diff --git a/Windows/XinputDevice.h b/Windows/XinputDevice.h index 037c2ded30..2fb48ed582 100644 --- a/Windows/XinputDevice.h +++ b/Windows/XinputDevice.h @@ -8,13 +8,13 @@ class XinputDevice : public InputDevice { public: XinputDevice(); ~XinputDevice(); - virtual int UpdateState(InputState &input_state); + virtual int UpdateState(); virtual bool IsPad() { return true; } private: - void UpdatePad(int pad, const XINPUT_STATE &state, InputState &input_state); - void ApplyButtons(int pad, const XINPUT_STATE &state, InputState &input_state); + void UpdatePad(int pad, const XINPUT_STATE &state); + void ApplyButtons(int pad, const XINPUT_STATE &state); int check_delay[4]{}; XINPUT_STATE prevState[4]{}; u32 prevButtons[4]{}; -}; \ No newline at end of file +}; diff --git a/android/jni/app-android.cpp b/android/jni/app-android.cpp index e2b3ad27da..f711d61d7f 100644 --- a/android/jni/app-android.cpp +++ b/android/jni/app-android.cpp @@ -360,8 +360,6 @@ static bool renderLoopRunning; static float dp_xscale = 1.0f; static float dp_yscale = 1.0f; -InputState input_state; - static bool renderer_inited = false; static bool renderer_ever_inited = false; // See NativeQueryConfig("androidJavaGL") to change this value. @@ -506,7 +504,6 @@ extern "C" void Java_org_ppsspp_ppsspp_NativeApp_init ILOG("NativeApp.init() -- begin"); PROFILE_INIT(); - memset(&input_state, 0, sizeof(input_state)); renderer_inited = false; renderer_ever_inited = false; androidVersion = jAndroidVersion; @@ -672,7 +669,7 @@ extern "C" void Java_org_ppsspp_ppsspp_NativeRenderer_displayRender(JNIEnv *env, } if (renderer_inited) { - NativeUpdate(input_state); + NativeUpdate(); NativeRender(graphicsContext); time_update(); @@ -1018,7 +1015,7 @@ extern "C" bool JNICALL Java_org_ppsspp_ppsspp_NativeActivity_runEGLRenderLoop(J setCurrentThreadName("AndroidRender"); } - NativeUpdate(input_state); + NativeUpdate(); NativeRender(graphicsContext); time_update(); diff --git a/ext/native/base/NativeApp.h b/ext/native/base/NativeApp.h index 37fbff1c58..722f687421 100644 --- a/ext/native/base/NativeApp.h +++ b/ext/native/base/NativeApp.h @@ -8,8 +8,7 @@ // from the framework, which exposes the native JNI api which is a bit // more complicated. -// This is defined in input/input_state.h. -struct InputState; +// These are defined in input/input_state.h. struct TouchInput; struct KeyInput; struct AxisInput; @@ -66,7 +65,7 @@ void NativeResized(); // Called ~sixty times a second, delivers the current input state. // Main thread. -void NativeUpdate(InputState &input); +void NativeUpdate(); // Delivers touch events "instantly", without waiting for the next frame so that NativeUpdate can deliver. // Useful for triggering audio events, saving a few ms. diff --git a/ext/native/base/PCMain.cpp b/ext/native/base/PCMain.cpp index d14b9185c0..2ef685c395 100644 --- a/ext/native/base/PCMain.cpp +++ b/ext/native/base/PCMain.cpp @@ -344,8 +344,6 @@ int System_GetPropertyInt(SystemProperty prop) { } } -InputState input_state; - extern void mixaudio(void *userdata, Uint8 *stream, int len) { NativeMix((short *)stream, len / 4); } @@ -824,7 +822,7 @@ int main(int argc, char *argv[]) { if (g_QuitRequested) break; const uint8_t *keys = SDL_GetKeyboardState(NULL); - UpdateRunLoop(&input_state); + UpdateRunLoop(); if (g_QuitRequested) break; #if defined(PPSSPP) && !defined(MOBILE_DEVICE) diff --git a/ext/native/base/QtMain.cpp b/ext/native/base/QtMain.cpp index b5d89ebadb..54a9f23c7b 100644 --- a/ext/native/base/QtMain.cpp +++ b/ext/native/base/QtMain.cpp @@ -30,7 +30,6 @@ #include -InputState input_state; MainUI *emugl = NULL; #ifdef SDL @@ -325,7 +324,7 @@ void MainUI::paintGL() #endif updateAccelerometer(); time_update(); - UpdateRunLoop(&input_state); + UpdateRunLoop(); } void MainUI::updateAccelerometer() diff --git a/ext/native/base/QtMain.h b/ext/native/base/QtMain.h index e214744819..0fda2cde4a 100644 --- a/ext/native/base/QtMain.h +++ b/ext/native/base/QtMain.h @@ -36,7 +36,7 @@ QTM_USE_NAMESPACE #include "Core/Config.h" // Input -void SimulateGamepad(InputState *input); +void SimulateGamepad(); class QtDummyGraphicsContext : public DummyGraphicsContext { public: @@ -81,7 +81,6 @@ protected: void updateAccelerometer(); private: - InputState input_state; QtDummyGraphicsContext *graphicsContext; float xscale, yscale; diff --git a/ext/native/input/input_state.h b/ext/native/input/input_state.h index bbb7732f98..38738dbff0 100644 --- a/ext/native/input/input_state.h +++ b/ext/native/input/input_state.h @@ -1,10 +1,5 @@ #pragma once -// InputState is the simple way of getting input. All the input we have is collected -// to a canonical Xbox360-style pad fully automatically. -// -// Recommended for use in game UIs and games that don't have advanced needs. -// // For more detailed and configurable input, implement NativeTouch, NativeKey and NativeAxis and do your // own mapping. Might later move the mapping system from PPSSPP to native. @@ -77,8 +72,6 @@ enum { PAD_BUTTON_UNTHROTTLE = 1 << 20, // Click Tab to unthrottle }; -#define MAX_POINTERS 10 - #ifndef MAX_KEYQUEUESIZE #define MAX_KEYQUEUESIZE 20 #endif @@ -105,23 +98,6 @@ public: } }; -// Collection of all possible inputs, and automatically computed -// deltas where applicable. -struct InputState { - // Lock this whenever you access the data in this struct. - mutable std::mutex lock; - InputState() { - memset(pointer_down, 0, sizeof(pointer_down)); - } - - int pointer_x[MAX_POINTERS]; - int pointer_y[MAX_POINTERS]; - bool pointer_down[MAX_POINTERS]; - -private: - DISALLOW_COPY_AND_ASSIGN(InputState); -}; - enum { TOUCH_MOVE = 1 << 0, TOUCH_DOWN = 1 << 1, @@ -146,7 +122,7 @@ enum { struct TouchInput { float x; float y; - int id; // can be relied upon to be 0...MAX_POINTERS + int id; int flags; double timestamp; }; diff --git a/ext/native/ui/screen.cpp b/ext/native/ui/screen.cpp index e12da51c97..e39e0214cb 100644 --- a/ext/native/ui/screen.cpp +++ b/ext/native/ui/screen.cpp @@ -38,13 +38,13 @@ void ScreenManager::switchScreen(Screen *screen) { } } -void ScreenManager::update(InputState &input) { +void ScreenManager::update() { if (nextScreen_) { switchToNext(); } if (stack_.size()) { - stack_.back().screen->update(input); + stack_.back().screen->update(); } } diff --git a/ext/native/ui/screen.h b/ext/native/ui/screen.h index 5f71662def..2ade58e17f 100644 --- a/ext/native/ui/screen.h +++ b/ext/native/ui/screen.h @@ -24,8 +24,6 @@ namespace UI { class View; } -struct InputState; - enum DialogResult { DR_OK, DR_CANCEL, @@ -49,7 +47,7 @@ public: } virtual void onFinish(DialogResult reason) {} - virtual void update(InputState &input) {} + virtual void update() {} virtual void preRender() {} virtual void render() {} virtual void postRender() {} @@ -97,7 +95,7 @@ public: virtual ~ScreenManager(); void switchScreen(Screen *screen); - void update(InputState &input); + void update(); void setUIContext(UIContext *context) { uiContext_ = context; } UIContext *getUIContext() { return uiContext_; } diff --git a/ext/native/ui/ui_screen.cpp b/ext/native/ui/ui_screen.cpp index ee47c79b60..3cc903a964 100644 --- a/ext/native/ui/ui_screen.cpp +++ b/ext/native/ui/ui_screen.cpp @@ -50,11 +50,11 @@ void UIScreen::DoRecreateViews() { } } -void UIScreen::update(InputState &input) { +void UIScreen::update() { DoRecreateViews(); if (root_) { - UpdateViewHierarchy(input, root_); + UpdateViewHierarchy(root_); } } @@ -340,7 +340,7 @@ UI::EventReturn PopupMultiChoice::HandleClick(UI::EventParams &e) { return UI::EVENT_DONE; } -void PopupMultiChoice::Update(const InputState &input_state) { +void PopupMultiChoice::Update() { UpdateText(); } diff --git a/ext/native/ui/ui_screen.h b/ext/native/ui/ui_screen.h index 4e4acc41bc..f6ca4f2104 100644 --- a/ext/native/ui/ui_screen.h +++ b/ext/native/ui/ui_screen.h @@ -15,7 +15,7 @@ public: UIScreen(); ~UIScreen(); - virtual void update(InputState &input) override; + virtual void update() override; virtual void preRender() override; virtual void render() override; virtual void postRender() override; @@ -222,7 +222,7 @@ public: } virtual void Draw(UIContext &dc) override; - virtual void Update(const InputState &input_state) override; + virtual void Update() override; void HideChoice(int c) { hidden_.insert(c); diff --git a/ext/native/ui/view.cpp b/ext/native/ui/view.cpp index b91fef0d08..e7794bd6d7 100644 --- a/ext/native/ui/view.cpp +++ b/ext/native/ui/view.cpp @@ -1107,7 +1107,7 @@ void Slider::Draw(UIContext &dc) { dc.DrawText(temp, bounds_.x2() - 22, bounds_.centerY(), 0xFFFFFFFF, ALIGN_CENTER); } -void Slider::Update(const InputState &input_state) { +void Slider::Update() { if (repeat_ >= 0) { repeat_++; } @@ -1216,7 +1216,7 @@ void SliderFloat::Draw(UIContext &dc) { dc.DrawText(temp, bounds_.x2() - 22, bounds_.centerY(), 0xFFFFFFFF, ALIGN_CENTER); } -void SliderFloat::Update(const InputState &input_state) { +void SliderFloat::Update() { if (repeat_ >= 0) { repeat_++; } diff --git a/ext/native/ui/view.h b/ext/native/ui/view.h index 10eaa9f3fd..ce924bd3df 100644 --- a/ext/native/ui/view.h +++ b/ext/native/ui/view.h @@ -27,7 +27,6 @@ struct KeyInput; struct TouchInput; struct AxisInput; -struct InputState; class DrawBuffer; class Texture; @@ -362,7 +361,7 @@ public: virtual bool Key(const KeyInput &input) { return false; } virtual void Touch(const TouchInput &input) {} virtual void Axis(const AxisInput &input) {} - virtual void Update(const InputState &input_state) {} + virtual void Update() {} // If this view covers these coordinates, it should add itself and its children to the list. virtual void Query(float x, float y, std::vector &list); @@ -456,7 +455,7 @@ public: bool Key(const KeyInput &input) override { return false; } void Touch(const TouchInput &input) override {} bool CanBeFocused() const override { return false; } - void Update(const InputState &input_state) override {} + void Update() override {} }; @@ -515,7 +514,7 @@ public: void Draw(UIContext &dc) override; bool Key(const KeyInput &input) override; void Touch(const TouchInput &input) override; - void Update(const InputState &input_state) override; + void Update() override; void GetContentDimensions(const UIContext &dc, float &w, float &h) const override; void SetShowPercent(bool s) { showPercent_ = s; } @@ -545,7 +544,7 @@ public: void Draw(UIContext &dc) override; bool Key(const KeyInput &input) override; void Touch(const TouchInput &input) override; - void Update(const InputState &input_state) override; + void Update() override; void GetContentDimensions(const UIContext &dc, float &w, float &h) const override; // OK to call this from the outside after having modified *value_ diff --git a/ext/native/ui/viewgroup.cpp b/ext/native/ui/viewgroup.cpp index e6da68390d..3b7f2a61db 100644 --- a/ext/native/ui/viewgroup.cpp +++ b/ext/native/ui/viewgroup.cpp @@ -20,6 +20,9 @@ const float ITEM_HEIGHT = 64.f; static std::mutex focusLock; static std::vector focusMoves; extern bool focusForced; + +// TODO: Seems like this drag stuff is no longer used. +#define MAX_POINTERS 10 bool dragCaptured[MAX_POINTERS]; void CaptureDrag(int id) { @@ -156,11 +159,11 @@ void ViewGroup::Draw(UIContext &dc) { } } -void ViewGroup::Update(const InputState &input_state) { +void ViewGroup::Update() { for (auto iter = views_.begin(); iter != views_.end(); ++iter) { // TODO: If there is a transformation active, transform input coordinates accordingly. if ((*iter)->GetVisibility() != V_GONE) - (*iter)->Update(input_state); + (*iter)->Update(); } } @@ -938,11 +941,11 @@ bool ScrollView::CanScroll() const { } } -void ScrollView::Update(const InputState &input_state) { +void ScrollView::Update() { if (visibility_ != V_VISIBLE) { inertia_ = 0.0f; } - ViewGroup::Update(input_state); + ViewGroup::Update(); Gesture gesture = orientation_ == ORIENT_VERTICAL ? GESTURE_DRAG_VERTICAL : GESTURE_DRAG_HORIZONTAL; gesture_.UpdateFrame(); @@ -1467,7 +1470,7 @@ bool AxisEvent(const AxisInput &axis, ViewGroup *root) { return true; } -void UpdateViewHierarchy(const InputState &input_state, ViewGroup *root) { +void UpdateViewHierarchy(ViewGroup *root) { ProcessHeldKeys(root); frameCount++; @@ -1499,7 +1502,7 @@ void UpdateViewHierarchy(const InputState &input_state, ViewGroup *root) { focusMoves.clear(); } - root->Update(input_state); + root->Update(); DispatchEvents(); } diff --git a/ext/native/ui/viewgroup.h b/ext/native/ui/viewgroup.h index 62c7c6511b..386400a99e 100644 --- a/ext/native/ui/viewgroup.h +++ b/ext/native/ui/viewgroup.h @@ -32,7 +32,7 @@ public: // By default, a container will layout to its own bounds. virtual void Measure(const UIContext &dc, MeasureSpec horiz, MeasureSpec vert) override = 0; virtual void Layout() override = 0; - virtual void Update(const InputState &input_state) override; + virtual void Update() override; virtual void Query(float x, float y, std::vector &list) override; virtual void Draw(UIContext &dc) override; @@ -244,7 +244,7 @@ public: void ScrollToBottom(); void ScrollRelative(float distance); bool CanScroll() const; - void Update(const InputState &input_state) override; + void Update() override; // Override so that we can scroll to the active one after moving the focus. bool SubviewFocused(View *view) override; @@ -408,7 +408,7 @@ private: }; void LayoutViewHierarchy(const UIContext &dc, ViewGroup *root); -void UpdateViewHierarchy(const InputState &input_state, ViewGroup *root); +void UpdateViewHierarchy(ViewGroup *root); // Hooks arrow keys for navigation bool KeyEvent(const KeyInput &key, ViewGroup *root); bool TouchEvent(const TouchInput &touch, ViewGroup *root); diff --git a/headless/Headless.cpp b/headless/Headless.cpp index 018aa738fb..098cc99884 100644 --- a/headless/Headless.cpp +++ b/headless/Headless.cpp @@ -19,7 +19,6 @@ #include "Log.h" #include "LogManager.h" #include "base/NativeApp.h" -#include "input/input_state.h" #include "base/timeutil.h" #include "Compare.h" @@ -64,9 +63,8 @@ public: } }; -struct InputState; // Temporary hacks around annoying linking errors. -void NativeUpdate(InputState &input_state) { } +void NativeUpdate() { } void NativeRender(GraphicsContext *graphicsContext) { } void NativeResized() { } diff --git a/ios/ViewController.mm b/ios/ViewController.mm index 918a678f91..3174d35738 100644 --- a/ios/ViewController.mm +++ b/ios/ViewController.mm @@ -57,7 +57,6 @@ double lastStartPress = 0.0f; bool simulateAnalog = false; extern ScreenManager *screenManager; -InputState input_state; extern bool iosCanUseJit; extern bool targetIsJailbroken; @@ -253,7 +252,7 @@ static GraphicsContext *graphicsContext; - (void)glkView:(GLKView *)view drawInRect:(CGRect)rect { - NativeUpdate(input_state); + NativeUpdate(); NativeRender(graphicsContext); time_update(); } diff --git a/unittest/JitHarness.cpp b/unittest/JitHarness.cpp index cb5edfa0dd..3f0c2493db 100644 --- a/unittest/JitHarness.cpp +++ b/unittest/JitHarness.cpp @@ -19,7 +19,6 @@ #include "base/timeutil.h" #include "base/NativeApp.h" -#include "input/input_state.h" #include "Core/MIPS/JitCommon/JitCommon.h" #include "Core/MIPS/JitCommon/JitBlockCache.h" #include "Core/MIPS/MIPSCodeUtils.h" @@ -31,9 +30,8 @@ #include "Core/CoreTiming.h" #include "Core/HLE/HLE.h" -struct InputState; // Temporary hacks around annoying linking errors. Copied from Headless. -void NativeUpdate(InputState &input_state) { } +void NativeUpdate() { } void NativeRender(GraphicsContext *graphicsContext) { } void NativeResized() { }