Hi,
I've got a tilt-controlled game, locked to landscape mode (DispFixRot=2) - and I've noticed that in some cases the screen turns upside down, with a relatively small amount of tilt.
This is a bit of a problem for a tilt-to-steer game...
Repro steps:
- Marmalade 6.0.5
- IwGL app on iOS
- DispFixRot = 2
Hold the device in landscape mode, with the home button on the *left*
Rotate the device slowly, as if turning a steering wheel, either counter-clockwise or clockwise.
At around 45 degrees (iPhone 4) or 70 degrees (iPad 3), the screen flips upside down - much earlier than expected.
(If you hold the device with the home button on the *right*, it doesn't flip until you rotate well beyond 90 degrees)












The numerical value for DispFixRot isn't supported any more - you need to use a string (LandscapeFixed).
The numerical values are deprecated but still supported.
The problem still occurs with DispFixRot=Landscape
Here's a video to show the problem. Should make it fairly clear what's wrong. (This is after switching to DispFixRot=Landscape, just to rule out those old numeric values causing problems):
www.youtube.com/watch?v=z22DsNEyYqs&feature=youtu.be&hd=1
(It's a tilt-controlled game by default, and players are likely to reach that 45 degree or so angle with a bit of lively tilting)
As I'm using GLES2, I'm rotating the render myself, using the value returned by IwGLGetInt(IW_GL_ROTATE)
It's a relatively recent bug, as it's not present in Little Acorns, which used the same code, but used a 5.x version of Marmalade (can't remember the exact version)
(To make it even clearer, the first 15secs show the bad/early flips, and after that, I rotate the device 180 degrees for comparison)
Try "DispFixRot=FixedLandscape" to disable flipping 180 degrees.
Does that make any difference?
-David
Oh, and BTW, +1 to your choice of background music! ;)
-David
lol, I did intend to strip the audio off but forgot... Been listening to lots of random stuff on Spotify whilst coding!
Problem is still present in 6.0.6
It only seems to affect iOS. Cannot reproduce it on Android.
This is strange. I don't get this problem. But I am testing manually for the orientation by using GetInt() from the device (don't recall the actual code)
By the way, bluescrn, want to ask you out of curiosity, did you get many in-app purchases from your acorns game?
Looks like you are not checking all four orientation possibilities, and are only checking for a 180? As the 180 is relative to portrait you are in a muddle!
I can make a suggestion but as I allow gameplay in both landscape and portrait, then it is a guess how you might deal with fixed landscape...
Test for rot90 and rot270 only!
There's nothing to test for, as such.
I'm using IwGLGetInt, and it as I'm locked to landscape using DispFixRot, it only ever returns one of two values.
All I'm doing in my camera code (used for both 2D and 3D rendering) is this:
This same code was used in Little Acorns (when running in GLES2.0 mode), and it didn't have this problem back then.
Same problem...
We will publish our game soon. Please fix it.
Only with Landscape mode.
Good to know it's not just me... would be nice to get this acknowledged as a bug. Definitely didn't happen with the 5.x version that we shipped Little Acorns using (don't know the exact version number, though).
The worst-case workaround is, I suppose, to lock the game to a single landscape orientation, instead of allowing either. Not ideal though.
up.
I showed them this one at the developer day last week, and they've got a fix for it - so with any luck it'll be fixed in the next release :)
Confirmed fixed in 6.1, hooray! :)
>> Confirmed fixed in 6.1, hooray! :)
Hm. I upgraded the sdk today, but this bug still here. Are you sure about that?
Yes, it's definitely fixed in my project, at least when running on an iPhone 4.
(Haven't re-tested on other iDevices yet)