RetroBytes Portal
Programming => Other Games & Projects => Topic started by: spacefractal on December 14, 2014, 04:09:24 pm
-
64bit issue is one of them. The code signing is still hell to uses, where Android is much much easier to test with.
Glbasic its self seen not been 64bit aware and im dont thinks its will got updated to meet the requirements, but howover Gernot have released the Source Code for glbasic. Im did got to the point the code can get compiled directly in xCode, but still crash on startup.
More on that function in gfshoebox.h:
int FindOrExtract(const char* szFileName, char* pszFoundName, bool bAllowMemfile)
on the char* pointer me thinks with a adress error. But sadly im is not good how c++ pointers really works, so im have no clue how to fix that kind of issue and then stuck here (and hope some other can help to that issue as well). But im did fixed various Android issues yet and works excellent with that that.
But anyway my next game is Space Taxi, and im do fell that game would not been very good using touch screen, but would been better using a Game Controller in hand, so that game would NOT been relased to Android either. But its can come to Android based game consoles as well (such like Ouya, Gamestick, Fire TV and so on), which have a game controller.
PS. Nice little snake game. Yes Apple Watch is more to get noticement its, and is property not meant to been played on that. Im do thinks hud like status could been fun to been used on that, or uses that as a game controller eventuelly could been fun.
-
on the char* pointer me thinks with a adress error.
If you post the project file I can take a look.
-
im will send it later. The issue is not in the game its self, but more in the glbasic source code lib (the named function), the basic language im uses (which is wrote in c++).
Howover even the source code got released for about a month aho, there is still not issued a license how we can uses it. But iOS 64bit was the main reason the source code got released.
Im have just compiled a xCode project, where im have combined the glbasic source code to the main project, so its easier to see what it happens (normally, when source code was closed, its was allways a lib file you did include and still should do that way really).
Im pm you a link sson.
PS. if you can get it running and show the Catchout credits (rest of game is removed in that zip, which is not relevant for this issue), then im pretty sure im want to pay you as well property some members from glbasic community.
-
I'm happy to try and help and there is no need to pay me for it. If we have all the source code I don't doubt we can get it working.
Okay so let me at least get to where you're at. You're saying you can compile and run in 64-bit but you get a crash? I'm getting alot of errors when I attempt to link.
ld: warning: directory not found for option '-L/Volumes/STORAGE/Source/iOS/iPhoneGlbasicXcodeWithSource/XCode/Lib'
ld: warning: ignoring file /Volumes/STORAGE/Source/iOS/iPhoneGlbasicXcodeWithSource/XCode/Code/libpng-gf.a, missing required architecture x86_64 in file /Volumes/STORAGE/Source/iOS/iPhoneGlbasicXcodeWithSource/XCode/Code/libpng-gf.a (2 slices)
Undefined symbols for architecture x86_64:
"gf_png_open(char const*, int*, int*, int*, int*)", referenced from:
OPENGL_IMAGE::LoadImagePNG(char const*, unsigned long) in openglrainbows.o
"gf_png_read(unsigned char*, unsigned char**)", referenced from:
OPENGL_IMAGE::LoadImagePNG(char const*, unsigned long) in openglrainbows.o
"gf_jpeg_read(char const*, int*, int*, int*, unsigned char**)", referenced from:
OPENGL_IMAGE::LoadImageJPG(char const*) in openglrainbows.o
"gf_png_close()", referenced from:
OPENGL_IMAGE::LoadImagePNG(char const*, unsigned long) in openglrainbows.o
"gf_write_png(char const*, unsigned char const*, int, int)", referenced from:
OpenGLRainbows::SaveImageFile(char const*, OPENGL_IMAGE&) in openglrainbows.o
"gf_write_jpeg(char const*, unsigned char const*, int, int)", referenced from:
OpenGLRainbows::SaveImageFile(char const*, OPENGL_IMAGE&) in openglrainbows.o
"_glbSoundEngine_IsBackgroundMusicPlaying", referenced from:
iPhoneIsMusicPlaying() in dxsound.o
"_glbSoundEngine_IsEffectPlaying", referenced from:
SFXSoundBuffer::Play(int, int, unsigned long) in dxsound.o
SFXSoundBuffer::IsPlaying(long) in dxsound.o
"_glbSoundEngine_LoadBackgroundMusicTrack", referenced from:
iPhonePlayMusic(char const*, bool) in dxsound.o
"_glbSoundEngine_LoadEffect", referenced from:
SFXSoundBuffer::Load(SFXSound*, char const*, int) in dxsound.o
"_glbSoundEngine_PauseBackgroundMusic", referenced from:
iPhonePauseMusic(bool) in dxsound.o
"_glbSoundEngine_SetBackgroundMusicVolume", referenced from:
iPhoneMusicVolume(float) in dxsound.o
"_glbSoundEngine_SetEffectLevel", referenced from:
SFXSoundBuffer::Play(int, int, unsigned long) in dxsound.o
"_glbSoundEngine_SetEffectPosition", referenced from:
SFXSoundBuffer::Play(int, int, unsigned long) in dxsound.o
"_glbSoundEngine_SetListenerPosition", referenced from:
SFXSound::SFXSound() in dxsound.o
"_glbSoundEngine_StartBackgroundMusic", referenced from:
iPhonePlayMusic(char const*, bool) in dxsound.o
"_glbSoundEngine_StartEffect", referenced from:
SFXSoundBuffer::Play(int, int, unsigned long) in dxsound.o
"_glbSoundEngine_StopBackgroundMusic", referenced from:
iPhonePlayMusic(char const*, bool) in dxsound.o
"_glbSoundEngine_StopEffect", referenced from:
SFXSoundBuffer::Stop(int) in dxsound.o
"_glbSoundEngine_UnloadBackgroundMusicTrack", referenced from:
iPhonePlayMusic(char const*, bool) in dxsound.o
iPhoneStopMusic() in dxsound.o
"_glbSoundEngine_UnloadEffect", referenced from:
SFXSoundBuffer::Clear() in dxsound.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
-
When all files is imported correctly, it's should crash in that function and works fine in 32bit mode.
it's iOS only (the is compiled only to arm7v and arm64, not the Intel processor), etc the png lib. Glbasic have never worked in the iOS simulator.
Pps. Source code is not fully public, why I'm pm it.
-
I had some code sign issues I had to sort out on the Apple Developer Connection website.
The strange thing is if I set the target to iPhone 6 Simulator I get those errors. If I target my iPhone 5 hardware it compiles and runs fine. Very strange.
Anyway I am not getting a crash at all. Titlescreen shows for me.
-
32bit works pretty nice as you see, did you add arm64 to the list? I'm diddent do that in the project.
It's crash when arm64 is used.
-
You did add arm64 to the project.
Still I can't run on the Simulator for some reason.
It runs on my iPad Air and I get that error you're getting. So at least we're on the same page.
-
Simulator was never worked in glbasic, due the libs was not compiled with that ind mind.Im do also not used simulator at all, due most of dev is on Windows anyway. So its not a real issue. So its best to test on a real device.
There is a libpng-gf.a file, which im also not have added the source code for (im could do that), because im dont thinks its a issue in that file really. Even its uses a little bit older version of it. But if something happens on that happens, let me known. the png library file is not compiled with simulator in mind, and hence you get the issue.
PS. Im was not home yet. But its seen you now got the same issue now.
-
This was quite tricky to debug because the debugger was not giving a lot of clues as to the exact line causing the crash. But I did find it in the end!
The crash is caused by this in gfcompression.h:
#ifdef hashing_on
void ADDHASH(long a,long b, long c);
long m_HASH_TABLE[65536];
#endif
To fix this change it to:
#ifdef hashing_on
void ADDHASH(long a,long b, long c);
long *m_HASH_TABLE;
#endif
Then modify the constructor like so:
GFCompression()
{
#ifdef hashing_on
m_HASH_TABLE = new long[65536];
#endif
m_outfile=0L;
Clear();
m_Method=1;
}
I hope this helps :)
-
Well spotted/fixed, oh saint of the codewise keyboard... :)
-
well spotted. Im was newer thinks its was in a another h file as excepted. Im see what happens with the full game. Testing that soon (im have little time today, before im away again most of the day).
The game is now starting up, but im do now there is few more issues (like SORTARRAY and ADRESSOF). But nice to see the game running and have newer excepted its was in a another h file that cached the issue.
But that bar on the top left,?
(http://dl.dropboxusercontent.com/u/3236515/glbasic/64bitworking.png)
Its seen glbasic is turning to the demo mode, which is why you seen the bar on the top left. So no worry about that. Im im seen more issue, im will went back. Big thanks for the help.
-
Happy to help out SF. I hope it means you can continue developing for iOS.
-
Now my next game is space taxi and here I'm do still note sure about touchscreen. However here the could been uses of game controller support for iOS of course.
There can still been issues left when I'm testing my other games, im let you known when that happens.
I'm also pretty sure other glbasic users is happy as well :-). Not just me.
-
I forgot to mention that you will also need to delete that array in the destructor.
~GFCompression()
{
Clear();
#ifdef hashing_on
delete[] m_HASH_TABLE;
#endif
}
-
Im have added the forgotten gode :-).
There is one more issue im hope you can look on, which also effects load and save games in CatchOut, which is the last remaining 64bit issue in that game. Rest seen works like its does now.
This time its in ENCRYPT() and DECRYPT(). They dosent give the same result. Im believe its due some pointer or value converting as well?
The lines is in 651 in glb-full.cpp. Im hope its init the blowfish is wrong and then easier to fix that one than its the blowfish code its self.
in windows im got those result from both commands:
ENCRYPT: 0138ab274fcbf752088a14c3704919e6
DECRYPT$: this.is.a.test
There was also some bugs in GETJOYY() and GETJOYX() as well (used for tilt), but here im do managed to fix those by my self here.
Im have updated the zip file now, and its the same link as before.
PS. IM dosent seen the reason to give the whole catchout source, so im only used a example to show the bug (which is just a output result this time, so its close down after that).
-
It's okay I don't need the full project.
PS You have entered 'arm7v' instead of 'armv7'
I will have a look soon.
-
Okay found the issue in gffilesystem.h
Change:
#define DWORD unsigned long
to
#define DWORD unsigned int
-
and the output is the same as on Windows? Im also mind im saw that define as well in blowflow.h as well, so have thinked the same thing.
-
You may want to consider using uint32_t. That way you know it's an 'unsigned 32-bit integer'.
You can check how many bytes a type is by outputting it like so:
g_debug("sizeof(long): %ld\n", sizeof(long));
You will see you get the following output.
iOS 32-Bit Output
sizeof(long): 4
iOS 64-Bit Output
sizeof(long): 8
I would add checks to your code to make sure each type is what you expect it to be.
Eg. Add #include <assert.h> to the top of the file and the following:
assert(sizeof(DWORD) == 4);
The debugger will stop there if the assertion fails.
-
seen its worked. Im was so close about that one, and saw the same thing in a another file... hehe.
-
C - I don't even get the most basic stuff - I couldn't even make a 'hello world' program if my life depended on it (yet ;) )...but it's so nice to see how people with knowledge helps someone else out. :-*
-
The chances in glcompression diddent work when compiles to get other platforms, so I'm changed it so it's chances only happens in 64bit mode.
Also today I'm got a email the 64bit requirement for iOS only is for new app in feb, while updates is in jun.
Also we have various of spam post.
But thanks for help headkaze.
-
look like im finally could fix that by my self about the strange GETCURRENTDIR() and now got the game running again. Its was A bug in glb_prepare_reading_file() im diddent excepted.
But.... Greedy Mouse does now crash in 64bit mode, but its a excepted a SORTARRAY bug in compare_by_foo().
Its a pretty much a similar issue me thinks.
EDIT:
m did fixed that one by my self. its was a 32/64bit define that got swapped and was allready nearly got fixed.
Greedy Mouse now run nicely. Phew. One game ago (Karma Miwa).
-
Greedy Mouse now run nicely. Phew. One game ago (Karma Miwa).
Great to hear that SF :)
-
Greedy Mouse 64bit is uploaded to iTunes Connect now.
Its too late for Catch Out (which did have some fraterate issues with iOS5 devices, so im set iPad 1, iPhone 3gs and iPhone 4 to 30fps, rest to 60 fps). But the game was allready uploaded for over a week ago, and im wont remove that binary. So soon the game got released (or rejected), then im will do a 64bit upload to them (which im also look on the iCloud issue with Catchout).
Later Spot Race and Karma Miwa will give it a ago. Howover merry xMas and im now take a little vacattion on those issue.
Now im have the source code, then its could been fun to add msi game controller support to iOS, which is more possible to uses those.
-
its is me, its look complete impossible to rename the final a file. Im came accidently call it libGlBasicPhone for the project.
But im have MANY times tried it to FORCE xcode to compile it to libGlBasicPhone.a and not liblibGlBasicPhone.a, but with no luck. That even im have edited all files in project.pbxproj and remove the two folders created there.
Im do not understand this very strange and very annoying xcode bug.
-
There is a 64bit issue with SORTARRAY, still not fixed correctly. Im have pm the source. This time its on the last game, Karma Miwa, which uses SORTARRAY by sorting the sprites priotity under a level load.
Thie project is using the final xcode a glbasic user would use, etc without glb source code, but the code required to look in is there.
-
Okay I have it compiling for 32-bit and 64-bit. I see some output on the screen. What I need to do is run it in 32-bit and compare the output with the 64-bit mode so I can see what is going wrong. At the moment all I get is a constant stream of values. Also what file are these values being output from so I can output a marker for the start of the list of values so they actually make sense?
-
It's crash when you select a level in the SORTARRAY command (used for sorting sprites). Etc in glbasic.h.
The game menu runs fine. Do it's a crash issue with a another pointer issue.
-
Okay here we go...
In gpc_temp2.cpp (and gpc_temp.h) change the return type of compare like so
int compare(Object& a, Object& b)
In glb.h change the following (foo should be a DGPtr):
template <class T> void SORTARRAY(T& arry, DGPtr foo)
...and here the return value should be int and no cast of the return value of cmp.
template <class T> int compare_by_foo(T& a, T& b, DGPtr foo)
{
typedef DGPtr(*pcmp)(T&a, T&b);
pcmp cmp;
#pragma warning(disable:4312)
cmp = (pcmp)(DGPtr*)foo;
return cmp(a,b);
}
-
Here its still crash with a EXE_BAD_CESSS in if (a.obid<b.obid) after those change.
here what im try (as well your version):
template <class T> int compare_by_foo(T& a, T& b, DGPtr foo)
{
typedef DGPtr(*pcmp)(T&a, T&b);
pcmp cmp;
//#pragma warning(disable:4312)
cmp = (pcmp)(DGPtr*)foo;
int f=cmp(a,b);
return f;
}
But im also get a warning in int f=cmp(a,b):
Implicit conversion loses integer precision: 'DGPtr' (aka 'long long') to 'int'.
PS. In your version, im might have forget to add arm64.
-
It is definitely working in 64-bit mode for me after those changes. Perhaps I'm missing a change. Hang on a sec and I'll have a look.
-
ok.
int compare(Object& a, Object& b) is also not working, but im uses DGInt compare(Object& a, Object& b) instead (its came with a red warning).
-
Try this
template <class T> int compare_by_foo(T& a, T& b, DGPtr foo)
{
typedef int(*pcmp)(T&a, T&b);
pcmp cmp;
#pragma warning(disable:4312)
cmp = (pcmp)foo;
return cmp(a,b);
}
Also don't forget you need to change the following line in gpc_temp.h
int compare(Object& a, Object& b);
Definitely works after that on my iPad Air running 64-bit.
-
damn. Im see what its happens. There was a confuction with the naming.
DGInt is a float, while DGNat is a integer. Im used a DGInt, which have crashed it (its allways a 32bit float).
So there is also a issue in the GLBASIC manual as well, which trying that example will uses a float rather than a int. You need to add a % to the function in GLBASIC code.
This was the main reason why its diddent work, and also the new template is also confirmed works too and the game running now. Thanks for your help.
PS. How is Karma Miwa performing on your 6plus?
-
I don't have a 6 plus, only an iPhone 5 and it runs fine on that.
-
how do im define in xCode. Im have newer found that feature at all, and is totally confusion how that one work in xCode.
Im trying to do something like -DTARGET_OS_IPHONE, but im could newer get that to work.
-
That looks right SF.
Just be sure to put it in for each Debug, Release and Distribution settings. Also for "Other C Flags" and "Other C++ Flags". You may also need to check the "Preprocessor Macros" section; although other flags should be enough.
-
thanks for the screenshot.
-
finally after a perioid with ski vacation and being sig after that (its was a nice vacation), then im finally tested this today. Its works much better now, so im only needs one stdafx.h instead of two (one for iPhone, and one for rest of the platforms).
-
look like im need more help. Im cannot get Karma Miwa compiled (im have tweeked a lots of levels and added few features those days), not even in 32bit mode only. Xcode is very strange and keeps the sound engine is missing, even its should been there and include. That even im inlude glbasic source into the project. Im sadly have no one clue what it going in here....
Im got a lots of undefined symboyls for glbSoundEngine functions from dxsound.o, even im uses the source code directly (as a t est), that even im trying to clean and even restart xcode. So im got stuck again.
im pm the project, but im have NOT include the graphics for the filesize, since im asume its should works after its compile again. Also for testing im have only used 32bit mode. Not 64bit.
PS. Im might missing somewhere a framework included, but what does xcode not tell that? Im have no clue which framework the sound engine really uses.
-
In iphonesoundengine.cpp comment out the following two lines
#if defined (APPLE_COREAUDIO)
#endif // APPLE_COREAUDIO
-
im dont understand why that needed, due its should have defined that already, but xCode seens to skips that?
Howover im have still one very strange issue left.
im got a undefined symbols linker error from
"__GLBASIC__::DEBUG from gpc_temp5.o
but there is no such call from cpp code which was there, I'm but I'm commented it out, but xcode still thinks it's there in the o file.
its look like its cached, but im cant delete that cache, even im clean that and also restart xcode.
weird....
-
Im got Karma Miwa running with the update.
But have still trouble with the define options in xcode in "other flags", which seen not working quite very well.
example APPLE_COREAUDIO was defined, but fails to works as its should.
Tomorrow im seen can get stdafx.h working without having require two of them (one for iOS and one for rest of the platforms).
by now im have defined them directly in the file like this:
#define TARGET_OS_IPHONE
#define IPHONE
#define HAVE_OPENGL_ES
#define POSIX
#define APPLE_COREAUDIO
#undef WIN32
but should doing something like this:
#ifdef TARGETIOS
#define TARGET_OS_IPHONE
#define IPHONE
#define HAVE_OPENGL_ES
#define POSIX
#define APPLE_COREAUDIO
#undef WIN32
#endif
But for me xCode working can been quite confuction and strange....
Now im should create some levels for Balders. Im do later this week.
-
when compiled as a lib, then im get a new crash and seen only happens on iPad 1 (iOS5).
dyld: Symbol not found: __sincos_stret
referenced from those line in OpenGLRainbows.cpp:
sphi = sin(phi * BOG_INV_F);
EDIT: Seens Fixed. Im forget to set iOS Deployment Target to iOS5.1 when creating the glbasic iphone lib....
-
Greedy Mouse v3.5 is ready for Android (just not uploaded), include various Android Micro Consoles (fixed a anoying inapp issue for Ouya). Im do might dedicated skips iOS this time. xCode simply just want to add those damn DEFINES and skips them completly or partly and have been stuck in a while.
its the DEFINE its the remaning issue. When adding the source code, its works, but not when compiling to the lib first.
-
This might help
http://stackoverflow.com/questions/367368/how-to-define-a-preprocessor-symbol-in-xcode
-
look like im FINALLY got it to works, even there is confuction about it. Now the game ran correctly with the compiled lib file, and have updated the public xcode project to v4. Thanks for the help.
Few issues was returned (the blowfish and a tilt issues), but seen im got those corrected to, so im now only need one source code instance in the future.
-
Jubii, Genius Greedy Mouse with the new glbasic lib is now submitted to Itunes Connect in 3.4.
Android version (Ouya/Mojo, Amazon AppStore and Google Play) is pretty much ready too. Im did added Amazon FireTV code, so im try adding that platform for the submittion.
-
im have finally brought a MOGA iOS 7 MFI controller. Its might take a week before its arive here.
Now im thinks im want to add MFI controller support for GlBasic (as least the lower game pad profile with 6 buttons, which can either send to KEYS() or mightbeen even the controller commands).
Howover when im see this document (which seen quite easy to do):
http://www.raywenderlich.com/forums/viewtopic.php?f=21&t=10339
There is no way to make sure its only do the job when iOS 7 is detected? Glbasic should works from iOS 5.1 and up (the first iPad is still cool and using that).
But in the way, for glbasic Android, im have just added a much better game controller suppport recently, if you only do games with few buttons used, then its would works "out of the box". Otherwise if do want to uses near full profile, then just make a remap assign screen, and you go. Even iCade do im finally got working now for Android and remapping it before its sends to the KEY() command.
PS. Now im in this week went back to Balders. Sorry im diddent create more levels, but im simply just like the editor in that game (dispite few issues, its still works excellet).
-
I'm got mfi game controller to work and now play nice with glbasic. It's only possible to due I'm have the glbasic source code. I'm also created a game input api so I'm can use the same controller code on Android ios and Windows.
By now CatchOut works (dual stick game, but digital dpad and buttons can also been used) as well Karma Miwa. Button pressure is supported in CatchOut.
-
im have fighted recently with the interface orientation issue, which im cant fix it for IOS 8. Im got a post from this one:
http://www.glbasic.com/forum/index.php?topic=9971.msg91096#msg91096
after searing on net, im trying to do this:
void iPhoneSETORIENTATION(int orig) {
if(orig==0) {
[[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationPortrait];
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0")) {
}
}
if(orig==1) {
[[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeRight];
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0")) {
}
}
if(orig==2) {
[[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationPortraitUpsideDown];
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0")) {
}
}
if(orig==3) {
[[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeLeft];
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0")) {
[[UIDevice currentDevice] setValue:[NSNumber numberWithInteger:UIDeviceOrientationLandscapeRight] forKey:@"orientation"];
}
}
}
But when [[UIDevice currentDevice] setValue:[NSNumber numberWithInteger:UIDeviceOrientationLandscapeRight] forKey:@"orientation"]; is called, then touch controller view is lost focus (in iphoneeagleview.m). Im have no idea how to get the focus to work again.
-
im are going to collect the glbasic source code tree again and send the issue. after few days im giving up. Im simply just can get it right with the orintation crap. A area Android is much much easier to work with. iOS 8 seen crap on that area.
This one fells so strange.
its works on iPad 1, iPhone 6, but of course not on iPad 3 with iOS 8.2 :-P.
Im gonna to hate iOS now and with my next phone will defensivt been Android. iOS is just no longer fun.
-
We also have problems with rotation on winsol with ios8+
8.3 has some rotational fixes in it, not sure if that also relates to code level and fixes any of these issues.
-
generally rotation on iOS8 is very buggy and sometimes the keyboard dosent show correctly or crash. So iOS8 is much more buggy than iOS7 really.
There is some devs that stopped iPad dev due iOS8 strangeless. So not good for Apple.
-
Yes. iOS 8 has several bugs. And a lot of them are with rotation. Even with a web page sometimes you cannot tap on the links when in landscape and have to turn to portrait to do so. Not sure if 8.3 has fixed many of these problems as only just installed it the other day. Must try winsol and see if there are improvements now? Still. Even if there are it does not stop someone using 8.2 leaving bad feedback for your game when the onus lies with apple.
-
This is from the 8.3 update notes.
Orientation and rotation fixes
Addresses an issue that sometimes prevented rotating back to portrait after having rotated to landscape
Improves performance and stability issues that occurred when rotating the device between portrait and landscape
Fixes an issue where device orientation appeared upside down after pulling the iPhone 6 Plus from your pocket
Resolves an issue that sometimes prevented apps from rotating to correct orientation after switching apps in multitasking
(Sorry about syntax, just pasting with the iPhone)
-
Its should works when starting up, but wont try to do the rotations like the named issues above.
Im do finally got the orientation works and show correctly now.
But auto rotation on older 5.1 would no longer been supported, since its a bit too much different, but the game is still fully playable on iPad 1.
but when there is a system rotating, then the UIViewController in iphoneeaglview.m stops responding. This is a issue im dont know why and needs help.
-
im do still need help on the response issue, and cant fint anything that help on google at all.
Soon im add UIViewController to let the window rotate, then UIView touch inputs does not fired at all.
-
If you're losing input check the first responder code for your main UIView in your UIViewController.
Add the following code and then call [yourView setActive:YES]; to force it to accept input again.
- (void)setActive:(BOOL)value
{
m_active = value;
if (m_active)
{
[self becomeFirstResponder];
}
else
{
[self resignFirstResponder];
}
}
- (void)didEnterBackground
{
if (self.active)
[self resignFirstResponder];
}
- (void)didBecomeActive
{
if (self.active)
[self becomeFirstResponder];
}
- (BOOL)canBecomeFirstResponder
{
return YES;
}
-
im can still not get it correct. Here is the two files im have modificed (im remove the files when downloaded):
(files have been downloadaed 3 times, so im thinks you got the file, otherwise im pm it.
-
I'm hope I'm soon can fix this annoying so I'm can have great rotation support in y games. I'm did testede the code, but still issues and diddent work correctly.
However im can't do anything this or balder before next week, due upgrade issues and "burnt" both my CPUs. Damn. I'm now waiting for a new motherboard.
-
We still have rotation issues in WinSol that are yet to be solved. Apparently iOS 8.3 should fix some of these issues so I would just wait until it's released.
Rotation and Orientation fixes – A multitude of fixes are in iOS 8.3 for performance slowdowns related to app rotation and also orientation problems where devices fail to recognise which way they are being held or lock in one orientation.
-
Sorry about the confuction.
Its was more the focus issue, which seen was not fixed after inserted the code and calling it. There is something happens between UIViewController and UIView.
Im cant do anything more about rotation, which seens works correcrly in either landscape or portrait (but just not in both way, but that is much less important and something not need to look on at all). So nothing about this one, its just the damn focus issue.
checkout the project im gave you in pm as well the 4 changes files.
-
Sorry I could not get the input working on your app SF.
A couple of things I would suggest. Remove the threading code. Remove the message pump code. Use event driven code for iOS.
CFRunLoopRunInMode is bad. Use a timer or the recommended way CADisplayLink.
-
im now home, so im edit a abit:
This input thing is happens soon I'm added the uiviewcontroller view (iphoneviewcontroller.m), which was commented out in iphoneappcontroller.m. The mouse code is in iphoneeaglview.m. Then im tried the focus code, which seen diddent do anything at all (im even commented out the iCade, who does something similar, just in case). Mightbeen im still do something wrong with that. Im thinks that is the main issue with the input.
The touchesBegan is not called at all when im enable uiviewcontroller (which does the auto rotations), but do im disable the uiviewcontroller, then touches works. But then rotation is in wrong again (which need to been set in portrait mode allways, so its a easy fix, but ui like keyboard does no longer follow systembar).
This is currently the main issue why I'm need help here. Sorry for the confuction.
Also the main screen is not animated at all, but you can see the game loading in the start.
Im do can tryout comment out the thread thing and see what its happens. Im do remember im did got a black screen since (but im testing very soon).
-
im have commented out the thread.
im send you a new project with it and also demonstrate the issue.
if you use nrewrotation=1 (near top in iphoneappcontroller.m), then will try to uses iPhoneViewControllerWithRotation for the auto rotation. When im does that, then focus is lost. Im also thinks im might missing something to the responder code.
if im set it to nrewrotation=0, then the responder works fine in uiview.m (but rotation mightbeen 90 degree wrong, but dont worry about it at all here, im have just not set SETORIENTATION 1 which im normally need and set xcode to PORTRAIT mode).
Im thinks its still a responder issue.
im have no idea what CFRunLoopRunInMode and CADisplayLink does. Im do not thinks its a issue there at all?
its all about UIViewController, that take the responder as its not should do that. Rotation will works when this is fixed.
-
I understand what the problem is. I can't get input to work at all. No TouchesBegan event is ever fired. I also tried commenting out the iCade view. Nothing I tried work.
The thing is the way the app is designed is very different to a normal app. It is running the main loop in a custom thread and then calls the message pump manually. This is not the recommended way for a game loop on iOS. The recommended way is to use CADisplayLink.
I spent about an hour trying to fix it. Sorry I cannot help.
-
Look like UiViewController have been broken by Apple. Sad. So no smooth orientation like on Android, which works pretty nice.
So im revert to the old code without using UiViewController complelty and dedicated to giving up UiViewController. Its just dont work correctly.
But very thanks for the help.
The only thing im can do and hope works is something like this in iPhoneSETORIENTATION() and hopefullly Keyboard rotate and touch still works:
[[UIDevice currentDevice] setValue:[NSNumber numberWithInteger:UIDeviceOrientationLandscapeRight] forKey:@"orientation"];
-
im thinks im have found a workaround. Its actuelly very wierd and was not excepted.
im using this code:
int iPhoneSETORIENTATION(int orig) {
if(orig==-1) {
if (nrewrotation==0) return 0;
[gpimainView setActive:YES];
if (UIInterfaceOrientationLandscapeLeftSupported==YES || UIInterfaceOrientationLandscapeRightSupported==YES)
{ printf("islandscape, ");
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0"))
{ printf("0\n");
return 0;
}
printf("1\n");
return 1;
}
printf("0\n");
return 0;
}
if(orig==0) {
[[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationPortrait];
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0")) {
[[UIDevice currentDevice] setValue:[NSNumber numberWithInteger:UIInterfaceOrientationPortraitUpsideDown] forKey:@"orientation"];
printf("UIInterfaceOrientationPortraitUpsideDown\n");
}
}
if(orig==1) {
[[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeRight];
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0")) {
[[UIDevice currentDevice//] setValue:[NSNumber numberWithInteger:UIDeviceOrientationLandscapeLeft] forKey:@"orientation"];
printf("UIDeviceOrientationLandscapeLeft\n");
}
}
if(orig==2) {
[[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationPortraitUpsideDown];
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0")) {
[[UIDevice currentDevice] setValue:[NSNumber numberWithInteger:UIDeviceOrientationPortrait] forKey:@"orientation"];
printf("UIDeviceOrientationPortrait\n");
}
}
if(orig==3) {
[[UIApplication sharedApplication] setStatusBarOrientation:UIInterfaceOrientationLandscapeLeft];
if (SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0")) {
[[UIDevice currentDevice] setValue:[NSNumber numberWithInteger:UIDeviceOrientationLandscapeRight] forKey:@"orientation"];
printf("UIDeviceOrientationLandscapeRight\n");
}
}
return orig;
}
- When im doing the [[UIDevice currentDevice] line when GLB_IN_A_THREAD is defined, then the controller stops working after that line.
- But if im comment that define out, then its seens works.
wierd... So something with the costume thread does not working correctly. But that is something we cant do at all.
Also some commands send the pump command. This property due that way timers works in glbasic (here im mostly uses GETTIMERALL()) for gameplay timer).
PS. Here im do NOT using the UiViewController (im didicated to use a variable, so the smooth orientation can try fixed later one, but if above works, then its fine by now).
PPS. Again thanks for trying and for help.
-
Here is what im have tried to day:
Im tick "Portrait" mode in xXode only.
Then im can orientation the game correct and the systembar correctly too. BUT alert (just tested) is displayed wrong, which is still rotated in portrait:
(https://dl.dropboxusercontent.com/u/3236515/various/imhateios8_catchout1.PNG)
That seen its require to tick "Landscape Left" and Landscape Right" to get it working.
BUT...
when doing that, its look like this:
(https://dl.dropboxusercontent.com/u/3236515/various/imhateios8_catchout2.PNG)
damn, but in both cases touch input works nicely and there is no issues in first iPad.
If im adding the UiViewController, then the bounds seen to been fixed, but of course. There is a just another issue:
TouchBegan events newer respons.
So im didcated:
Apple have fucked Landscape mode pretty much very up and for some very odd reason nothing fellow the statusbar which its should really do. So im fell stupid and tired right now.
Im property not doing a another game for iOS currectly (while im havent started a new game in quite half year). But Android is currectly MUCH easier now and have not seen any issues like that after im fixed a similar orientation issue years back and was just called one java line to fix that. This one is much harder.
Im do more thinks something is totally wrong in this function (if its also possible to fix that one):
-(CGRect)boundsForOrientation{
UIScreen *screen = [UIScreen mainScreen];
CGRect screenRect;
if (![screen respondsToSelector:@selector(fixedCoordinateSpace)] && UIInterfaceOrientationIsLandscape([UIApplication sharedApplication].statusBarOrientation)) {
printf("boundsForOrientation 1 ok\n");
screenRect = CGRectMake(screen.bounds.origin.x, screen.bounds.origin.y, screen.bounds.size.height, screen.bounds.size.width);
} else {
printf("boundsForOrientation 2 ok\n");
screenRect = screen.bounds;
printf("x: %f", screen.bounds.origin.x);
printf(" y: %f", screen.bounds.origin.y);
printf(" w: %f", screen.bounds.size.width);
printf(" h: %f", screen.bounds.size.height);
printf("\n");
}
return screenRect;
}
-
I actually do rotation manually in WinSol. It works fine for the most part. It might help you as I have the centre issue sorted.
You may need to modify it slightly as WinSol for the iPad displays a special PopoverViewController (hence the weird values in "IS_IPAD() ? CGRectMake(0, 0, 480, screenSize.height - 56)")
This code goes into your UIView.
- (void)rotateView:(UIInterfaceOrientation) orientation
{
CGSize screenSize = [[UIScreen mainScreen] bounds].size;
//DEBUGLOG("UIRotateView width: %.f height: %.f", screenSize.width, screenSize.height);
if(SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0"))
{
if (screenSize.width > screenSize.height && UIInterfaceOrientationIsPortrait(orientation))
screenSize = CGSizeMake(screenSize.height, screenSize.width);
else if (screenSize.height > screenSize.width && UIInterfaceOrientationIsLandscape(orientation))
screenSize = CGSizeMake(screenSize.height, screenSize.width);
}
else
screenSize = UIInterfaceOrientationIsPortrait(orientation) ? CGSizeMake(screenSize.height, screenSize.width) : screenSize;
self.bounds = IS_IPAD() ? CGRectMake(0, 0, 480, screenSize.height - 56) : CGRectMake(0, 0, screenSize.width, screenSize.height);
self.center = CGPointMake(self.bounds.size.width / 2, self.bounds.size.height / 2);
//CGRect toolBarFrame = self.toolBar.frame;
//toolBarFrame.size.width = self.bounds.size.width;
//self.toolBar.frame = toolBarFrame;
;
DEBUGLOG("[%s] UIRotateView width: %.f height: %.f (%s)", [NSStringFromClass([self class]) UTF8String], screenSize.width, screenSize.height, UIInterfaceOrientationIsPortrait(orientation) ? "Portrait" : "Landscape");
#if AUTOROTATE_MODE == 0
self.center = CGPointMake(self.bounds.size.width / 2, self.bounds.size.height / 2);
self.transform = CGAffineTransformIdentity;
switch (orientation)
{
case UIInterfaceOrientationPortrait:
self.transform = CGAffineTransformMakeRotation(DEGREES_TO_RADIANS(0));
break;
case UIInterfaceOrientationLandscapeRight:
self.transform = CGAffineTransformMakeRotation(DEGREES_TO_RADIANS(90));
break;
case UIInterfaceOrientationPortraitUpsideDown:
self.transform = CGAffineTransformMakeRotation(DEGREES_TO_RADIANS(180));
break;
case UIInterfaceOrientationLandscapeLeft:
self.transform = CGAffineTransformMakeRotation(DEGREES_TO_RADIANS(-90));
break;
default:
break;
}
#endif
}
-
Pretty close really.
Here is what im now get when launch in landscape mode when uiinterface is landscape:
(https://dl.dropboxusercontent.com/u/3236515/various/imhateios8_catchout3.PNG)
here is the bounds code:
-(CGRect)boundsForOrientation{
int orientation=1; // not the correct way to do for enduser, but this is just a orintation test.
CGSize screenSize = [[UIScreen mainScreen] bounds].size;
//DEBUGLOG("UIRotateView width: %.f height: %.f", screenSize.width, screenSize.height);
if(SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0"))
{
if (screenSize.width > screenSize.height && UIInterfaceOrientationIsPortrait(orientation))
screenSize = CGSizeMake(screenSize.height, screenSize.width);
else if (screenSize.height > screenSize.width && UIInterfaceOrientationIsLandscape(orientation))
screenSize = CGSizeMake(screenSize.height, screenSize.width);
}
else
screenSize = UIInterfaceOrientationIsPortrait(orientation) ? CGSizeMake(screenSize.height, screenSize.width) : screenSize;
CGRect screenRect = CGRectMake(0, 0, screenSize.width, screenSize.height);
return screenRect;
}
its still not make any seance here?
-
You need to do more than set the size. Check my code again where it sets the center.
self.center = CGPointMake(self.bounds.size.width / 2, self.bounds.size.height / 2);
-
-(CGRect)boundsForOrientation is invoked in the startup, not on the orientation (which fells works with SETORIENTATION command).
yes im did see the self.center, but xcode diddent gave anything in UiApplication, so im trought its was a UiViewController thing (which im cant uses)?
Im do tryout that later today or tomorrow.
-
actuelly im got it partically works, but only on iPad 1 and iPad 3.
The window.center codes seen not allways required for some odd reason.
here the bounds code:
-(CGRect)boundsForOrientation{
int orientation=1;
// if (UIInterfaceOrientationLandscapeLeftSupported == YES) orientation=1;
// if (UIInterfaceOrientationLandscapeRightSupported == YES) orientation=3;
CGSize screenSize = [[UIScreen mainScreen] bounds].size;
//DEBUGLOG("UIRotateView width: %.f height: %.f", screenSize.width, screenSize.height);
if(SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0"))
{
if (screenSize.width > screenSize.height && UIInterfaceOrientationIsPortrait(orientation))
screenSize = CGSizeMake(screenSize.height, screenSize.width);
else if (screenSize.height > screenSize.width && UIInterfaceOrientationIsLandscape(orientation))
screenSize = CGSizeMake(screenSize.height, screenSize.width);
}
else
screenSize = UIInterfaceOrientationIsPortrait(orientation) ? CGSizeMake(screenSize.height, screenSize.width) : screenSize;
CGRect screenRect = CGRectMake(0, 0, screenSize.width, screenSize.height);
return screenRect;
}
Im uses this code now after have init the eagle frame:
if(SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0"))
{
if(UIInterfaceOrientationLandscapeLeftSupported == YES || UIInterfaceOrientationLandscapeRightSupported == YES)
{ int l=bounds.size.width-bounds.size.height;
window.center = CGPointMake(bounds.size.width/2, bounds.size.height/2+l);
}
}
But its works only on iPad 3 (and iPad 1 also works too). The code above also does not work on iPhone 6, which seen center the window allready correctly without the window.center code (just like iPad 1), hence its can been skipped. Im do property sure iPhone 6+ would behaive same as on iPad 3.
-
im send a new project, because im want to sure its works on all devices, but im pretty sure im 95% in goal.
Mostly the most thing fixing is only required to been done in boundsForOrientation() and in window.center code.
im thinks its might not work correctly for iPhone 5, which you have.
So this is more testing than fixing.
Dont think about the UIViewController at all. This will just breaks UIView completly. so dont waste time about that. This is best im can do.
PS. The alert box is just a orientation test, its will been removed again.
-
It doesn't work on my iPhone 5. You could try using rotation notifications for rotation like we do in Jungool. Since I don't know how you're dealing with rotation already I'll post the code.
BTW Are you rotating the actual screen in OpenGL? Make sure you are only rotating the UIView OR the model view matrix in OpenGL. Do not rotate both!
Attach a notification handler for rotation (your glView should be fine)
[[UIDevice currentDevice] beginGeneratingDeviceOrientationNotifications];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(detectRotation) name:UIDeviceOrientationDidChangeNotification object:nil];
put this code in your dealloc
[[UIDevice currentDevice] endGeneratingDeviceOrientationNotifications];
[[NSNotificationCenter defaultCenter] removeObserver:self name:UIDeviceOrientationDidChangeNotification object:nil];
This is the rotation handler
- (void)detectRotation
{
UIDeviceOrientation deviceOrientation = [[UIDevice currentDevice] orientation];
UIInterfaceOrientation interfaceOrienation;
//DEBUGLOG("EAGLView detectRotation - ORIENTATION %d", interfaceOrienation );
if(!UIDeviceOrientationIsValidInterfaceOrientation(deviceOrientation))
return;
switch(deviceOrientation)
{
case UIDeviceOrientationUnknown:
case UIDeviceOrientationFaceUp:
case UIDeviceOrientationFaceDown:
break;
case UIDeviceOrientationPortrait:
interfaceOrienation = UIInterfaceOrientationPortrait;
break;
case UIDeviceOrientationPortraitUpsideDown:
interfaceOrienation = UIInterfaceOrientationPortraitUpsideDown;
break;
case UIDeviceOrientationLandscapeRight:
interfaceOrienation = UIInterfaceOrientationLandscapeLeft;
break;
case UIDeviceOrientationLandscapeLeft:
interfaceOrienation = UIInterfaceOrientationLandscapeRight;
break;
}
[self rotateView:interfaceOrienation];
}
Notice at the end it calls my original "rotateView" method.
Also note to get the first "orientation" of the device when it starts
UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation];
Also to get the starting bounds before rotation you can use this
CGRect bounds = [UIScreen mainScreen].bounds;
-
Keep in mind you can also use OpenGL to handle rotation.
static inline void rotateScreen()
{
if(g_isOGLES2)
{
switch(g_displayScreen->Angle)
{
case ROTATION_NONE:
case ROTATION_0:
g_modelViewMatrix *= Matrix4D::RotateZ(0);
break;
case ROTATION_90:
g_modelViewMatrix *= Matrix4D::RotateZ(90);
break;
case ROTATION_180:
g_modelViewMatrix *= Matrix4D::RotateZ(180);
break;
case ROTATION_270:
g_modelViewMatrix *= Matrix4D::RotateZ(270);
break;
}
}
else
{
switch(g_displayScreen->Angle)
{
case ROTATION_NONE:
case ROTATION_0:
glRotatef(0, 0.0f, 0.0f, 1.0f);
break;
case ROTATION_90:
glRotatef(90, 0.0f, 0.0f, 1.0f);
break;
case ROTATION_180:
glRotatef(180, 0.0f, 0.0f, 1.0f);
break;
case ROTATION_270:
glRotatef(270, 0.0f, 0.0f, 1.0f);
break;
}
}
}
As I mentioned though only use one method. UIViewController OR rotating UIView manually as in previous post OR OpenGL rotation like above.
-
iOS8 landscape is still a mess!!!
Im cannot even set the windows bounds correct with just a red background screen without other content.
Here is the changed iPhoneappcontroller.m
-
im also just tried this one:
-(CGRect)boundsForOrientation{
CGSize screenSize = [[UIScreen mainScreen] bounds].size;
printf("**** Changed orientation: %d \n", interfaceOrienation);
if(SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0"))
{ CGRect bounds = CGRectMake(0, 0, screenSize.width, screenSize.height);
CGSize size;
screenSize = [UIScreen mainScreen].bounds.size;
if ((NSFoundationVersionNumber > NSFoundationVersionNumber_iOS_7_1) && UIInterfaceOrientationIsLandscape([UIApplication sharedApplication].statusBarOrientation)) {
size=CGSizeMake(screenSize.height, screenSize.width);
}
bounds = CGRectMake(0, 0, screenSize.height, screenSize.width);
return bounds;
}
else
{
screenSize = UIInterfaceOrientationIsPortrait(interfaceOrienation) ? CGSizeMake(screenSize.width, screenSize.height) : screenSize;
CGRect bounds = CGRectMake(0, 0, screenSize.width, screenSize.height);
return bounds;
}
}
But still issues on iPad 3 (X/Y Swapped), but seen works on iPhone 6 and iPad 1. So im newer undstand why its so complicered to get orientation correct in that one.
Ps. Thanks for the help even it's not in goal yet. When finally fixed with this most annoying issue I'm can give you something.
-
I think part of the difficulty is you're not using Interface Builder and doing everything programmatically.
I have a sneaky suspicion the issue is related to the auto sizing mask for your OpenGL UIView.
Please take a look at http://stackoverflow.com/questions/7754851/autoresizing-masks-programmatically-vs-interface-builder-xib-nib
Yes I have had so many problems dealing with rotation issues in iOS over the years. Just ask Flash lol. I believe at one point I actually said that one of the most challenging aspects of iOS development was dealing with rotation. I think that was a lot to do with the fact it kept changing how it worked over the years. Jungool and WinSol are no doubt doing it the wrong way which is most likely why there are so many problems with it in iOS 8. That coupled with the fact Apple have acknowledged rotation issues in iOS 8 it has been for the most part a giant PITA.
-
And is still not fixed in iOS8.3. Im fell its more more a bug now. Its pity when something happens on some devices.
Also as long im using portrait only set, then its actuelly works fine, but then alert boxes and other UIView does not like that. Its very pity they just can follow the systembar orientation. Im dont understand why Applie have broke that.
On Android in the other way, its works with no kind in those issues you see with iOS8.0 and im can even uses system rotation using AndroidManifest.xml, which is the correct way to do that on Android.
-
im thinks its confirmed its a totally nasty bug from Apple side :-(.
this is simply incredibly!
Its seen its just impossible to detect the app have been started from portrait mode.
when im holding it on portrait mode. Then its will insistate starting in landscape mode, not in portrait mode.
On iPad 3, this thing does correctly.
So im can only gonna see this as a bug.
-
What I've noticed is the UIWindow is not centered correctly for some reason. So no matter what you do with the UIView it will be wrong.
Does this help? http://stackoverflow.com/questions/26706050/custom-uiwindows-do-not-rotate-correctly-in-ios-8
-
the currect issue now is iPad 3 (8.3) does complete opposite than iPhone 6 (8.2) does which im dosent understand.
Now im update my iPhone to 8.3 (was 8.2, which could been the reason) and see that help.
If its does the job im will not do anything more about that. Im see.
But im do lost the emulator thing throught, which was why im diddent just update it.
-
Did not help. Iphone all ways start app in landscape mode and then soon after correct it to portrait.
But I'm need to do a way to detect the app did started I'm portrait mode, not in landscape mode.
Orientation does correctly on iPad, but not on iPhone.
I'm do thinks I'm might want to add the content thing after invoked SETORIENTATION -1, not on startup.
-
This is where I do it (note the various ways I've had to change rotation detection)
- (void)viewDidAppear:(BOOL)animated
{
//UIInterfaceOrientation orientation = [m_viewController interfaceOrientation];
//UIInterfaceOrientation orientation = [[UIDevice currentDevice] orientation];
UIInterfaceOrientation orientation = [[UIApplication sharedApplication] statusBarOrientation];
[self rotateView:orientation];
}
-
im go back to the UiViewController again, which im fell is the only right way to do.
Im for fun tried to move touchbegan calls to UiViewController rather than UiView. That seen its did called them there.
So its seen im need to move all mouse code to the UiViewController code instead.
Since im want to that, its because the orientation does correct on both devices and does not even need some special code. Doing its programming wice seens to been to much wrong and you can trust the values you might get.
-
its look like its hope now. Im dedicated im need to get the UiViewController to work, which seens does the orienation job nicely as im previous wrote.
Im tested some code, which seen all inputs goes fine to the UiViewController, but just do not want to work in UiView responder chain.
So much code in the UiView window hopefully can been moved to the UiViewController. If its can been possible (im tired now), then this most annoying issue would been fixed and the orintation would pretty much pair with glbasic Android (which works excellent in all 4 orientations).
Howover rotation on iPad 1 might not work anymore. But here.... Im dont care. Its a least still useable and playable, which is more important really.
This is the plan now. Im dedicated im cannot programmatic doing UiView orientation directly. Its will newer work.
-
great news. Im manged to uses the mouse code in UIViewController as well in UiView.
Im moved the iPhoneGetMouseData() to the main controller, so its could access both UiView and UiViewController and return either one to glbasic (the touchbegin code is used in both controllers, so its pick one of them up).
Correctly im do need to drop auto rotation support for iOS 5, but hopefully auto rotation do works correctly in iOS 6 and iOS 7 (which im cant test those versions). But its do a least works nicely on iOS 8 now at least.
now its very close to the Android counterpart which uses auto system rotation.
-
im got a report the issue is still not fully fixed in iOS7, but 100& fixed in iOS8. Howovere here its was mouse code that got rotated, which its should not do that. Im thinks im got it fixed, and also fixed iOS5 auto rotation too (just with no smooth rotation). Nice.
So im thinks glbasic begin to been excellent to iOS and Android, which have been main focus to fix various bugs and is now quite very stabile. So im property countinue to use it for my next game, im still not started with.
-
Now im stuck again with a very strange error when trying to port it to osTV, but can compile when using simulator, and allways worked for iOS.
in this function:
OSStatus glbOpenFile(const char *inFilePath, AudioFileID &outAFID)
{
CFURLRef theURL = CFURLCreateFromFileSystemRepresentation(kCFAllocatorDefault, (UInt8*)inFilePath, strlen(inFilePath), false);
if (theURL == NULL)
return kSoundEngineErrFileNotFound;
int kAudioFileReadPermission = 0x01;
OSStatus result = AudioFileOpenURL(theURL, kAudioFileReadPermission, 0, &outAFID);
CFRelease(theURL);
AssertNoError("Error opening file", end);
end:
return result;
}
The compile stuck with a red warning on AudioFileOpenURL and say its cannot convert int to AudioFilePermissions for 2nd argument.
-
Can you cast it?
OSStatus result = AudioFileOpenURL(theURL, (AudioFilePermissions)kAudioFileReadPermission, 0, &outAFID);
The enum is defined as
enum {
kAudioFileReadPermission = 0x01,
kAudioFileWritePermission = 0x02,
kAudioFileReadWritePermission = 0x03
};
-
all missing was to just add the missing header (AudioFile.h), and then using kAudioFileReadPermission directly, without creating it manually. Im wonder why its have not output that error before, and only on that platform.
Im have still not compiled for my Apple TV Dev Kit, but im thinks its pretty close now.
Currectly im compilng the libs.
Im will put on impressions in the Team forum, because its under NDA.
-
Finally im got its nearly working after various strange issues, and some issues im are not sure why its happens. Howover its now crash on startup in this error:
2015-09-19 12:44:59.145 greedymouse[218:28603] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', r
eason: 'Could not find a storyboard named 'Main' in bundle NSBundle </var/mobile/Containers/Bundle/Application/911FBB3D-4965-47EE-A5DF-93A7CF81DA6B/greedymouse.app> (loaded)'
*** First throw call stack:
(0x185bc0f50 0x196993f80 0x18b6a7264 0x18b23b8b8 0x18b008b24 0x18b23a7c8 0x18b237a60 0x18eba37ec 0x18eba3b6c 0x185b78598
0x185b7802c 0x185b75d2c 0x185aa4dd0 0x18b001d28 0x18affcc58 0x10012ddc0 0x10012f4ac 0x1971d6974)
libc++abi.dylib: terminating with uncaught exception of type NSException
(lldb)
What is a storyboard and how to check the name of it?
its happens when calling UIApplicationMain in main:
int GLB_iPhone_call_main(int argc, char *argv[])
{
gpArgv=argv;
gArgc=argc;
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
int retVal = UIApplicationMain(argc, argv, nil, @"AppController");
[pool release];
return retVal;
}
-
In your info.plist remove the "Main storyboard file base name" entry.
-
im just have time to check it now. Now im got it finally running :-D.
The info.plist was removed from the xcode project, but its was reading it anyway.
Howover the game is uncontrollable in that status, but its of course a different issue. But its display the game and graphics is correctly and seen its a 1080p 60fps as excepted (just like on Google Nexus Player). Now im can start for the fun part.
-
The fist game is now finished ported over to Apple TV. I'm do just need to fix few glbasic commands, such as MOUSESTATE and SETMOUSE for TVOS.
I'm have setup two xcode projects for iPhone target for glbasic, so I'm could compile once for both platforms. I'm just missing few thing.
PS. Jungool does not support extended gamepad correctly. Sometimes you can only navigate up/down with dpad and right/left with stick. I'm do believe Jungool nicely can been played with the remote as well. You can detect the A button behind trackball depend where your finger is....
-
Genius Greedy Mouse is finished ported to TVOS, and also Karma Miwa is now fully playable (also ran 1080p/60fps).
Im do need fixing few issues (iCloud and menu button). For Karma Miwa, the game is best playing with the remote in the vertical mode (the system detect that automatic when enabled).
For both games, the Top Shef image do need fixing as well.
-
Recently im have ran into a Unhandled memory crash with a "checksum for freed object - object was probably modified after being freed" in xCode and crash various points (sometimes its does works). Im not sure what kind error its is, but im guess its sometimes how strings is released that is the issue?
The source code is not mine, but got the project for testing (and the game is pretty much just started). Is sometimg you can look on? Etc Im can pm you the xCode project.
-
Can I'm got get a help on this issue? I'm have pm the xcode project. I'm are currently skiing, so not hurry, but thinks it's a one of the last glbasic issue.
-
Please take a look here (http://stackoverflow.com/questions/19840671/malloc-error-incorrect-checksum-for-freed-object-object-was-probably-mod)
To find the source of the problem, in Xcode go to Product > Scheme > Edit Scheme, and under Diagnostics tab enable all the Malloc settings and Guard Malloc.
With that, run your application again, and Xcode will stop at the line causing the problem.
-
I'm are currently skiing...
When are you coming home again?
-
just home yesterday, so im have not being much activatity. Im got a "skate" crash falling "behind", so its can been hard to sit in longer period. Howover im did completed all days skiing, and its was fun.
The internet connection there was quite bad and diddent work when im was in my room.
-
YES, long time ago. But its now seens im do need a little help again, which came to a new issue, regaards to multi taskning not working correctly (im using and update the app by using xCode 8.1).
First at all the app did crash in Swapbuffers() in EagleView controller, but im did do fixed that (so its dosent draw the framebuffer when its in pause mode).
But when im resume the app, then the Framebuffer is empty and its does no longer draw any content.
-
Also both Jungool and WinSol require a 64bit update:
http://www.macrumors.com/2016/10/06/ios-10-1-32-bit-app-alert/
both games got the warning and that is actuelly not great.
Im would like to see a 60fps camera update for Jungool (while rest can still been a 30fps game, its for more responitive controls etc).
-
You're more than welcome to take a look at my EAGLView C++ source.
Let me know if it helps.
We will be doing an update of Jungool and WinSol sometime.
-
Thanks. Im take a look. Apple like and want to remove 32bit only apps. Im now see the perforcements popup for both games. By know, just update with a 64bit version without any other changes.
-
I'm quite sure that both Jungool and WinSol on the App Store are compiled for 64-bit processors.
-
No, it's not. Not the AppStore version. iOS 5.1.1 is required to get combined 32/64 support. Both apps have iOS 4.3 as minimum.
Im got the warnings seen in the link (but both games does works fine and playable, im do missing the smooth rotation in Jungool).
Today iOS8 is required as minimum.
-
im gonna to hate it. IM tried last year as well with no luck. Im can STILL not get the annoying backbuffer to work when resume.
Now when im resume, the resolution is suddently 0x0, and im have no idea why backingwidth and backingheight fails. Howover im do still can use it, since im often just close the game when pausing (its save the game progress anyway and is fast to load it anyway). So no hurry at all.
EDIT:
Look like its a bug in HIBERNATE command....
-
im got fixed the HIBERNATE command, so its what there while in idle, and first resume when app opened again. That seens works now.
Im can now actuelly create the framebuffer in correct size after resume, but its does still not show anything (while the touch controller seens working).
Also im have removed old iOS stuff, since we are required iOS8 now.
-
Good to hear you got it fixed SF.
One of the many reasons I've moved to Unity. I'm sick and tired of Apple breaking my engine code every iOS update. There was a time when writing an optimised C++ engine to support slow machines like the iPhone 3G made sense but certainly not anymore. I never want to deal with Apple's constantly breaking and deprecating API's again.
-
Glbasic is a language, just like Unity. You can still get compatible issues etc. Im have even seen that happens with very big games, when iOSS8.4 came out.
Here the last issue im have is the annoying FrameBuffer issue, which still not want to shown after the resume. After that, im can release it to AppStore. Resolution is now correct, but no graphics is shown (but touch controller works).
HIBERNATE command was a different issue, but its was in the same area, a issues that goes much longer back (its might have broken again since the last update im got, since me and Gernot might not have sync 100% correctly). The app does no longer crash out and the command works now as intended.
Also Android can been stranger as well, but actuelly there have not been that much different, actuelly not since Android 2.3. There was few depreacted lines, but nothing special and all in the sld activity issues. The Inapp Shop system was that one that took much time, which got changed and required updates few times. But its did not break the game its self. Due game controller support etc, im chooice glbasic required Android 4.0 and up.
Yes today, we have much faster and better devices now to days.
-
Also both WinSol and Jungool still works fine on IOS10, even with the 64bit binary warning (you do only seen that once). So me thinks its only required to update to use xcode 8.1 (im asume you just forget to include 64bit to the AppStore version). So im dont thinks its all bad this time? Im not even sure engine need changes this time. The last update was from 2014.
Also the FrameBuffer issue is not a new iOS10 issue. Its goes quite much longer back. Property iOS8 or even more back.
PS. Im see Apple have changed GameCenter, which do no longer have its icon, but its not breaks both games.
-
FrameBuffer still borks, but today im do fixed a portrait issue (so glbasic no longer start in landscape mode, if portrait/upside down is set). Its was just a one line fix.
-
look like im finally fixed this issue. The issue was not really a framebuffer issue as im throught, but the command HIBERNATE did not resume correctly as its should and did not called GLB_RESUME sub at all. No im thinks im got fixed pretty much all issue except one.
Rotation from Landscape to Portrait and other way is still borked. But its a lesser issue. So im chose so, im either can let it play in landscape only, but could also chose to let it start in any orientation, but its will only turn 180 degree eventuelly from that orientation.
Im did also fixed touch issues in the way for iPhone Plus phones. That means im finally soon will update my games (Greedy Mouse is most important, due many new language supports).
For Jungool & WinSol:
Dont forget to reuploade to AppStore to get native 64bit support before iOS11 is released. As both games is 32bit only app, they will been completely incompatible with iOS11 devices. Me thinks, still, might only require a reupload. Im dont thinks none of them really require new features, other than a 64bit compatible update.
Both games do still works and 100% playable on iOS10, despite the slowdown warning, due 32bit only.
-
and that GameCentre is now broken of course.
-
Gamecenter is still in, but removed from the home screen. Im guess its can been issues when gamecenter has been integrated in iOS10 in the app its self, but the app its self have not been updated. So yes, its might require some fix here.
Finally, my myself did submitted one of the 4 im have (Greedy Mouse), which was quite old.