Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Crackdown 2 Tweak (#32)
Browse files Browse the repository at this point in the history
* Update README.md

* Invert inversion and remove unnecessary mouse check

* Update README.md

---------

Co-authored-by: Clippy95 <[email protected]>
2 people authored and marinesciencedude committed Oct 22, 2024

Verified

This commit was signed with the committer’s verified signature.
devmaxde DevMax
1 parent 3643421 commit 4c4e1c7
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/xenia/hid/winkey/hookables/Crackdown2.cc
Original file line number Diff line number Diff line change
@@ -83,11 +83,6 @@ bool Crackdown2Game::DoHooks(uint32_t user_index, RawInputState& input_state,
return false;
}

// Don't constantly write if there is no mouse movement.
if (input_state.mouse.x_delta == 0 || input_state.mouse.y_delta == 0) {
return false;
}

XThread* current_thread = XThread::GetCurrentThread();

if (!current_thread) {
@@ -118,7 +113,7 @@ bool Crackdown2Game::DoHooks(uint32_t user_index, RawInputState& input_state,
float degree_y = RadianstoDegree(*radian_y);

// X-axis = 0 to 360
if (!cvars::invert_x) {
if (cvars::invert_x) {
degree_x += (input_state.mouse.x_delta / 50.f) * (float)cvars::sensitivity;
*radian_x = DegreetoRadians(degree_x);
} else {
@@ -127,7 +122,7 @@ bool Crackdown2Game::DoHooks(uint32_t user_index, RawInputState& input_state,
}

// Y-axis = -90 to 90
if (!cvars::invert_y) {
if (cvars::invert_y) {
degree_y += (input_state.mouse.y_delta / 50.f) * (float)cvars::sensitivity;
} else {
degree_y -= (input_state.mouse.y_delta / 50.f) * (float)cvars::sensitivity;

0 comments on commit 4c4e1c7

Please sign in to comment.