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,7 +801,7 @@ std::filesystem::path getFoolproofKbmConfigFile(const std::string& game_id) {
}
// 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;
}

View File

@ -343,13 +343,13 @@ void ControllerOutput::update(bool pressed, u32 param) {
case Axis::TriggerRight:
// todo: verify this works (This probably works from testing,
// 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));
return;
default:
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);
controller->Axis(0, axis, ax);
} else {
@ -400,13 +400,13 @@ void ControllerOutput::addUpdate(bool pressed, u32 param) {
case Axis::TriggerLeft:
case Axis::TriggerRight:
// 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));
return;
default:
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));
// LOG_INFO(Input, "Axis value delta: {} final value: {}", (pressed ? a_value : 0),
// axis_value);

View File

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