-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
Android #5611
Android #5611
Conversation
What you have done so far looks alright. |
src/openrct2/core/Console.cpp
Outdated
@@ -19,6 +19,7 @@ extern "C" | |||
#include "../platform/platform.h" | |||
} | |||
|
|||
#include <android/log.h> |
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.
What should we do with the console? Android doesn't have stdout/stderr. Just discard the changes and not have it in this PR?
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.
Having them go to android logs is nice in case we need to debug something. Looks like that already is the case, so why can't it stay as is?
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.
Because I replaced the stderr/stdout calls unconditionally.
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.
Revert but create an issue for it, so it can be done later on? At this point it's probably best to get this humongous thing in first, then improve stuff like this.
src/openrct2/platform/android.c
Outdated
@@ -0,0 +1,90 @@ | |||
#pragma region Copyright (c) 2014-2016 OpenRCT2 Developers |
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.
2017
src/openrct2-ui/Ui.cpp
Outdated
|
||
int SDL_main(int argc, char *argv[]) { | ||
return main(argc, argv); | ||
} |
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.
Is this needed for Android?
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.
Yes. SDL does some magic to rename the main function, but I had to disable that to get it to build as a static library iirc.
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.
Ah, I see. You will need to put the brace onto its own line, though.
@@ -195,6 +195,12 @@ uint8 platform_get_currency_value(const char *currCode) { | |||
return CURRENCY_POUNDS; | |||
} | |||
|
|||
#ifndef __ANDROID__ | |||
float platform_get_default_scale() { | |||
return 1; |
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.
Should this not be return 1.0f
?
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.
this is implicit in C
src/openrct2/ride/RideGroupManager.h
Outdated
@@ -38,6 +38,8 @@ typedef struct ride_group { | |||
#ifdef __cplusplus | |||
interface IRideGroupManager | |||
{ | |||
virtual ~IRideGroupManager() { } |
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.
This needs to go in develop.
I don't understand why appveyor is failing |
Guard your static_assert addition in common.h from Windows builds. |
CIs are green. @IntelOrca and @janisozaur can you go over this and see what needs to be changed still? |
I will take a look over the weekend. |
|
||
include(ExternalProject) | ||
ExternalProject_Add(libs | ||
URL https://github.com/marijnvdwerf/openrct2-dependencies-android/releases/download/v0.7/openrct2-libs-android-${ANDROID_ABI}.zip |
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.
Can you transfer ownership of this repo to OpenRCT2 organisation?
Can't you symlink src/openrct2-android/app/src/main/res/drawable-mdpi/logo_icon.png and src/openrct2-android/app/src/main/res/drawable-mdpi/logo_text.png and src/openrct2-android/app/src/main/res/mipmap-*/ic_launcher.png ? |
src/openrct2/platform/android.c
Outdated
//int mbtowc(wchar_t *__restrict pwc, const char *__restrict s, size_t n) { | ||
// static mbstate_t mbs; | ||
// size_t rval; | ||
// if (s == NULL) { |
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.
Remove this commented out part.
@janisozaur Does symlinking work for Windows as well? |
@marijnvdwerf Windows supports symlinks (called junctions). Not 100% sure if Git for Windows does, but that does seem likely to me. |
Unlikely as on Windows you need to have elevated privileges to create them. |
I can also just remove the images for now |
Could you copy them in the build script? Maybe have Gradle do it? |
You probably can, but I find it hard to understand Gradle scripting. Once this is in, it should be easier for Android developers to help out with that. |
I looked into how git handles symlinks on Windows and it's all a mess. I'm fine with the images staying as they are, due to this technical restriction. I'll resume reviewing later on. |
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 only thing that might require fixing that I found is using spaces instead of tabs
- Feature: [#1399 (partial), #5177] Add window that displays any missing/corrupt objects when loading a park - Feature: [#5056] Add cheat to own all land. - Feature: [#5133] Add option to display guest expenditure (as seen in RCTC). - Feature: [#5196] Add cheat to disable ride ageing. - Feature: [#5504] Group vehicles into ride groups - Feature: [#5576] Add a persistent 'display real names of guests' setting. - Feature: [#5611] Add support for Android - Feature: [#5706] Add support for OpenBSD - Feature: OpenRCT2 now starts up on the display it was last shown on. - Feature: Park entrance fee can now be set to amounts up to £200. - Improved: Construction rights can now be placed on park entrances. - Improved: Mouse can now be dragged to select scenery when saving track designs - Fix: [#259] Money making glitch involving swamps (original bug) - Fix: [#441] Construction rights over entrance path erased (original bug) - Fix: [#578] Ride ghosts show up in ride list during construction (original bug) - Fix: [#597] 'Finish 5 roller coasters' goal not properly checked (original bug) - Fix: [#667] Incorrect banner limit calculation (original bug) - Fix: [#739] Crocodile Ride (Log Flume) never allows more than five boats (original bug) - Fix: [#837] Can't move windows on title screen to where the toolbar would be (original bug) - Fix: [#1705] Time Twister's Medieval entrance has incorrect scrolling (original bug) - Fix: [#3178, #5456] Paths with non-ASCII characters not handled properly on macOS. - Fix: [#3346] Crash when extra long train breaks down at the back - Fix: [#3479] Building in pause mode creates too many floating numbers, crashing the game - Fix: [#3565] Multiplayer server crash - Fix: [#3681] Steel Twister rollercoaster always shows all track designs - Fix: [#3846, #5749] Crash when testing coaster with a diagonal lift in block brake mode - Fix: [#4054] Sorting rides by track type: Misleading research messages - Fix: [#4055] Sort rides by track type: Sorting rule is not really clear (inconsistent?) - Fix: [#4512] Invisible map edge tiles corrupted - Fix: [#5009] Ride rating calculations can overflow - Fix: [#5253] RCT1 park value conversion factor too high - Fix: [#5400] New Ride window does not focus properly on newly invented ride. - Fix: [#5489] Sprite index crash for car view on car ride. - Fix: [#5730] Unable to uncheck 'No money' in the Scenario Editor. - Fix: [#5750] Game freezes when ride queue linked list is corrupted. - Fix: [#5819] Vertical multi-dimension coaster tunnels drawn incorrectly - Fix: Non-invented vehicles can be used via track designs in select-by-track-type mode. - Fix: Track components added by OpenRCT2 are now usable in older scenarios. - Technical: [#5047] Add ride ratings tests - Technical: [#5458] Begin offering headless build with reduced compile- and run-time dependencies - Technical: [#5755] Title sequence wait periods use milliseconds - Technical: Fix many desync sources
@IntelOrca Can you go over everything that needs to be moved?