From 1e00d6617a216c36ba56294dbc7f44243a0232be Mon Sep 17 00:00:00 2001 From: krosk Date: Mon, 27 Sep 2021 14:35:10 +0200 Subject: [PATCH] Change: enable SDL2 with Android + adapt autodpi --- .github/workflows/nightly-android.yml | 2 +- sys/simsys_s2.cc | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/nightly-android.yml b/.github/workflows/nightly-android.yml index 4b9091866..d6b6cc908 100644 --- a/.github/workflows/nightly-android.yml +++ b/.github/workflows/nightly-android.yml @@ -74,7 +74,7 @@ jobs: - name: Checkout lib Android SDL by pelya (hard coded version) working-directory: /android-sdl run: | - git init && git remote add origin https://github.com/krosk/commandergenius.git && git fetch origin 453f07005df32bd74a99ab586f832d24fc37e193 && git reset --hard FETCH_HEAD + git init && git remote add origin https://github.com/krosk/commandergenius.git && git fetch origin e84e645ca309e56db84a211b484be7df6f3b03ca && git reset --hard FETCH_HEAD - name: Setup licenses for Gradle working-directory: /android-sdl diff --git a/sys/simsys_s2.cc b/sys/simsys_s2.cc index 89d1b6400..886ad639e 100644 --- a/sys/simsys_s2.cc +++ b/sys/simsys_s2.cc @@ -125,8 +125,11 @@ sint32 x_scale = SCALE_NEUTRAL_X; sint32 y_scale = SCALE_NEUTRAL_Y; // When using -autodpi, attempt to scale things on screen to this DPI value +#ifdef __ANDROID__ +#define TARGET_DPI (192) +#else #define TARGET_DPI (96) - +#endif // screen -> texture coords #define SCREEN_TO_TEX_X(x) (((x) * SCALE_NEUTRAL_X) / x_scale) -- 2.28.0.windows.1