Skip to content

Commit

Permalink
Merge pull request #3230 from Ghabry/android
Browse files Browse the repository at this point in the history
Android: Add LZH support, refactor GameBrowser Game Searching
  • Loading branch information
fdelapena authored Aug 25, 2024
2 parents 68757ea + e6e8cc3 commit 382767f
Show file tree
Hide file tree
Showing 68 changed files with 1,965 additions and 1,161 deletions.
3 changes: 2 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -573,7 +573,6 @@ if(${PLAYER_TARGET_PLATFORM} STREQUAL "SDL2")
endif()

if(ANDROID)
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/builds/android/app/src/gamebrowser)
set(PLAYER_BUILD_EXECUTABLE OFF)
endif()

Expand Down Expand Up @@ -1347,6 +1346,7 @@ else() # library
endif()
elseif(ANDROID AND ${PLAYER_TARGET_PLATFORM} STREQUAL "SDL2")
add_library(easyrpg_android
src/platform/android/android.cpp
src/platform/android/android.h
src/platform/android/org_easyrpg_player_player_EasyRpgPlayerActivity.cpp
src/platform/android/org_easyrpg_player_player_EasyRpgPlayerActivity.h
Expand All @@ -1357,6 +1357,7 @@ else() # library
src/platform/sdl/main.cpp)
target_link_libraries(easyrpg_android ${PROJECT_NAME})
set_target_properties(easyrpg_android PROPERTIES DEBUG_POSTFIX "")
add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/builds/android/app/src/gamebrowser)
set(PLAYER_TEST_LIBRARIES "easyrpg_android")
else()
message(FATAL_ERROR "Unsupported library target platform ${PLAYER_TARGET_PLATFORM}")
Expand Down
11 changes: 5 additions & 6 deletions builds/android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
apply plugin: 'com.android.application'
android {
namespace "org.easyrpg.player"
compileSdkVersion 33
buildToolsVersion '33.0.0'
ndkVersion '21.4.7075529'
assetPacks = [":assets"]
defaultConfig {
applicationId "org.easyrpg.player"
compileSdk 34
minSdkVersion 21
targetSdkVersion 33
targetSdkVersion 34
versionName VERSION_NAME
versionCode Integer.parseInt(VERSION_CODE)
}
Expand Down Expand Up @@ -75,10 +74,10 @@ allprojects {
}

dependencies {
implementation 'androidx.appcompat:appcompat:1.6.0'
implementation 'com.google.android.material:material:1.8.0'
implementation 'androidx.appcompat:appcompat:1.7.0'
implementation 'com.google.android.material:material:1.12.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'androidx.recyclerview:recyclerview:1.3.2'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'androidx.documentfile:documentfile:1.0.1'
implementation 'org.ini4j:ini4j:0.5.4'
Expand Down
9 changes: 5 additions & 4 deletions builds/android/app/src/gamebrowser/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,13 @@ cmake_minimum_required(VERSION 3.7)
project(easyrpg_android VERSION 1.0 LANGUAGES CXX)

add_library(gamebrowser
org_easyrpg_player_game_browser_GameScanner.cpp
org_easyrpg_player_game_browser_GameScanner.h
org_easyrpg_player_game_browser.cpp
org_easyrpg_player_game_browser.h
)

find_package(PNG REQUIRED)
target_link_libraries(gamebrowser PNG::PNG)
set_target_properties(gamebrowser PROPERTIES DEBUG_POSTFIX "")

target_link_libraries(gamebrowser easyrpg_android)

if(BUILD_SHARED_LIBS)
set_property(TARGET gamebrowser PROPERTY POSITION_INDEPENDENT_CODE ON)
Expand Down
Loading

0 comments on commit 382767f

Please sign in to comment.