-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2356757
commit 06c69d3
Showing
18 changed files
with
200 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
78 changes: 27 additions & 51 deletions
78
platforms/android/project/app/src/main/cpp/CMakeLists.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,59 +1,35 @@ | ||
|
||
# For more information about using CMake with Android Studio, read the | ||
# documentation: https://d.android.com/studio/projects/add-native-code.html | ||
|
||
# Sets the minimum version of CMake required to build the native library. | ||
|
||
cmake_minimum_required(VERSION 3.16.0) | ||
project(reminecraftpe-android) | ||
|
||
# Project Root | ||
set(MC_ROOT ../../../../../../..) | ||
|
||
# Build | ||
add_compile_definitions(USE_NATIVE_ANDROID) | ||
add_library(reminecraftpe SHARED | ||
"${MC_ROOT}/platforms/android/android_native_app_glue.c" | ||
"${MC_ROOT}/platforms/android/AppPlatform_android.cpp" | ||
"${MC_ROOT}/platforms/android/main.cpp" | ||
"${MC_ROOT}/thirdparty/stb_image_impl.c" | ||
) | ||
|
||
# Core | ||
add_subdirectory("${MC_ROOT}/source" source) | ||
target_link_libraries(reminecraftpe reminecraftpe-core) | ||
|
||
# Declares and names the project. | ||
|
||
project("reminecraftpe") | ||
|
||
# The root of the project | ||
SET(MC_ROOT ../../../../../../..) | ||
|
||
# Creates and names a library, sets it as either STATIC | ||
# or SHARED, and provides the relative paths to its source code. | ||
# You can define multiple libraries, and CMake builds them for you. | ||
# Gradle automatically packages shared libraries with your APK. | ||
|
||
add_library( # Sets the name of the library. | ||
reminecraftpe | ||
|
||
# Sets the library as a shared library. | ||
SHARED | ||
|
||
# Provides a relative path to your source file(s). | ||
${MC_ROOT}/platforms/android/android_native_app_glue.c | ||
${MC_ROOT}/platforms/android/AppPlatform_android.cpp | ||
${MC_ROOT}/platforms/android/main.cpp | ||
${MC_ROOT}/thirdparty/stb_image_impl.c) | ||
# Extra Dependencies | ||
target_link_libraries(reminecraftpe android) | ||
|
||
# Check for the presence of some optional asset based features. | ||
if(NOT EXISTS "${MC_ROOT}/game/assets/gui/background/panorama_0.png") | ||
target_compile_definitions(reminecraftpe PUBLIC FEATURE_MENU_BACKGROUND) | ||
if(EXISTS "${MC_ROOT}/game/assets/gui/background/panorama_0.png") | ||
target_compile_definitions(reminecraftpe PUBLIC FEATURE_MENU_BACKGROUND) | ||
endif() | ||
|
||
if(NOT EXISTS "${MC_ROOT}/game/assets/environment/clouds.png") | ||
target_compile_definitions(reminecraftpe PUBLIC FEATURE_CLOUDS) | ||
if(EXISTS "${MC_ROOT}/game/assets/environment/clouds.png") | ||
target_compile_definitions(reminecraftpe PUBLIC FEATURE_CLOUDS) | ||
endif() | ||
|
||
if(NOT EXISTS "${MC_ROOT}/game/assets/misc/grasscolor.png") | ||
target_compile_definitions(reminecraftpe PUBLIC FEATURE_GRASS_COLOR) | ||
if(EXISTS "${MC_ROOT}/game/assets/misc/grasscolor.png") | ||
target_compile_definitions(reminecraftpe PUBLIC FEATURE_GRASS_COLOR) | ||
endif() | ||
|
||
if(NOT EXISTS "${MC_ROOT}/game/assets/misc/foliagecolor.png") | ||
target_compile_definitions(reminecraftpe PUBLIC FEATURE_FOLIAGE_COLOR) | ||
if(EXISTS "${MC_ROOT}/game/assets/misc/foliagecolor.png") | ||
target_compile_definitions(reminecraftpe PUBLIC FEATURE_FOLIAGE_COLOR) | ||
endif() | ||
|
||
# Add the core as part of the library. | ||
add_subdirectory(${MC_ROOT}/source source) | ||
target_link_libraries(reminecraftpe reminecraftpe-core) | ||
|
||
# Specifies libraries CMake should link to your target library. You | ||
# can link multiple libraries, such as libraries you define in this | ||
# build script, prebuilt third-party libraries, or system libraries. | ||
|
||
target_link_libraries( # Specifies the target library. | ||
reminecraftpe android ) |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
17 changes: 17 additions & 0 deletions
17
platforms/sdl/android/app/src/main/java/org/libsdl/app/LimitedSDLActivity.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
package org.libsdl.app; | ||
|
||
// Prevent SDL From Controlling Immersive Mode | ||
public class LimitedSDLActivity extends SDLActivity { | ||
@Override | ||
boolean sendCommand(int command, Object data) { | ||
if (command == COMMAND_CHANGE_WINDOW_STYLE) { | ||
return true; | ||
} else { | ||
return super.sendCommand(command, data); | ||
} | ||
} | ||
|
||
@Override | ||
public void onSystemUiVisibilityChange(int visibility) { | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.