Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GCPadStatus: coalescing magic numbers into consts #657

Merged
merged 1 commit into from Jul 21, 2014

Conversation

booto
Copy link
Contributor

@booto booto commented Jul 21, 2014

This eliminates duplicated magic numbers from a few different files and makes them a named constant members of the structure that uses them.

@@ -103,12 +103,12 @@ void GCPad::GetInput(GCPadStatus* const pad)

// sticks
m_main_stick->GetState(&x, &y);
pad->stickX = 0x80 + (x * 0x7F);
pad->stickY = 0x80 + (y * 0x7F);
pad->stickX = GCPadStatus::MAIN_STICK_CENTER_X + (x * GCPadStatus::MAIN_STICK_MAX_MAGNITUDE_X);

This comment was marked as off-topic.

@delroth
Copy link
Member

delroth commented Jul 21, 2014

@booto: This comment grants you the permission to merge this pull request whenever you think it is ready. After addressing the remaining comments, click this link to merge.


LGTM, I'm not sure about RADIUS vs. MAX_MAGNITUDE, will let you decide that.

@dolphin-emu-bot allowmerge

@lioncash
Copy link
Member

Thanks for doing this <3

dolphin-emu-bot added a commit that referenced this pull request Jul 21, 2014
GCPadStatus: coalescing magic numbers into consts
@dolphin-emu-bot dolphin-emu-bot merged commit 67ff926 into dolphin-emu:master Jul 21, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
4 participants