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

Redid the tilt controls in a nicer way #4515

Merged
merged 9 commits into from
Dec 22, 2013

Conversation

bollu
Copy link
Contributor

@bollu bollu commented Nov 12, 2013

Plus, you can use the D-Pad, Analog Stick and the PSP action buttons

Decided to rewrite it. As of now, all of the tilt interpretetion code is in one unit - TiltEventProcessor.cpp. NativeApp requests this "module" (a set of free-standing functions) to process the tilt and send the appropriate event. Code is heavily documented ;)

EDIT:
1)Sorry for the typo in the branch name.

  1. could someone edit the visual studio solution and add TiltEventProcessor.cpp, TiltEventProcessor.h into the solution for me?

Thanks!

@unknownbrackets
Copy link
Collaborator

If I'm reading this right it disables regular axises (analog sticks?) And it'll break the Windows build.

-[Unknown]

@bollu
Copy link
Contributor Author

bollu commented Nov 12, 2013

Hmm, okay, I'll uncomment that in that case.

@bollu
Copy link
Contributor Author

bollu commented Nov 12, 2013

yes, I know it'll break windows. Forgot to add that. could you edit the VS solution please?

@bollu
Copy link
Contributor Author

bollu commented Nov 12, 2013

Done. enabled the default axis event if the tilt events are disabled

@bollu
Copy link
Contributor Author

bollu commented Nov 13, 2013

@hrydgard, @unknownbrackets : other than the windows build, is there anything else missing?

@hrydgard
Copy link
Owner

I'll take a look at it soon, been a bit busy.

@bollu
Copy link
Contributor Author

bollu commented Nov 13, 2013

sure thing :)

@bollu
Copy link
Contributor Author

bollu commented Nov 26, 2013

@hrydgard: any update? ;)

@bollu
Copy link
Contributor Author

bollu commented Dec 12, 2013

@hrydgard: sorry, college snatched programming away from me for a solid moth or so :P Going to re-merge this branch again and rewrite some code :)

@sum2012
Copy link
Collaborator

sum2012 commented Dec 13, 2013

@bollu Remember make change in
UI\UI.vcxproj and UI.vcxproj.filters

@bollu
Copy link
Contributor Author

bollu commented Dec 15, 2013

done! :).

EDIT - the symbian build seems to have failed the build. don't know why.

@thedax
Copy link
Collaborator

thedax commented Dec 15, 2013

The Qt project files (this is why Symbian failed) and Windows project files still need to be updated.

@sum2012
Copy link
Collaborator

sum2012 commented Dec 15, 2013

I apply windows fix and I find
TiltEventProcessor.cpp line 101 and 138 have not declared M_PI
1

@thedax
Copy link
Collaborator

thedax commented Dec 15, 2013

@sum2012: Try this:

#define _USE_MATH_DEFINES
#include <cmath>

At the top of the file.

@sum2012
Copy link
Collaborator

sum2012 commented Dec 15, 2013

@thedax Thanks work

@thedax
Copy link
Collaborator

thedax commented Dec 15, 2013

No problem. If @bollu will actually look at his repository this time (the last time I tried to help, he never saw it for some reason :( ), I'll make a pull request on it which will update the project files and include the buildfix (though it'll have an ifdef around it for MSC_VER so only Visual Studio includes cmath).

@sum2012
Copy link
Collaborator

sum2012 commented Dec 16, 2013

@thedax I see scedisplay.cpp
It doesn't ifdef MSC_VER for use cmath

@sum2012
Copy link
Collaborator

sum2012 commented Dec 16, 2013

@bollu it is windows build fix
sum2012@7e2af3e

@thedax
Copy link
Collaborator

thedax commented Dec 16, 2013

_USE_MATH_DEFINES is a Visual Studio specific thing, I think. You might want to put ifdefs for visual studio around it and the cmath include.

@unknownbrackets
Copy link
Collaborator

Well, _USE_MATH_DEFINES probably won't harm other platforms.

-[Unknown]

@bollu
Copy link
Contributor Author

bollu commented Dec 16, 2013

@thedax my bad, hadn't seen your pull request :]. And thanks for fixing the windows build guys (it must be annoying to babysit my pull requests, i'm sorry)

@bollu
Copy link
Contributor Author

bollu commented Dec 16, 2013

I'll pull your changes in about an hour.

@thedax
Copy link
Collaborator

thedax commented Dec 16, 2013

Sum2012 gets the credit this time, heh. I was referring to the last major pull request you made, when it needed a few Windows fixes, and Henrik ended up fixing it.

@bollu
Copy link
Contributor Author

bollu commented Dec 16, 2013

hmm, can I directly pull from @sum2012 or does he have to make a pull request to me?

EDIT - @sum2012: I'm slightly curious as to why you pulled from my copy of ppsspp as opposed to Henrik's. I'm honored though :D

@thedax
Copy link
Collaborator

thedax commented Dec 16, 2013

