Page 4 of 13

Re: Experimental iOS port (LÖVE 0.9.x)

Posted: Mon May 05, 2014 3:41 am
by slime
T-Bone wrote:Is love.filesystem still untested?
Reading files from the .love always worked. Writing files was broken, but I fixed it (as of a commit a few minutes ago.)

The save directory on iOS is Library/Application Support/identityname/, inside the app's sandbox folder.

Re: Experimental iOS port (LÖVE 0.9.x)

Posted: Mon May 05, 2014 1:31 pm
by Ivo
slime wrote:I'm not sure - I think this is up to SDL, but looking at its code for creating the keyboard on iOS it has this line: "textField.returnKeyType = UIReturnKeyDefault;" which shouldn't make it go away when pressing the return key.
So do I need to put that line in the LÖVE or SDL code somewhere?

Re: Experimental iOS port (LÖVE 0.9.x)

Posted: Tue May 06, 2014 10:17 pm
by slime
Ivo wrote:So do I need to put that line in the LÖVE or SDL code somewhere?
No, SDL's code already contains that line. I was confused because normally that should make the return button behave like you want, but I dug a little deeper into SDL's iOS code and found this:

Code: Select all

 /* Terminates the editing session */
- (BOOL)textFieldShouldReturn:(UITextField*)_textField
{
    SDL_SendKeyboardKey(SDL_PRESSED, SDL_SCANCODE_RETURN);
    SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_RETURN);
    SDL_StopTextInput();
    return YES;
}
Which is what's causing the text input dialog to always close when return is pressed. Since it's hardcoded into SDL's source, LÖVE can't override it in its own code (and there are situations where you'd want it to auto-close, too.)

Re: Experimental iOS port (LÖVE 0.9.x)

Posted: Wed May 07, 2014 12:18 am
by Ivo
slime wrote:
Ivo wrote:So do I need to put that line in the LÖVE or SDL code somewhere?
No, SDL's code already contains that line. I was confused because normally that should make the return button behave like you want, but I dug a little deeper into SDL's iOS code and found this:

Code: Select all

 /* Terminates the editing session */
- (BOOL)textFieldShouldReturn:(UITextField*)_textField
{
    SDL_SendKeyboardKey(SDL_PRESSED, SDL_SCANCODE_RETURN);
    SDL_SendKeyboardKey(SDL_RELEASED, SDL_SCANCODE_RETURN);
    SDL_StopTextInput();
    return YES;
}
Which is what's causing the text input dialog to always close when return is pressed. Since it's hardcoded into SDL's source, LÖVE can't override it in its own code (and there are situations where you'd want it to auto-close, too.)
If I change the last line

Code: Select all

return YES;
to

Code: Select all

return NO;
would it work like I want it to? Where can I find that line, do I need to download SDL for iOS and edit and compile it and put something in the love folder?

Re: Experimental iOS port (LÖVE 0.9.x)

Posted: Wed May 07, 2014 1:00 am
by slime
If you comment out the "SDL_StopTextInput();" line (line #303 in src/video/uikit/SDL_uikitview.m in SDL's current source) and recompile SDL for iOS it should work as you want, although I haven't tested it.

Re: Experimental iOS port (LÖVE 0.9.x)

Posted: Wed May 07, 2014 2:59 am
by Ivo
slime wrote:If you comment out the "SDL_StopTextInput();" line (line #303 in src/video/uikit/SDL_uikitview.m in SDL's current source) and recompile SDL for iOS it should work as you want, although I haven't tested it.
Thanks! I'll try it when I have the time

Re: Experimental iOS port (LÖVE 0.9.x)

Posted: Thu May 08, 2014 4:29 pm
by Ivo
It worked perfectly, thanks!

Re: Experimental iOS port (LÖVE 0.9.x)

Posted: Thu May 15, 2014 12:53 pm
by xpol
I got a bit lag when running the no game in the iOS Simulator.

The sprites move not as smooth as the PC version.

Re: Experimental iOS port (LÖVE 0.9.x)

Posted: Thu May 15, 2014 2:26 pm
by T-Bone
xpol wrote:I got a bit lag when running the no game in the iOS Simulator.

The sprites move not as smooth as the PC version.
That's probably because it's a simulator. The emulation of iOS hardware on a computer is (somewhat) computationally expensive so it would be strange if it didn't lag. And lag in an emulator does not necessarily mean it will lag on a real device.

Re: Experimental iOS port (LÖVE 0.9.x)

Posted: Thu May 15, 2014 2:35 pm
by slime
The iOS Simulator uses software rendering for OpenGL ES instead of taking advantage of the computer's GPU.
Even though the no-game screen is really simple and no problem for a real GPU, a software renderer will almost always be orders of magnitude slower than hardware rendering, plus the no-game screen involves a lot of blending which is particularly slow for a software renderer.