Compare commits

..
2 Commits
5 changed files with 9 additions and 26 deletions

No files matched your search

+4 -1
View File
@@ -1,4 +1,7 @@
on: [push, pull_request]
on:
push:
pull_request:
workflow_dispatch:
name: Continuous Integration
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
-2
View File
@@ -48,8 +48,6 @@ struct OptionDefinition {
std::string file_extension = "";
std::string quick_setting_category = "";
bool trim_whitespace = false;
};
class Option {
+2 -9
View File
@@ -9,7 +9,6 @@
#include "hooks/devicehook.h"
#include "hooks/libraryhook.h"
#ifdef SPICE64
#include <mutex>
#include <psapi.h>
#include "hooks/graphics/nvapi_impl.h"
#endif
@@ -217,16 +216,10 @@ namespace games::sdvx {
}
// store a cached copy of the first successful call to K32GetPerformanceInfo
static std::mutex cache_mutex;
static PERFORMANCE_INFORMATION cached {};
static bool cached_valid = false;
std::lock_guard<std::mutex> lock(cache_mutex);
static const BOOL cached_valid = K32GetPerformanceInfo_orig(&cached, sizeof(cached));
if (!cached_valid) {
if (!K32GetPerformanceInfo_orig(info, cb)) {
return FALSE;
}
cached = *info;
cached_valid = true;
return K32GetPerformanceInfo_orig(info, cb);
}
// return the cached copy to avoid performance issues with the game calling this every frame
-4
View File
@@ -138,7 +138,6 @@ static const std::vector<OptionDefinition> OPTION_DEFINITIONS = std::invoke([]()
.setting_name = "example.com:8083",
.category = "Network",
.quick_setting_category = "Network",
.trim_whitespace = true,
};
c[launcher::Options::PCBID] = {
.title = "PCBID",
@@ -149,7 +148,6 @@ static const std::vector<OptionDefinition> OPTION_DEFINITIONS = std::invoke([]()
.category = "Network",
.sensitive = true,
.quick_setting_category = "Network",
.trim_whitespace = true,
};
c[launcher::Options::Player1Card] = {
.title = "Player 1 Card",
@@ -161,7 +159,6 @@ static const std::vector<OptionDefinition> OPTION_DEFINITIONS = std::invoke([]()
.sensitive = true,
.picker = OptionPickerType::EACard,
.quick_setting_category = "Network",
.trim_whitespace = true,
};
c[launcher::Options::Player2Card] = {
.title = "Player 2 Card",
@@ -173,7 +170,6 @@ static const std::vector<OptionDefinition> OPTION_DEFINITIONS = std::invoke([]()
.sensitive = true,
.picker = OptionPickerType::EACard,
.quick_setting_category = "Network",
.trim_whitespace = true,
};
c[launcher::Options::Player1PinMacro] = {
.title = "Player 1 PIN Macro",
+3 -10
View File
@@ -5282,16 +5282,9 @@ namespace overlay::windows {
ImGui::InputTextWithHint("", hint, buffer, sizeof(buffer) - 1);
// would like to use IsItemDeactivatedAfterEdit but can't handle the case when window is closed while editing
if (ImGui::IsItemEdited()) {
// trim whitespace to prevent copy/paste errors
auto value = definition.trim_whitespace ?
strtrim(buffer) : std::string(buffer);
if (option.value != value) {
this->options_dirty = true;
option.value = std::move(value);
::Config::getInstance().updateBinding(games_list[games_selected], option);
}
this->options_dirty = true;
option.value = buffer;
::Config::getInstance().updateBinding(games_list[games_selected], option);
}
if (ImGui::IsItemHovered(ImGui::TOOLTIP_FLAGS)) {
ImGui::HelpTooltip(definition.desc.c_str());