-
Notifications
You must be signed in to change notification settings - Fork 162
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
iOS port fixes and Xcode project improvements #2259
iOS port fixes and Xcode project improvements #2259
Conversation
} | ||
|
||
void AGSIOS::Delay(int millis) { | ||
usleep(millis); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm pretty sure this was incorrect the whole time because usleep
accepts seconds and not milliseconds, so a conversion was needed. The SDL Implementation uses the best option for the platform and takes milliseconds as the input.
Remove Preprocessor macros from AGS game target (handled by framework)
…oject Upate ali3dogl and acpios xcode settings to indent to 2 spaces
537efe6
to
6018cca
Compare
This should be ready for review after speaking with @ericoporto and realizing there were a few changes that needed to be pulled in. Tested locally with a real AGS game to ensure that it builds and runs properly. Only tested the simulator build. |
Engine/platform/ios/acplios.cpp
Outdated
|
||
// Debug::Printf(kDbgMsg_Info, text); | ||
|
||
Debug::Printf(kDbgMsg_Warn, displbuf); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The safer form would be similar to one previously used with printf:
Debug::Printf(kDbgMsg_Warn, "%s", displbuf);
This is in case input contained formatting tokens.
Question: why does iOS port need the search for games? Is not it supposed to receive game location passed into cmd args similar to Android? |
Guess that is on me, it's true, this is a possibility, I think in Android I had a better understanding of Java and the system to wire-up the things that make that work - note you never set the name of the game manually in the Android single game project and it still manages to make it work! In iOS we have the world of ObjectiveC, the Xcode project and things like that, I didn't had a good enough understanding of it to figure a way to make it pass the internal path of the game without one have it hardcoded in acplios itself (like |
Pushed a couple of changes:
|
Pushed a couple of more changes after testing on device:
|
b6547d4
to
2e757a1
Compare
Could you please add a TODO comment somewhere around that code, explaining this case? |
I will write this in better details and add as a TO-DO in either the Readme or in acplios. |
Resolves #1505
This includes some changes in the iOS port to make it fully compatible with SDL and bring it up to par to where it was before, and added some minor improvements to the Xcode project.
iOS Port improvements
kEAGLColorFormatRGBA8
https://github.com/libsdl-org/SDL/blob/release-2.28.5/src/video/uikit/SDL_uikitopenglview.m#L98-L102
SDL_delay
Xcode improvements
Target splitting
The Xcode project now builds into three parts, which simplifies a lot of things:
![Captura de pantalla 2023-12-10 a la(s) 1 55 17 p m](https://private-user-images.githubusercontent.com/168664/289380665-f45235e5-1559-41d5-923c-853f0c89ec5c.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3Mzk2NTM0ODgsIm5iZiI6MTczOTY1MzE4OCwicGF0aCI6Ii8xNjg2NjQvMjg5MzgwNjY1LWY0NTIzNWU1LTE1NTktNDFkNS05MjNjLTg1M2YwYzg5ZWM1Yy5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjUwMjE1JTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI1MDIxNVQyMDU5NDhaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT1kNmRlNTVmYzQwOGUxMzBmMDNhOTkyMDQ0ZDRiNWU2YzRlMTYyNTc2MjBjYzVlNWRiNjc3NDgzMmU4YmJmM2IyJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCJ9.f4dcXLuGBQtEHAs6Cr1FPbGyG2zUT8b4ivM9Sq3cVho)
AGS_ThirdParty_iOS
builds all the external libraries from libsrc (excluding SDL) into a static library (.a) fileAGS_iOS
is an binary framework containing the Common, Engine, and PluginsAGS Game
is the actual aplication itself. It only builds the files added to the game and references the two libraries above and the SDL framework, and serves as an example setup for an Xcode projectThis change will developers porting to iOS to be able to export the AGS and SDL into their own Xcode project, instead of having to fork the whole source code per game.