Skip to content
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

Adds the games manager/launcher #44

Open
wants to merge 26 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
37ed4bc
:fire: Removes test signing credentials
daniele-rapagnani Aug 20, 2020
880dde6
:bug: Adds customized app names for Marathon and Infinity
daniele-rapagnani Aug 20, 2020
065e2be
- :sparkles: Integrates support for automatically baking the assets f…
daniele-rapagnani Aug 23, 2020
3c5eb32
- :up_arrow: Updates SDL to the latest version
daniele-rapagnani May 16, 2021
a0eab5f
:adhesive_bandage: :construction_worker: Quick fix for the CI
daniele-rapagnani May 16, 2021
1ca5992
:construction_worker: Uninstalls CMake 18 in the CI
daniele-rapagnani May 18, 2021
b4f9223
Merge branch 'master' of github.com:daniele-rapagnani/alephone-androi…
daniele-rapagnani May 20, 2021
2e0e154
- :sparkles: Adds the ability to load scenarios by overriding the dat…
daniele-rapagnani May 19, 2021
d38c230
:bug: Fixes assets submodule path to absolute
daniele-rapagnani May 19, 2021
dafd672
:construction_worker: Fixes error with building SDL target in the CI
daniele-rapagnani May 21, 2021
023b9a3
- Adds some touch configuration, mainly regarding dead zones and sens…
daniele-rapagnani May 21, 2021
9a6f856
:memo: Updates README.md
daniele-rapagnani May 21, 2021
1f3af38
:construction: :sparkle: First working version of a launcher
daniele-rapagnani May 23, 2021
07d913e
- :sparkles: Adds a way to automatically download the most popular sc…
daniele-rapagnani May 25, 2021
b2c7e78
:sparkles: Adds importing back exported scenario data
daniele-rapagnani May 25, 2021
e7fa7a0
- :recycle: Refactors how the application handles files processing tasks
daniele-rapagnani May 28, 2021
0d89e7e
- :bento: :wrench: Removes the other app's flavors leaving only the a…
daniele-rapagnani May 28, 2021
eea8343
:construction: :sparkle: First working version of a launcher
daniele-rapagnani May 23, 2021
e827f2d
- :sparkles: Adds a way to automatically download the most popular sc…
daniele-rapagnani May 25, 2021
6cec469
:sparkles: Adds importing back exported scenario data
daniele-rapagnani May 25, 2021
e7bc997
- :recycle: Refactors how the application handles files processing tasks
daniele-rapagnani May 28, 2021
c5cd9e8
- :bento: :wrench: Removes the other app's flavors leaving only the a…
daniele-rapagnani May 28, 2021
6d89d99
Merge branch 'feature/launcher' of github.com:daniele-rapagnani/aleph…
daniele-rapagnani May 28, 2021
a3311e2
:construction_worker: Aligns the CI/CD with the current project struc…
daniele-rapagnani May 28, 2021
32c6d5d
:construction_worker: Fixes CI
daniele-rapagnani May 28, 2021
f0027fd
- :bug: :heavy_plus_sign: Adds ogg vorbis decoding, fixes issue #36
daniele-rapagnani May 30, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 7 additions & 45 deletions .github/workflows/android-cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,29 +45,11 @@ jobs:
- name: Build with Gradle
run: ./gradlew app:assembleRelease

