Author Topic: OXCE v7.15 for iOS (iPhone/iPad)  (Read 33014 times)

Offline Yankes

  • Global Moderator
  • Commander
  • *****
  • Posts: 3350
    • View Profile
Re: OXCE v6.4 for iOS (iPhone/iPad)
« Reply #15 on: April 03, 2020, 08:47:34 pm »
Any other compiler? If I recall correctly main road block to compiler for iOS or OSX is having available SDK from APPLE, you already have it and switching compiler would be not hard (probably fresh clang would do the job).

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9099
    • View Profile
Re: OXCE v6.4 for iOS (iPhone/iPad)
« Reply #16 on: April 03, 2020, 08:52:51 pm »
You are right, my Xcode v 9.2 and does not support C ++17. ((((

If you can't upgrade XCode, you might want to try OpenXcomExtended v5.6.2 from August 2019... that was the last version still compatible with c++11.

This commit: https://github.com/MeridianOXC/openxcom-ios/commit/829c28b2a13adfefbf1527587bfbcbbe4f0b4815

Offline boozedog

  • Sergeant
  • **
  • Posts: 11
    • View Profile
Re: OXCE v6.4 for iOS (iPhone/iPad)
« Reply #17 on: April 14, 2020, 09:49:28 pm »
Just installed this on my iPad and it's working great! Question ... anybody know the touch gesture to get my soldier to face a certain way?

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9099
    • View Profile
Re: OXCE v6.4 for iOS (iPhone/iPad)
« Reply #18 on: April 14, 2020, 09:51:30 pm »
Just installed this on my iPad and it's working great! Question ... anybody know the touch gesture to get my soldier to face a certain way?

Tap and hold... at the spot the soldier should be looking at.

And thanks for the confirmation that it is actually working... I'm maintaining this branch practically blindly :)

Offline dresser

  • Sergeant
  • **
  • Posts: 15
    • View Profile
Re: OXCE v6.4 for iOS (iPhone/iPad)
« Reply #19 on: April 14, 2020, 10:32:51 pm »
Just installed this on my iPad and it's working great! Question ... anybody know the touch gesture to get my soldier to face a certain way?
or swipe to the side where the soldier should look , check these settings. 
Tap and hold... at the spot the soldier should be looking at.

And thanks for the confirmation that it is actually working... I'm maintaining this branch practically blindly :)
.Tap and hold also works.
« Last Edit: April 14, 2020, 10:35:22 pm by dresser »

Offline dresser

  • Sergeant
  • **
  • Posts: 15
    • View Profile
Re: OXCE v6.4 for iOS (iPhone/iPad)
« Reply #20 on: April 14, 2020, 10:49:23 pm »
If you can't upgrade XCode, you might want to try OpenXcomExtended v5.6.2 from August 2019... that was the last version still compatible with c++11.

This commit: https://github.com/MeridianOXC/openxcom-ios/commit/829c28b2a13adfefbf1527587bfbcbbe4f0b4815
.I cannot update Xcode, my mac does not support new operating systems. With OpenXcomExtended v5.6.2 from August 2019,  previous errors occur. Sorry for my bad English, because my native language is Russian. Anyway, thank you for trying to help.
« Last Edit: April 14, 2020, 11:00:38 pm by dresser »

Offline boozedog

  • Sergeant
  • **
  • Posts: 11
    • View Profile
Re: OXCE v6.4 for iOS (iPhone/iPad)
« Reply #21 on: April 15, 2020, 02:41:46 pm »
Tap and hold... at the spot the soldier should be looking at.

And thanks for the confirmation that it is actually working... I'm maintaining this branch practically blindly :)

Thanks for your work on this! Yes that did the trick!

Another question ... I am finding that the touch sensing is misaligned ... the touch is sensed to be lower than it actually is. Horizontal alignment is fine. I confirmed this by testing using Apple Pencil. Is there a way to fix this alignment myself?

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9099
    • View Profile
Re: OXCE v6.4 for iOS (iPhone/iPad)
« Reply #22 on: April 15, 2020, 03:57:07 pm »
I don't know.
I'm not really a mobile developer, this is beyond my current knowledge.

Unless it is a general alignment problem (I assume it isn't), then it's probably a bug in OXC/E code... you can try contacting sfalexrog on GitHub (https://github.com/sfalexrog), he has implemented this functionality, I'm just trying to keep it alive.

Offline Daedalia

  • Sergeant
  • **
  • Posts: 13
    • View Profile
OXCE v6.5.3 for iOS (iPhone/iPad)
« Reply #23 on: June 17, 2020, 04:57:49 pm »
I have never actually tried the app on a real device :/
Only on a simulator... where it works fine.

Thanks for the feedback though, it's nice to know it actually works.
One day I'll borrow an iOS device from someone and try it myself...

Out of curiosity, can you tell me what is the video resolution of your device; and what resolution do you see in OpenXcom when you go into Options>Video? For some reason, on the simulator, the resolution in game was only half of the real device resolution.
This is to do with how iOS handles HD displays I believe. They abstract away the true device resolution for compatibility of old software with new devices which are usually a factor of a base resolution. Started with the iPhone 4 which had twice the resolution of the 3. Old apps would then double up and appear blocky until the developer updated their app. I’m on an XS which has three times the resolution so my in game res is a third of what it could be.

Better description of it here:
https://developer.apple.com/library/archive/documentation/2DDrawing/Conceptual/DrawingPrintingiOS/GraphicsDrawingOverview/GraphicsDrawingOverview.html#//apple_ref/doc/uid/TP40010156-CH14-SW7

I’m hoping it is a simple property or method change somewhere in the code to fix, I’m not an iOS dev unfortunately and I’m not familiar with how SDL is integrated so it could be more work making a change that applies to only the iOS target and not Android too, you might know better. I’ll have a read up on SDL & Xcode when I get time, look at the code, see what I can figure out. I’ll reach out to sfalexrog too.

Offline Daedalia

  • Sergeant
  • **
  • Posts: 13
    • View Profile
Re: OXCE v6.5.3 for iOS (iPhone/iPad)
« Reply #24 on: June 23, 2020, 05:09:54 pm »
This is to do with how iOS handles HD displays I believe. They abstract away the true device resolution for compatibility of old software with new devices which are usually a factor of a base resolution. Started with the iPhone 4 which had twice the resolution of the 3. Old apps would then double up and appear blocky until the developer updated their app. I’m on an XS which has three times the resolution so my in game res is a third of what it could be.

Better description of it here:
https://developer.apple.com/library/archive/documentation/2DDrawing/Conceptual/DrawingPrintingiOS/GraphicsDrawingOverview/GraphicsDrawingOverview.html#//apple_ref/doc/uid/TP40010156-CH14-SW7

I’m hoping it is a simple property or method change somewhere in the code to fix, I’m not an iOS dev unfortunately and I’m not familiar with how SDL is integrated so it could be more work making a change that applies to only the iOS target and not Android too, you might know better. I’ll have a read up on SDL & Xcode when I get time, look at the code, see what I can figure out. I’ll reach out to sfalexrog too.

PR with fix created

Offline Meridian

  • Global Moderator
  • Commander
  • *****
  • Posts: 9099
    • View Profile
Re: OXCE v6.5.3 for iOS (iPhone/iPad)
« Reply #25 on: June 23, 2020, 11:34:53 pm »
PR with fix created

1/ Does not compile.
E.g. missing semicolon here:

Code: [Select]
  _flags = SDL_WINDOW_OPENGL | SDL_WINDOW_ALLOW_HIGHDPI

2/ is it safe to use SDL_GL_GetDrawableSize? what if we dont have GL at all? can that happen?

Edit: can maybe SDL_GetRendererOutputSize() be used instead of SDL_GL_GetDrawableSize() ? ... I read about it here: https://wiki.libsdl.org/SDL_CreateWindow

3/ not all instances of SDL_GetWindowSize were replaced by SDL_GL_GetDrawableSize... for example in SDLRenderer::screenshot() ... oversight or intention?
« Last Edit: June 23, 2020, 11:46:12 pm by Meridian »

Offline Daedalia

  • Sergeant
  • **
  • Posts: 13
    • View Profile
Re: OXCE v6.5.3 for iOS (iPhone/iPad)
« Reply #26 on: June 24, 2020, 03:26:04 am »
1/ Does not compile.
E.g. missing semicolon here:

Code: [Select]
  _flags = SDL_WINDOW_OPENGL | SDL_WINDOW_ALLOW_HIGHDPI

2/ is it safe to use SDL_GL_GetDrawableSize? what if we dont have GL at all? can that happen?

Edit: can maybe SDL_GetRendererOutputSize() be used instead of SDL_GL_GetDrawableSize() ? ... I read about it here: https://wiki.libsdl.org/SDL_CreateWindow

3/ not all instances of SDL_GetWindowSize were replaced by SDL_GL_GetDrawableSize... for example in SDLRenderer::screenshot() ... oversight or intention?
1 My Dev environment is a mess, did it off the Mac. Schoolboy error, corrected.

2 Historically fine, but having a read, seems OpenGL is deprecated in iOS.

Read the same, tried that method first but it requires an SDL_renderer not SDL_window argument, path of least resistance, hacky, I’m no iOS developer.

I think I can see how to implement SDL_GetRendererOutputSize. Need to sort my dev environment out first (can’t run the Simulator without the Mac rebooting) to get my head round and test properly.

3 Had trouble finding the F12 key on my phone. Feature seemed redundant on iOS. Let it be.


Sent from my iPhone using Tapatalk

Offline Kitos

  • Squaddie
  • *
  • Posts: 2
    • View Profile
Re: OXCE v6.5.3 for iOS (iPhone/iPad)
« Reply #27 on: August 14, 2020, 05:10:34 pm »
Finally installed it on my ipad mini 5th gen. Got a vertical alignment issue. I think it appears only in inventory screen. Fixed by disabling fullscreen inventory. Second issue is music. It plays too fast. Couldn`t figure out a solution.