Adjust for Android

This commit is contained in:
Vladislav Khorev 2018-07-14 14:10:13 +05:00
parent ae352e0590
commit 2c8440db52
8 changed files with 40 additions and 27 deletions

2
game/android_api.cpp Normal file → Executable file
View File

@ -4,7 +4,7 @@
JNIEXPORT void JNICALL Java_fishrungames_doublehitballs_JniWrapper_Init(JNIEnv * env, jobject obj, jint width, jint height)
{
JniInitApp<TAndroidApplication>(width, height, 480.f, 320.f);
JniInitApp<TMyApplication>(width, height, 480.f, 320.f);
}

View File

@ -12,7 +12,7 @@ cmake_minimum_required(VERSION 3.4.1)
add_definitions(-DTARGET_ANDROID)
set(BOOST_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../../boost_1_63_0)
set(BOOST_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../../boost_1_67_0)
set(BOOST_GIL_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../../libs/boost-gil-extension)
@ -23,9 +23,20 @@ set(LIBPNG_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../../libs/libpng_1.4.1_android)
set(LIBJPEG_PATH "${CMAKE_CURRENT_SOURCE_DIR}/../../../libs/jpeg-9")
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../engine)
set(EIGEN_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../../eigen)
set(SOL2_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../../sol2)
set(LUA_PATH ${CMAKE_CURRENT_SOURCE_DIR}/../../../libs/lua-5.3.4/src)
include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../../../tes-engine)
include_directories(${BOOST_PATH})
include_directories(${EIGEN_PATH})
include_directories(${SOL2_PATH})
include_directories(${LUA_PATH})
include_directories(${LIBPNG_PATH})
include_directories(${LIBJPEG_PATH})
include_directories(${ZIP_PATH})
@ -43,7 +54,7 @@ set_target_properties( # Specifies the target library.
PROPERTIES IMPORTED_LOCATION
# Provides the path to the library you want to import.
${CMAKE_CURRENT_SOURCE_DIR}/build/intermediates/exploded-aar/proj.android-studio/SalmonEngineAndroid/unspecified/jni/${ANDROID_ABI}/libengine.so )
${CMAKE_CURRENT_SOURCE_DIR}/../../../tes-engine/SalmonEngineAndroid/app/build/intermediates/cmake/debug/obj/${ANDROID_ABI}/libengine.so )
@ -60,6 +71,9 @@ add_library( # Sets the name of the library.
${CMAKE_CURRENT_SOURCE_DIR}/../../game/android_api.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../../game/main_code.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../../game/creditscode.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../../game/galaxy.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../../game/galaxy_menu.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../../game/galaxy_objects.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../../game/gamecode.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../../game/loadingcode.cpp
${CMAKE_CURRENT_SOURCE_DIR}/../../game/menucode.cpp

View File

@ -1,18 +1,18 @@
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "24.0.1"
compileSdkVersion 28
buildToolsVersion "28.0.0"
defaultConfig {
applicationId "fishrungames.DoubleHitBalls"
minSdkVersion 15
targetSdkVersion 24
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
externalNativeBuild {
cmake {
cppFlags "-std=c++11 -frtti -fexceptions -fsigned-char -Wno-c++11-narrowing"
cppFlags "-std=c++17 -frtti -fexceptions -fsigned-char -Wno-c++11-narrowing"
}
}
}
@ -35,12 +35,9 @@ android {
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:24.2.1'
testCompile 'junit:junit:4.12'
implementation fileTree(dir: 'libs', include: ['*.jar'])
compile project(':SalmonEngineAndroid')
implementation 'com.android.support:appcompat-v7:28+'
implementation project(':SalmonEngineAndroid')
}

1
proj.android-studio/app/src/main/AndroidManifest.xml Normal file → Executable file
View File

@ -35,5 +35,4 @@
</activity>
</application>
<uses-feature android:glEsVersion="0x00020000"/>
<uses-sdk android:minSdkVersion="8"/>
</manifest>

View File

@ -3,9 +3,11 @@
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.android.tools.build:gradle:3.2.0-alpha18'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
@ -15,6 +17,7 @@ buildscript {
allprojects {
repositories {
jcenter()
google()
}
}

View File

@ -1,6 +1,6 @@
#Mon Dec 28 10:00:20 PST 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.14.1-all.zip
#Sat Jul 14 10:38:38 YEKT 2018
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-4.6-all.zip

View File

@ -1,5 +1,5 @@
include ':SalmonEngineAndroid'
project(':SalmonEngineAndroid').projectDir =new File(settingsDir, '../../engine/SalmonEngineAndroid/app')
project(':SalmonEngineAndroid').projectDir =new File(settingsDir, '../../tes-engine/SalmonEngineAndroid/app')
include ':app'

View File

@ -22,7 +22,7 @@
<ProjectGuid>{1CC98EEE-BBCB-4D79-B6D7-8511789172C5}</ProjectGuid>
<Keyword>Win32Proj</Keyword>
<RootNamespace>DoubleHitBallswin</RootNamespace>
<WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformVersion>10.0.16299.0</WindowsTargetPlatformVersion>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
@ -151,7 +151,7 @@
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;TARGET_WIN32;_WIN32_WINNT=0x0501;WIN32_LEAN_AND_MEAN;EIGEN_DONT_ALIGN_STATICALLY;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>../../../../../boost_1_67_0/;../../../game;../../../../tes-engine;../../../../eigen;../../../../boost_1_67_0/;../../../../boost_1_67_0/bin.v2/libs/system/build/msvc-14.0/release/address-model-64/link-static/threading-multi;../../../../boost_1_67_0/bin.v2/libs/date_time/build/msvc-14.0/release/address-model-64/link-static/threading-multi/;../../../../boost_1_67_0/bin.v2/libs/regex/build/msvc-14.0/release/address-model-64/link-static/threading-multi;../../../../boost_1_67_0/bin.v2/libs/thread/build/msvc-14.0/release/address-model-64/link-static/threading-multi;../../../../boost_1_67_0/bin.v2/libs/chrono/build/msvc-14.0/release/address-model-64/link-static/threading-multi;../../../../boost_1_67_0/bin.v2/libs/signals/build/msvc-14.0/release/address-model-64/link-static/threading-multi;../../../../libs/boost-gil-extension;../../../../libs/jpeg-9;../../../../libs/jpeg-9/vc10;../../../../libs/lpng1510</AdditionalIncludeDirectories>
<AdditionalIncludeDirectories>../../../game;../../../../tes-engine;../../../../eigen;../../../../boost_1_67_0/;../../../../libs/boost-gil-extension;../../../../libs/jpeg-9;../../../../libs/jpeg-9/vc10;../../../../libs/lpng1510</AdditionalIncludeDirectories>
<DisableSpecificWarnings>4503</DisableSpecificWarnings>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
</ClCompile>
@ -160,7 +160,7 @@
<GenerateDebugInformation>true</GenerateDebugInformation>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
<OptimizeReferences>true</OptimizeReferences>
<AdditionalLibraryDirectories>../../../../boost_1_67_0/stage/lib;../../../../boost_1_67_0/stage/x64/lib;../../../game;../../../../tes-engine;../../../../../boost_1_67_0;../../../../eigen;../../../../boost_1_67_0/;../../../../libs/boost-gil-extension;../../../../libs/jpeg-9;../../../../libs/jpeg-9/vc10;../../../../libs/lpng1510;../x64/Release</AdditionalLibraryDirectories>
<AdditionalLibraryDirectories>../../../../boost_1_67_0/stage/lib;../../../../boost_1_67_0/stage/x64/lib;../../../game;../../../../tes-engine;../../../../eigen;../../../../libs/boost-gil-extension;../../../../libs/jpeg-9;../../../../libs/jpeg-9/vc10;../../../../libs/lpng1510;../x64/Release</AdditionalLibraryDirectories>
<AdditionalDependencies>libjpeg.lib;libpng.lib;Engine.lib;opengl32.lib;glu32.lib;kernel32.lib;user32.lib;gdi32.lib;winspool.lib;comdlg32.lib;advapi32.lib;shell32.lib;ole32.lib;oleaut32.lib;uuid.lib;odbc32.lib;odbccp32.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
</ItemDefinitionGroup>