- name: Sign Marathon 2 APKs
id: sign_marathon2
- name: Sign Aleph One APKs
id: sign_alephone
uses: r0adkll/sign-android-release@v1
with:
releaseDirectory: app/build/outputs/apk/marathon2/release
signingKeyBase64: ${{ secrets.SIGNING_KEY }}
alias: ${{ secrets.ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}
- name: Sign Marathon APKs
id: sign_marathon
uses: r0adkll/sign-android-release@v1
with:
releaseDirectory: app/build/outputs/apk/marathon/release
signingKeyBase64: ${{ secrets.SIGNING_KEY }}
alias: ${{ secrets.ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
keyPassword: ${{ secrets.KEY_PASSWORD }}
- name: Sign Marathon Infinity APKs
id: sign_marathon_inf
uses: r0adkll/sign-android-release@v1
with:
releaseDirectory: app/build/outputs/apk/marathonInfinity/release
releaseDirectory: app/build/outputs/apk/release
signingKeyBase64: ${{ secrets.SIGNING_KEY }}
alias: ${{ secrets.ALIAS }}
keyStorePassword: ${{ secrets.KEY_STORE_PASSWORD }}
Expand All @@ -85,33 +67,13 @@ jobs:
draft: true
prerelease: true

- name: Upload Marathon
id: upload-marathon
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ steps.sign_marathon.outputs.signedReleaseFile }}
asset_name: marathon-signed.apk
asset_content_type: application/vnd.android.package-archive
- name: Upload Marathon 2
id: upload-marathon2
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ steps.sign_marathon2.outputs.signedReleaseFile }}
asset_name: marathon2-signed.apk
asset_content_type: application/vnd.android.package-archive
- name: Upload Marathon Infinity
id: upload-marathonInf
- name: Upload Aleph One
id: upload_alephone
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }}
asset_path: ${{ steps.sign_marathon_inf.outputs.signedReleaseFile }}
asset_name: marathon-inf-signed.apk
asset_path: ${{ steps.sign_alephone.outputs.signedReleaseFile }}
asset_name: alephone-signed.apk
asset_content_type: application/vnd.android.package-archive
2 changes: 1 addition & 1 deletion .github/workflows/android.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ jobs:
- name: Uninstall CMake 3.18
run: echo "y" | sudo ${ANDROID_HOME}/tools/bin/sdkmanager --uninstall "cmake;3.18.1" --sdk_root=${ANDROID_SDK_ROOT}
- name: Build with Gradle
run: ./gradlew assembleMarathon2Release
run: ./gradlew app:assembleRelease
15 changes: 6 additions & 9 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,12 @@
[submodule "app/src/main/cpp/alephone"]
path = app/src/main/cpp/alephone
url = [email protected]:daniele-rapagnani/alephone.git
[submodule "app/src/marathon/assets"]
path = app/src/marathon/assets
url = [email protected]:Aleph-One-Marathon/data-marathon.git
[submodule "app/src/marathon2/assets"]
path = app/src/marathon2/assets
url = [email protected]:Aleph-One-Marathon/data-marathon-2.git
[submodule "app/src/marathonInfinity/assets"]
path = app/src/marathonInfinity/assets
url = https://github.com/Aleph-One-Marathon/data-marathon-infinity
[submodule "SDL2/src/main/cpp/SDL"]
path = SDL2/src/main/cpp/SDL
url = [email protected]:libsdl-org/SDL.git
[submodule "vorbis/src/main/cpp/vorbis"]
path = vorbis/src/main/cpp/vorbis
url = [email protected]:xiph/vorbis.git
[submodule "vorbis/src/main/cpp/ogg"]
path = vorbis/src/main/cpp/ogg
url = [email protected]:xiph/ogg.git
27 changes: 10 additions & 17 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@ android {
defaultConfig {
aaptOptions {
noCompress ''
ignoreAssetsPattern 'HD Monsters:HD Textures:HD Weapons:Enhanced HUD:TTEP v7'
}

applicationId "com.marathon.alephone"
minSdkVersion 21
minSdkVersion 26
targetSdkVersion 29
versionCode 1
versionName "1.0"
Expand All @@ -26,21 +25,6 @@ android {
}
}
}
flavorDimensions "games"
productFlavors {
marathon {
dimension "games"
applicationId = "com.alephone.marathon"
}
marathon2 {
dimension "games"
applicationId = "com.alephone.marathon2"
}
marathonInfinity {
dimension "games"
applicationId = "com.alephone.marathoninfinity"
}
}
buildTypes {
release {
minifyEnabled false
Expand Down Expand Up @@ -98,11 +82,20 @@ dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'commons-io:commons-io:2.6'
implementation 'com.google.android.material:material:1.1.0'

def room_version = "2.3.0"
implementation "androidx.room:room-runtime:$room_version"
annotationProcessor "androidx.room:room-compiler:$room_version"

implementation project(':SDL2')
implementation project(':SDL_image')
implementation project(':SDL_mixer')
implementation project(':SDL_ttf')
implementation project(':SDL_net')
implementation project(':vorbis')
implementation 'androidx.recyclerview:recyclerview:1.2.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
Expand Down
11 changes: 8 additions & 3 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,27 @@
android:supportsRtl="true"
android:theme="@style/AppTheme"
tools:replace="android:theme"
android:usesCleartextTraffic="true"
android:requestLegacyExternalStorage="true">

<activity
android:name="com.marathon.alephone.MainActivity"
android:name="com.marathon.alephone.ScenarioSelectorActivity"
android:label="@string/app_name"
android:alwaysRetainTaskState="true"
android:launchMode="singleInstance"
android:screenOrientation="landscape"
>
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<activity
android:name="com.marathon.alephone.AlephOneActivity"
android:screenOrientation="landscape"
>
</activity>

<activity
android:name="org.libsdl.app.SDLActivity"
tools:node="remove"
Expand All @@ -35,5 +41,4 @@
</application>

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
</manifest>
16 changes: 15 additions & 1 deletion app/src/main/cpp/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,19 @@ set_target_properties(

include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../../distribution/SDL_net/include)

include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../../distribution/SDL_net/include)

# Vorbis
add_library(vorbis SHARED IMPORTED)
set_target_properties(
vorbis PROPERTIES IMPORTED_LOCATION
${CMAKE_CURRENT_SOURCE_DIR}/../../../../distribution/vorbis/lib/${LIB_BUILD_TYPE_DIR}/${CMAKE_ANDROID_ARCH_ABI}/libvorbis.so
)

include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../../distribution/vorbis/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../../distribution/vorbis/include)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../../distribution/vorbis/include-built/${LIB_BUILD_TYPE_DIR}/${CMAKE_ANDROID_ARCH_ABI}/ogg/include)

# Boost
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/boost_1_70_0)

Expand All @@ -147,11 +160,12 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}/boost_1_70_0)
###

#add_compile_definitions(HAVE_OPENGL)
add_compile_definitions(HAVE_VORBISFILE)
add_compile_definitions(HAVE_UNISTD_H)
add_compile_definitions(HAVE_LUA)
add_compile_definitions(HAVE_MEMMOVE)
add_compile_definitions(HAVE_SDL_IMAGE)
add_compile_definitions(SDL)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/alephone)

target_link_libraries(main SDL SDL_image SDL_mixer SDL_net png jpeg webp webpdecoder FLAC modplug mpg123 ogg timidity SDL_ttf SDLmain hidapi z android)
target_link_libraries(main SDL SDL_image SDL_mixer SDL_net png jpeg webp webpdecoder FLAC modplug mpg123 ogg vorbis timidity SDL_ttf SDLmain hidapi z android)
Binary file added app/src/main/ic_launcher-playstore.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
59 changes: 59 additions & 0 deletions app/src/main/java/com/marathon/alephone/AlephOneActivity.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
package com.marathon.alephone;

import android.app.ActionBar;
import android.content.res.AssetManager;
import android.os.Bundle;
import android.os.Environment;
import android.view.View;

import org.libsdl.app.SDLActivity;

import java.io.File;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;
import java.nio.file.Path;

public class AlephOneActivity extends SDLActivity {
private AssetManager am = null;

public static native void setAssetManager(AssetManager mgr);
public static native void setScenarioPath(String path);

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);

View decorView = getWindow().getDecorView();
int uiOptions = View.SYSTEM_UI_FLAG_FULLSCREEN;
decorView.setSystemUiVisibility(uiOptions);

ActionBar actionBar = getActionBar();

if (actionBar != null) {
actionBar.hide();
}

this.am = getResources().getAssets();
setAssetManager(am);

Bundle b = getIntent().getExtras();

if (b != null && b.getString("scenarioPath") != null) {
setScenarioPath(b.getString("scenarioPath"));
}
}

@Override
protected String[] getLibraries() {
return new String[] {
"SDL2",
"SDL2_image",
"SDL2_mixer",
"SDL2_net",
"SDL2_ttf",
"main"
};
}
}
Loading