diff options
| author | Feng Chen <VonChenPlus@gmail.com> | 2022-09-20 11:56:43 +0800 | 
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-09-20 11:56:43 +0800 | 
| commit | c864cb57726e76e9dc4558036f3212168bec825d (patch) | |
| tree | ca79c4397f40990488a7b5691e15c0fcfec507b6 /src/common | |
| parent | 9a95c7fa14bdfc14aacea92896c8ae8533918fe8 (diff) | |
| parent | 8d4458ef24e473e57b9931d7a9d1442b51fb0b1a (diff) | |
Merge branch 'master' into mipmap
Diffstat (limited to 'src/common')
| -rw-r--r-- | src/common/CMakeLists.txt | 9 | ||||
| -rw-r--r-- | src/common/announce_multiplayer_room.h | 1 | ||||
| -rw-r--r-- | src/common/input.h | 5 | ||||
| -rw-r--r-- | src/common/parent_of_member.h | 2 | ||||
| -rw-r--r-- | src/common/settings.cpp | 1 | ||||
| -rw-r--r-- | src/common/settings.h | 2 | ||||
| -rw-r--r-- | src/common/thread.h | 4 | 
7 files changed, 19 insertions, 5 deletions
| diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index 635fb85c8..68436a4bc 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt @@ -19,7 +19,7 @@ find_package(Git QUIET)  add_custom_command(OUTPUT scm_rev.cpp      COMMAND ${CMAKE_COMMAND} -      -DSRC_DIR=${CMAKE_SOURCE_DIR} +      -DSRC_DIR=${PROJECT_SOURCE_DIR}        -DBUILD_REPOSITORY=${BUILD_REPOSITORY}        -DTITLE_BAR_FORMAT_IDLE=${TITLE_BAR_FORMAT_IDLE}        -DTITLE_BAR_FORMAT_RUNNING=${TITLE_BAR_FORMAT_RUNNING} @@ -31,13 +31,13 @@ add_custom_command(OUTPUT scm_rev.cpp        -DGIT_BRANCH=${GIT_BRANCH}        -DBUILD_FULLNAME=${BUILD_FULLNAME}        -DGIT_EXECUTABLE=${GIT_EXECUTABLE} -      -P ${CMAKE_SOURCE_DIR}/CMakeModules/GenerateSCMRev.cmake +      -P ${PROJECT_SOURCE_DIR}/CMakeModules/GenerateSCMRev.cmake      DEPENDS        # Check that the scm_rev files haven't changed        "${CMAKE_CURRENT_SOURCE_DIR}/scm_rev.cpp.in"        "${CMAKE_CURRENT_SOURCE_DIR}/scm_rev.h"        # technically we should regenerate if the git version changed, but its not worth the effort imo -      "${CMAKE_SOURCE_DIR}/CMakeModules/GenerateSCMRev.cmake" +      "${PROJECT_SOURCE_DIR}/CMakeModules/GenerateSCMRev.cmake"      VERBATIM  ) @@ -166,6 +166,7 @@ if(ARCHITECTURE_x86_64)              x64/xbyak_abi.h              x64/xbyak_util.h      ) +    target_link_libraries(common PRIVATE xbyak)  endif()  if (MSVC) @@ -189,7 +190,7 @@ endif()  create_target_directory_groups(common)  target_link_libraries(common PUBLIC ${Boost_LIBRARIES} fmt::fmt microprofile Threads::Threads) -target_link_libraries(common PRIVATE lz4::lz4 xbyak) +target_link_libraries(common PRIVATE lz4::lz4)  if (TARGET zstd::zstd)    target_link_libraries(common PRIVATE zstd::zstd)  else() diff --git a/src/common/announce_multiplayer_room.h b/src/common/announce_multiplayer_room.h index cb004e0eb..4a3100fa4 100644 --- a/src/common/announce_multiplayer_room.h +++ b/src/common/announce_multiplayer_room.h @@ -16,6 +16,7 @@ namespace AnnounceMultiplayerRoom {  struct GameInfo {      std::string name{""};      u64 id{0}; +    std::string version{""};  };  struct Member { diff --git a/src/common/input.h b/src/common/input.h index 213aa2384..825b0d650 100644 --- a/src/common/input.h +++ b/src/common/input.h @@ -102,6 +102,8 @@ struct AnalogProperties {      float offset{};      // Invert direction of the sensor data      bool inverted{}; +    // Press once to activate, press again to release +    bool toggle{};  };  // Single analog sensor data @@ -115,8 +117,11 @@ struct AnalogStatus {  struct ButtonStatus {      Common::UUID uuid{};      bool value{}; +    // Invert value of the button      bool inverted{}; +    // Press once to activate, press again to release      bool toggle{}; +    // Internal lock for the toggle status      bool locked{};  }; diff --git a/src/common/parent_of_member.h b/src/common/parent_of_member.h index 70b1c5624..8e03f17d8 100644 --- a/src/common/parent_of_member.h +++ b/src/common/parent_of_member.h @@ -11,7 +11,7 @@ namespace Common {  namespace detail {  template <typename T, size_t Size, size_t Align>  struct TypedStorageImpl { -    std::aligned_storage_t<Size, Align> storage_; +    alignas(Align) u8 storage_[Size];  };  } // namespace detail diff --git a/src/common/settings.cpp b/src/common/settings.cpp index 7282a45d3..0a560ebb7 100644 --- a/src/common/settings.cpp +++ b/src/common/settings.cpp @@ -195,6 +195,7 @@ void RestoreGlobalState(bool is_powered_on) {      values.shader_backend.SetGlobal(true);      values.use_asynchronous_shaders.SetGlobal(true);      values.use_fast_gpu_time.SetGlobal(true); +    values.use_pessimistic_flushes.SetGlobal(true);      values.bg_red.SetGlobal(true);      values.bg_green.SetGlobal(true);      values.bg_blue.SetGlobal(true); diff --git a/src/common/settings.h b/src/common/settings.h index 14ed9b237..851812f28 100644 --- a/src/common/settings.h +++ b/src/common/settings.h @@ -446,6 +446,7 @@ struct Values {                                                            ShaderBackend::SPIRV, "shader_backend"};      SwitchableSetting<bool> use_asynchronous_shaders{false, "use_asynchronous_shaders"};      SwitchableSetting<bool> use_fast_gpu_time{true, "use_fast_gpu_time"}; +    SwitchableSetting<bool> use_pessimistic_flushes{false, "use_pessimistic_flushes"};      SwitchableSetting<u8> bg_red{0, "bg_red"};      SwitchableSetting<u8> bg_green{0, "bg_green"}; @@ -529,6 +530,7 @@ struct Values {      Setting<bool> use_debug_asserts{false, "use_debug_asserts"};      Setting<bool> use_auto_stub{false, "use_auto_stub"};      Setting<bool> enable_all_controllers{false, "enable_all_controllers"}; +    Setting<bool> create_crash_dumps{false, "create_crash_dumps"};      // Miscellaneous      Setting<std::string> log_filter{"*:Info", "log_filter"}; diff --git a/src/common/thread.h b/src/common/thread.h index 1552f58e0..e17a7850f 100644 --- a/src/common/thread.h +++ b/src/common/thread.h @@ -54,6 +54,10 @@ public:          is_set = false;      } +    [[nodiscard]] bool IsSet() { +        return is_set; +    } +  private:      std::condition_variable condvar;      std::mutex mutex; | 