Because it makes merging easier. If you accept his pullrq, it'll add his commits to this pullrq.

@bollu
Copy link
Contributor Author

bollu commented Dec 16, 2013

I'm assuming this will be merged once the build passes yes? EDIT - symbian build still fails on a linker error. What am I missing?

 FAILED linkandpostlink  for arm.v5.urel.gcce4_6_3: epoc32/release/armv5/urel/PPSSPPQt.exe
  mmp: PPSSPPQt_exe.mmp
   /home/travis/build/hrydgard/ppsspp/tools/gcce4/bin/../lib/gcc/arm-none-symbianelf/4.6.3/../../../../arm-none-symbianelf/bin/ld: warning: /home/travis/build/hrydgard/ppsspp/SDKs/SymbianSR1Qt474/epoc32/release/armv5/urel/usrt3_1.lib(ucppinit.o) uses variable-size enums yet the output is to use 32-bit enums; use of enum values across objects may fail
   /home/travis/build/hrydgard/ppsspp/SDKs/SymbianSR1Qt474/epoc32/build/qt/c_935d2be41e14a474/PPSSPPQt_exe/armv5/urel/GameSettingsScreen.o: In function `GameSettingsScreen::OnTiltTypeChange(UI::EventParams&)':
   /home/travis/build/hrydgard/ppsspp/UI/GameSettingsScreen.cpp:509: undefined reference to `TiltEventProcessor::ResetTiltEvents()'
   /home/travis/build/hrydgard/ppsspp/SDKs/SymbianSR1Qt474/epoc32/build/qt/c_935d2be41e14a474/PPSSPPQt_exe/armv5/urel/NativeApp.o: In function `NativeAxis(AxisInput const&)':
   /home/travis/build/hrydgard/ppsspp/UI/NativeApp.cpp:735: undefined reference to `TiltEventProcessor::GenTilt(TiltEventProcessor::Tilt const&, TiltEventProcessor::Tilt const&, bool, bool, float, float, float)'
   /home/travis/build/hrydgard/ppsspp/UI/NativeApp.cpp:741: undefined reference to `TiltEventProcessor::GenerateAnalogStickEvent(TiltEventProcessor::Tilt const&)'
   /home/travis/build/hrydgard/ppsspp/UI/NativeApp.cpp:749: undefined reference to `TiltEventProcessor::GenerateActionButtonEvent(TiltEventProcessor::Tilt const&)'
   /home/travis/build/hrydgard/ppsspp/UI/NativeApp.cpp:745: undefined reference to `TiltEventProcessor::GenerateDPadEvent(TiltEventProcessor::Tilt const&)'
   collect2: ld returned 1 exit status

    make[1]: *** [/home/travis/build/hrydgard/ppsspp/SDKs/SymbianSR1Qt474/epoc32/release/armv5/urel/PPSSPPQt.exe] Error 1
sbs: error: The make-engine exited with errors.

@thedax
Copy link
Collaborator

thedax commented Dec 16, 2013

The Qt project files still need to be updated.

@bollu
Copy link
Contributor Author

bollu commented Dec 16, 2013

How would I do that?. Also, that an extra step that's been added while I was gone?

@thedax
Copy link
Collaborator

thedax commented Dec 16, 2013

It's been a necessary step for as long as Qt has been supported in PPSSPP.

Edit the section in https://github.com/hrydgard/ppsspp/blob/master/Qt/PPSSPP.pro#L80 and it should work.

@unknownbrackets
Copy link
Collaborator

Qt builds on Linux too, just use Qt Creator.

-[Unknown]

@thedax
Copy link
Collaborator

thedax commented Dec 16, 2013

And there you go, assuming no other issues exist, this should be ready for merging.

@bollu
Copy link
Contributor Author

bollu commented Dec 16, 2013

Yep! At last! :)

@thedax
Copy link
Collaborator

thedax commented Dec 16, 2013

Giving this a quick test compile in VS 2013 (it's pretty picky).

@sum2012
Copy link
Collaborator

sum2012 commented Dec 16, 2013

This is my first time to fork other people branch :)

@thedax
Copy link
Collaborator

thedax commented Dec 16, 2013

Visual Studio 2013 compiled it fine. This is all good to go.

@bollu
Copy link
Contributor Author

bollu commented Dec 16, 2013

Thanks for the awesome help guys!. @hrydgard: merge this? :3

@sum2012
Copy link
Collaborator

sum2012 commented Dec 16, 2013

@hrydgard the commit still have porblem ?

@bollu
Copy link
Contributor Author

bollu commented Dec 22, 2013

Any reason this hasn't been merged yet? :)

@hrydgard
Copy link
Owner

I wanted to see if I can find a more generic design but I've realized I don't have the time, so here we go :P Can always be changed later.

hrydgard added a commit that referenced this pull request Dec 22, 2013
Redid the tilt controls in a nicer way
@hrydgard hrydgard merged commit b0bfda6 into hrydgard:master Dec 22, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants