Fixed clang and added a const keyword for mac

This commit is contained in:
kalaposfos13 2024-11-14 15:28:10 +01:00
parent e38e75b27b
commit 3e512bcd51
3 changed files with 7 additions and 7 deletions

View File

@ -801,10 +801,10 @@ std::filesystem::path getFoolproofKbmConfigFile(const std::string& game_id) {
} }
// if empty, we only need to execute the function up until this point // if empty, we only need to execute the function up until this point
if(game_id.empty()) { if (game_id.empty()) {
return default_config_file; return default_config_file;
} }
// If game-specific config doesn't exist, create it from the default config // If game-specific config doesn't exist, create it from the default config
if (!std::filesystem::exists(config_file)) { if (!std::filesystem::exists(config_file)) {
std::filesystem::copy(default_config_file, config_file); std::filesystem::copy(default_config_file, config_file);

View File

@ -343,13 +343,13 @@ void ControllerOutput::update(bool pressed, u32 param) {
case Axis::TriggerRight: case Axis::TriggerRight:
// todo: verify this works (This probably works from testing, // todo: verify this works (This probably works from testing,
// but needs extra info (multiple input to the same trigger?)) // but needs extra info (multiple input to the same trigger?))
axis_value = SDL_clamp((pressed ? (int)param : 0) * multiplier, 0, 127); axis_value = SDL_clamp((pressed ? (s32)param : 0) * multiplier, 0, 127);
controller->Axis(0, axis, GetAxis(0, 0x80, axis_value)); controller->Axis(0, axis, GetAxis(0, 0x80, axis_value));
return; return;
default: default:
break; break;
} }
axis_value = SDL_clamp((pressed ? (int)param : 0) * multiplier, -127, 127); axis_value = SDL_clamp((pressed ? (s32)param : 0) * multiplier, -127, 127);
int ax = GetAxis(-0x80, 0x80, axis_value); int ax = GetAxis(-0x80, 0x80, axis_value);
controller->Axis(0, axis, ax); controller->Axis(0, axis, ax);
} else { } else {
@ -400,13 +400,13 @@ void ControllerOutput::addUpdate(bool pressed, u32 param) {
case Axis::TriggerLeft: case Axis::TriggerLeft:
case Axis::TriggerRight: case Axis::TriggerRight:
// todo: verify this works // todo: verify this works
axis_value = SDL_clamp((pressed ? (int)param : 0) * multiplier + axis_value, 0, 127); axis_value = SDL_clamp((pressed ? (s32)param : 0) * multiplier + axis_value, 0, 127);
controller->Axis(0, axis, GetAxis(0, 0x80, axis_value)); controller->Axis(0, axis, GetAxis(0, 0x80, axis_value));
return; return;
default: default:
break; break;
} }
axis_value = SDL_clamp((pressed ? (int)param : 0) * multiplier + axis_value, -127, 127); axis_value = SDL_clamp((pressed ? (s32)param : 0) * multiplier + axis_value, -127, 127);
controller->Axis(0, axis, GetAxis(-0x80, 0x80, axis_value)); controller->Axis(0, axis, GetAxis(-0x80, 0x80, axis_value));
// LOG_INFO(Input, "Axis value delta: {} final value: {}", (pressed ? a_value : 0), // LOG_INFO(Input, "Axis value delta: {} final value: {}", (pressed ? a_value : 0),
// axis_value); // axis_value);

View File

@ -299,7 +299,7 @@ public:
// todo: check if out is in the allowed array // todo: check if out is in the allowed array
output = out; output = out;
} }
bool operator<(const BindingConnection& other) { bool operator<(const BindingConnection& other) const {
return binding < other.binding; return binding < other.binding;
} }
}; };