input_common/tas: new update method

This commit is contained in:
german77 2021-07-09 23:30:58 -05:00 committed by MonsterDruide1
parent 33a1d790e8
commit 5401cf6eb5
5 changed files with 4 additions and 17 deletions

View File

@ -36,6 +36,7 @@
#include "input_common/keyboard.h" #include "input_common/keyboard.h"
#include "input_common/main.h" #include "input_common/main.h"
#include "input_common/mouse/mouse_input.h" #include "input_common/mouse/mouse_input.h"
#include "input_common/tas/tas_input.h"
#include "video_core/renderer_base.h" #include "video_core/renderer_base.h"
#include "video_core/video_core.h" #include "video_core/video_core.h"
#include "yuzu/bootmanager.h" #include "yuzu/bootmanager.h"
@ -312,6 +313,7 @@ GRenderWindow::~GRenderWindow() {
} }
void GRenderWindow::OnFrameDisplayed() { void GRenderWindow::OnFrameDisplayed() {
input_subsystem->GetTas()->UpdateThread();
if (!first_frame) { if (!first_frame) {
first_frame = true; first_frame = true;
emit FirstFrameDisplayed(); emit FirstFrameDisplayed();

View File

@ -237,10 +237,6 @@ void PlayerControlPreview::UpdateInput() {
} }
} }
if (controller_callback.update != nullptr) {
controller_callback.update(true);
}
if (mapping_active) { if (mapping_active) {
blink_counter = (blink_counter + 1) % 50; blink_counter = (blink_counter + 1) % 50;
} }

View File

@ -41,8 +41,7 @@ void ControllerDialog::refreshConfiguration() {
constexpr std::size_t player = 0; constexpr std::size_t player = 0;
widget->SetPlayerInputRaw(player, players[player].buttons, players[player].analogs); widget->SetPlayerInputRaw(player, players[player].buttons, players[player].analogs);
widget->SetControllerType(players[player].controller_type); widget->SetControllerType(players[player].controller_type);
ControllerCallback callback{[this](ControllerInput input) { InputController(input); }, ControllerCallback callback{[this](ControllerInput input) { InputController(input); }};
[this](bool update) { UpdateController(update); }};
widget->SetCallBack(callback); widget->SetCallBack(callback);
widget->repaint(); widget->repaint();
widget->SetConnectedStatus(players[player].connected); widget->SetConnectedStatus(players[player].connected);
@ -84,10 +83,3 @@ void ControllerDialog::InputController(ControllerInput input) {
} }
input_subsystem->GetTas()->RecordInput(buttons, input.axis_values); input_subsystem->GetTas()->RecordInput(buttons, input.axis_values);
} }
void ControllerDialog::UpdateController(bool update) {
if (!update) {
return;
}
input_subsystem->GetTas()->UpdateThread();
}

View File

@ -25,7 +25,6 @@ struct ControllerInput {
struct ControllerCallback { struct ControllerCallback {
std::function<void(ControllerInput)> input; std::function<void(ControllerInput)> input;
std::function<void(bool)> update;
}; };
class ControllerDialog : public QWidget { class ControllerDialog : public QWidget {
@ -45,7 +44,6 @@ protected:
private: private:
void InputController(ControllerInput input); void InputController(ControllerInput input);
void UpdateController(bool update);
QAction* toggle_view_action = nullptr; QAction* toggle_view_action = nullptr;
QFileSystemWatcher* watcher = nullptr; QFileSystemWatcher* watcher = nullptr;
PlayerControlPreview* widget; PlayerControlPreview* widget;

View File

@ -31,8 +31,6 @@
#include "core/hle/service/am/applet_oe.h" #include "core/hle/service/am/applet_oe.h"
#include "core/hle/service/am/applets/applets.h" #include "core/hle/service/am/applets/applets.h"
#include "input_common/tas/tas_input.h"
// These are wrappers to avoid the calls to CreateDirectory and CreateFile because of the Windows // These are wrappers to avoid the calls to CreateDirectory and CreateFile because of the Windows
// defines. // defines.
static FileSys::VirtualDir VfsFilesystemCreateDirectoryWrapper( static FileSys::VirtualDir VfsFilesystemCreateDirectoryWrapper(
@ -105,6 +103,7 @@ static FileSys::VirtualFile VfsDirectoryCreateFileWrapper(const FileSys::Virtual
#include "core/perf_stats.h" #include "core/perf_stats.h"
#include "core/telemetry_session.h" #include "core/telemetry_session.h"
#include "input_common/main.h" #include "input_common/main.h"
#include "input_common/tas/tas_input.h"
#include "util/overlay_dialog.h" #include "util/overlay_dialog.h"
#include "video_core/gpu.h" #include "video_core/gpu.h"
#include "video_core/renderer_base.h" #include "video_core/renderer_base.h"