Skip to content

Commit

Permalink
Fixed clang and added a const keyword for mac
Browse files Browse the repository at this point in the history
  • Loading branch information
kalaposfos13 committed Nov 14, 2024
1 parent e38e75b commit 3e512bc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions src/common/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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(game_id.empty()) {
if (game_id.empty()) {
return default_config_file;
}

// If game-specific config doesn't exist, create it from the default config
if (!std::filesystem::exists(config_file)) {
std::filesystem::copy(default_config_file, config_file);
Expand Down
8 changes: 4 additions & 4 deletions src/input/input_handler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/input/input_handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ class BindingConnection {
// 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;
}
};
Expand Down

0 comments on commit 3e512bc

Please sign in to comment.