From f9b7a378e6f0957453a375183a7bffa8e8c32d5e Mon Sep 17 00:00:00 2001 From: a1batross Date: Tue, 29 Dec 2015 01:00:05 +0300 Subject: [PATCH] Enable yapb build --- android/jni/Application.mk | 2 +- .../xash3d/cs16client/LauncherActivity.java | 24 ++++++++++++++++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/android/jni/Application.mk b/android/jni/Application.mk index 9439b75..4b6cd3d 100644 --- a/android/jni/Application.mk +++ b/android/jni/Application.mk @@ -8,4 +8,4 @@ APPLICATIONMK_PATH = $(call my-dir) XASH3D_CONFIG := $(APPLICATIONMK_PATH)/bs_config.mk APP_ABI := x86 armeabi-v7a-hard armeabi -APP_MODULES := client menu server +APP_MODULES := client menu server yapb diff --git a/android/src/in/celest/xash3d/cs16client/LauncherActivity.java b/android/src/in/celest/xash3d/cs16client/LauncherActivity.java index e56c149..837a073 100644 --- a/android/src/in/celest/xash3d/cs16client/LauncherActivity.java +++ b/android/src/in/celest/xash3d/cs16client/LauncherActivity.java @@ -12,11 +12,15 @@ import android.widget.CompoundButton; import android.content.ComponentName; import android.content.pm.PackageManager; import android.content.SharedPreferences; +import android.util.Log; + +import java.io.File; import in.celest.xash3d.cs16client.R; public class LauncherActivity extends Activity { // public final static String ARGV = "in.celest.xash3d.MESSAGE"; + public final static String TAG = "LauncherActivity"; static EditText cmdArgs; static SharedPreferences mPref; @Override @@ -45,7 +49,25 @@ public class LauncherActivity extends Activity { if(!(enableCs16nd.isChecked())) argv = argv + " -dll censored"; - + else + { + String fullPath = getFilesDir().getAbsolutePath().replace("/files","/lib"); + File yapb_hardfp = new File( fullPath + "/libyapb_hardfp.so" ); + File yapb = new File( fullPath + "/libyapb.so" ); + if( yapb_hardfp.exists() && !yapb_hardfp.isDirectory() ) + { + argv = argv + " -dll " + yapb_hardfp.getAbsolutePath(); + } + else + { + Log.v(TAG, yapb_hardfp.getAbsolutePath() + "not found!"); + if( yapb.exists() && !yapb.isDirectory() ) + { + argv = argv + " -dll " + yapb.getAbsolutePath(); + } + else Log.v(TAG, yapb.getAbsolutePath() + "not found!"); + } + } if(cmdArgs.length() != 0) intent.putExtra("argv", argv); intent.putExtra("gamedir", "cstrike"); intent.putExtra("gamelibdir", getFilesDir().getAbsolutePath().replace("/files","/lib"));