Skip to content

Commit

Permalink
Merge pull request #152 from chrisws/12_25
Browse files Browse the repository at this point in the history
12 25
  • Loading branch information
chrisws authored Aug 21, 2022
2 parents 7634e03 + b4405dc commit f7db31b
Show file tree
Hide file tree
Showing 17 changed files with 1,458 additions and 270 deletions.
15 changes: 13 additions & 2 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -234,10 +234,14 @@ function buildSDL() {
}

function buildAndroid() {
TARGET="Building for Android."

defaultConditionals

AC_MSG_CHECKING([if library mode is enabled])
AC_ARG_WITH(library,
[ --with-library Build the android as a library default=no],
[with_library=$with_library],
[with_library=no])
AC_MSG_RESULT([$with_library])
AC_DEFINE(_UnixOS, 1, [Building under Unix like systems.])
AC_DEFINE(_ANDROID, 1, [Defined for Android build.])
AC_DEFINE(IMPL_DEV_READ, 1, [Implement dev_read()])
Expand All @@ -248,6 +252,13 @@ function buildAndroid() {

TEST_DIR="src/platform/android"
AC_SUBST(TEST_DIR)
if test $with_library = no; then
(cd src/platform/android/webui && npm run build)
TARGET="Building for Android."
else
TARGET="Building for Android library."
AC_DEFINE(_ANDROID_LIBRARY, 1, [android library build enabled])
fi
}

function buildConsole() {
Expand Down
18 changes: 18 additions & 0 deletions src/common/screen.c
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,18 @@ void osd_line(int x1, int y1, int x2, int y2);
//
void dev_rect(int x1, int y1, int x2, int y2, int fill) {
int c1, c2, in1, in2;

if (x2 < x1) {
int x11 = x1;
x1 = x2;
x2 = x11;
}
if (y2 < y1) {
int y11 = y1;
y1 = y2;
y2 = y11;
}

int px1 = x1;
int py1 = y1;
int px2 = x2;
Expand Down Expand Up @@ -409,6 +421,9 @@ void dev_window(int x1, int y1, int x2, int y2) {
}
}

//
// set screen width and height
//
void dev_resize(int width, int height) {
if (dev_Vx2 == dev_Vdx && dev_Vx2 == os_graf_mx - 1) {
// viewport width is full-screen
Expand All @@ -432,6 +447,9 @@ void dev_resize(int width, int height) {
setsysvar_int(SYSVAR_YMAX, height - 1);
}

//
// remap x/y to world coordinates
//
void dev_map_point(int *x, int *y) {
*x = W2X(*x);
*y = W2Y(*y);
Expand Down
7 changes: 6 additions & 1 deletion src/platform/android/Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,10 @@ ndk-build-release:
(cd jni && ${NDK}/ndk-build NDK_DEBUG=0)

release:
(./gradle assemble)
(./gradlew clean assemble)

library:
(./gradlew clean assemble)
(mkdir -p dist)
(cp -R app/build/intermediates/stripped_native_libs/release/out/lib/ dist)
(cp app/build/intermediates/dex/release/minifyReleaseWithR8/classes.dex dist)
2 changes: 1 addition & 1 deletion src/platform/android/app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ android {
targetSdkVersion 30
versionCode 50
versionName "12.23"
resConfigs "en"
resConfigs 'en'
}

signingConfigs {
Expand Down
2 changes: 1 addition & 1 deletion src/platform/android/app/src/main/assets/main.bas
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ sub do_about()
color colText
print "Version "; sbver
print
print "Copyright (c) 2002-2021 Chris Warren-Smith"
print "Copyright (c) 2002-2022 Chris Warren-Smith"
print "Copyright (c) 1999-2006 Nicholas Christopoulos" + chr(10)

local bn_home
Expand Down
Loading

0 comments on commit f7db31b

Please sign in to comment.