aboutsummaryrefslogtreecommitdiff
path: root/src/input_common
diff options
context:
space:
mode:
authorliamwhite <liamwhite@users.noreply.github.com>2023-01-10 15:26:36 -0500
committerGitHub <noreply@github.com>2023-01-10 15:26:36 -0500
commit067831de41d17e3380df2cf13f071d198001a160 (patch)
tree865bd949208a7dad04a4eb45e9f353588df589d6 /src/input_common
parent3efc13dd546dd27e71890b450c25902e444e8d64 (diff)
parenta1bec20a605e44ccb0640a90b42347fd6220f697 (diff)
Merge pull request #9565 from MonsterDruide1/tas-multiplayer-lengths
TAS: Show all script lengths for multiplayer
Diffstat (limited to 'src/input_common')
-rw-r--r--src/input_common/drivers/tas_input.cpp12
-rw-r--r--src/input_common/drivers/tas_input.h2
2 files changed, 10 insertions, 4 deletions
diff --git a/src/input_common/drivers/tas_input.cpp b/src/input_common/drivers/tas_input.cpp
index f3ade90da7..f3cb14c56f 100644
--- a/src/input_common/drivers/tas_input.cpp
+++ b/src/input_common/drivers/tas_input.cpp
@@ -156,10 +156,12 @@ void Tas::RecordInput(u64 buttons, TasAnalog left_axis, TasAnalog right_axis) {
};
}
-std::tuple<TasState, size_t, size_t> Tas::GetStatus() const {
+std::tuple<TasState, size_t, std::array<size_t, PLAYER_NUMBER>> Tas::GetStatus() const {
TasState state;
+ std::array<size_t, PLAYER_NUMBER> lengths{0};
if (is_recording) {
- return {TasState::Recording, 0, record_commands.size()};
+ lengths[0] = record_commands.size();
+ return {TasState::Recording, record_commands.size(), lengths};
}
if (is_running) {
@@ -168,7 +170,11 @@ std::tuple<TasState, size_t, size_t> Tas::GetStatus() const {
state = TasState::Stopped;
}
- return {state, current_command, script_length};
+ for (size_t i = 0; i < PLAYER_NUMBER; i++) {
+ lengths[i] = commands[i].size();
+ }
+
+ return {state, current_command, lengths};
}
void Tas::UpdateThread() {
diff --git a/src/input_common/drivers/tas_input.h b/src/input_common/drivers/tas_input.h
index 38a27a2309..5be66d142f 100644
--- a/src/input_common/drivers/tas_input.h
+++ b/src/input_common/drivers/tas_input.h
@@ -124,7 +124,7 @@ public:
* Current playback progress ;
* Total length of script file currently loaded or being recorded
*/
- std::tuple<TasState, size_t, size_t> GetStatus() const;
+ std::tuple<TasState, size_t, std::array<size_t, PLAYER_NUMBER>> GetStatus() const;
private:
enum class TasAxis : u8;