Merge 'remove-sdl' branch into 'master'

This commit is contained in:
a1batross 2016-08-05 19:43:56 +06:00
commit 2916a1020e
41 changed files with 2341 additions and 421 deletions

20
.gitmodules vendored
View file

@ -1,21 +1,15 @@
[submodule "jni/src/HLSDK/halflife"]
path = jni/src/HLSDK/halflife
url = https://github.com/SDLash3D/halflife
[submodule "jni/src/NanoGL/nanogl"] [submodule "jni/src/NanoGL/nanogl"]
path = jni/src/NanoGL/nanogl path = jni/src/NanoGL/nanogl
url = https://github.com/SDLash3D/nanogl url = https://github.com/FWGS/nanogl
[submodule "jni/src/SDL2/SDL-mirror"]
path = jni/src/SDL2/SDL-mirror
url = https://github.com/mittorn/SDL-mirror
[submodule "jni/src/Xash3D/xash3d"] [submodule "jni/src/Xash3D/xash3d"]
path = jni/src/Xash3D/xash3d path = jni/src/Xash3D/xash3d
url = https://github.com/SDLash3D/xash3d url = https://github.com/FWGS/xash3d
[submodule "xash-extras"] [submodule "xash-extras"]
path = xash-extras path = xash-extras
url = https://github.com/SDLash3D/xash-extras url = https://github.com/FWGS/xash-extras
[submodule "jni/src/hlsdk-client"]
path = jni/src/hlsdk-client
url = https://github.com/SDLash3D/hlsdk-client
[submodule "jni/src/hlsdk-xash3d"] [submodule "jni/src/hlsdk-xash3d"]
path = jni/src/hlsdk-xash3d path = jni/src/hlsdk-xash3d
url = https://github.com/SDLash3D/hlsdk-xash3d url = https://github.com/FWGS/hlsdk-xash3d
[submodule "src/org/json"]
path = src/org/json
url = https://github.com/stleary/JSON-java

View file

@ -21,34 +21,25 @@ before_install:
script: script:
- sh gen-version.sh travis build - sh gen-version.sh travis build
- python2 makepak.py xash-extras assets/extras.pak - python2 makepak.py xash-extras assets/extras.pak
- ndk-build NDK_TOOLCHAIN_VERSION=4.8 XASH_SDL=1 SUPPORT_WEBP=false -j2 APP_CFLAGS="-w" APP_ABI="armeabi-v7a-hard" - ndk-build NDK_TOOLCHAIN_VERSION=4.8 SUPPORT_WEBP=false -j2 APP_CFLAGS="-w" APP_ABI="armeabi-v7a-hard"
- ant debug - ant debug
- cp bin/xashdroid-debug.apk xashdroid-armv7.apk - cp bin/xashdroid-debug.apk xashdroid-armv7.apk
- ndk-build NDK_TOOLCHAIN_VERSION=4.8 XASH_SDL=1 SUPPORT_WEBP=false -j2 APP_CFLAGS="-w" APP_ABI="armeabi" - ndk-build NDK_TOOLCHAIN_VERSION=4.8 SUPPORT_WEBP=false -j2 APP_CFLAGS="-w" APP_ABI="armeabi"
- ant debug - ant debug
- cp bin/xashdroid-debug.apk xashdroid-armv6.apk - cp bin/xashdroid-debug.apk xashdroid-armv6.apk
- ndk-build NDK_TOOLCHAIN_VERSION=4.8 XASH_SDL=1 SUPPORT_WEBP=false -j2 APP_CFLAGS="-w" APP_ABI="x86" - ndk-build NDK_TOOLCHAIN_VERSION=4.8 SUPPORT_WEBP=false -j2 APP_CFLAGS="-w" APP_ABI="x86"
- ant debug - ant debug
- cp bin/xashdroid-debug.apk xashdroid-x86.apk - cp bin/xashdroid-debug.apk xashdroid-x86.apk
- ndk-build NDK_TOOLCHAIN_VERSION=4.8 XASH_SDL=1 clean - ndk-build NDK_TOOLCHAIN_VERSION=4.8 clean
- ndk-build NDK_TOOLCHAIN_VERSION=4.8 XASH_SDL=1 -j2 APP_CFLAGS="-w" APP_ABI="armeabi-v7a-hard" CFLAGS_OPT_ARM="-mthumb -mfpu=vfpv3-d16 -mcpu=cortex-a9 -pipe -fPIC" - ndk-build NDK_TOOLCHAIN_VERSION=4.8 -j2 APP_CFLAGS="-w" APP_ABI="armeabi-v7a-hard" CFLAGS_OPT_ARM="-mthumb -mfpu=vfpv3-d16 -mcpu=cortex-a9 -pipe -fPIC"
- ant debug - ant debug
- cp bin/xashdroid-debug.apk xashdroid-armv7-tegra2.apk - cp bin/xashdroid-debug.apk xashdroid-armv7-tegra2.apk
- ndk-build NDK_TOOLCHAIN_VERSION=4.8 XASH_SDL=1 clean - ndk-build NDK_TOOLCHAIN_VERSION=4.8 clean
- ndk-build NDK_TOOLCHAIN_VERSION=4.8 XASH_SDL=1 -j2 APP_CFLAGS="-w" APP_ABI="armeabi" CFLAGS_OPT_ARMv5="-marm -march=armv5te -msoft-float -fPIC" - ndk-build NDK_TOOLCHAIN_VERSION=4.8 -j2 APP_CFLAGS="-w" APP_ABI="armeabi" CFLAGS_OPT_ARMv5="-marm -march=armv5te -msoft-float -fPIC"
- ant debug - ant debug
- cp bin/xashdroid-debug.apk xashdroid-armv5.apk - cp bin/xashdroid-debug.apk xashdroid-armv5.apk
after_script: after_script:
- curl --upload-file xashdroid-armv7.apk https://transfer.sh/xash3d-armv7-`date -u +%y-%m-%d_%H-%M`.apk - bash scripts/travis-upload.sh
- curl --upload-file xashdroid-armv6.apk https://transfer.sh/xash3d-armv6-`date -u +%y-%m-%d_%H-%M`.apk
- curl --upload-file xashdroid-x86.apk https://transfer.sh/xash3d-x86-`date -u +%y-%m-%d_%H-%M`.apk
- curl --upload-file xashdroid-armv7-tegra2.apk https://transfer.sh/xash3d-armv7-tegra2-`date -u +%y-%m-%d_%H-%M`.apk
- curl --upload-file xashdroid-armv5.apk https://transfer.sh/xash3d-armv5-`date -u +%y-%m-%d_%H-%M`.apk
- curl -T xashdroid-armv7.apk -u $YADISK_USERNAME:$YADISK_PASSWORD https://webdav.yandex.ru/XashTestVersions/xashdroid-armv7-`date -u +%y-%m-%d_%H-%M`-`git rev-parse --short HEAD`.apk
- curl -T xashdroid-armv6.apk -u $YADISK_USERNAME:$YADISK_PASSWORD https://webdav.yandex.ru/XashTestVersions/xashdroid-armv6-`date -u +%y-%m-%d_%H-%M`-`git rev-parse --short HEAD`.apk
- curl -T xashdroid-x86.apk -u $YADISK_USERNAME:$YADISK_PASSWORD https://webdav.yandex.ru/XashTestVersions/xashdroid-x86-`date -u +%y-%m-%d_%H-%M`-`git rev-parse --short HEAD`.apk
- curl -T xashdroid-armv7-tegra2.apk -u $YADISK_USERNAME:$YADISK_PASSWORD https://webdav.yandex.ru/XashTestVersions/xashdroid-armv7-tegra2-`date -u +%y-%m-%d_%H-%M`-`git rev-parse --short HEAD`.apk
- curl -T xashdroid-armv5.apk -u $YADISK_USERNAME:$YADISK_PASSWORD https://webdav.yandex.ru/XashTestVersions/xashdroid-armv5-`date -u +%y-%m-%d_%H-%M`-`git rev-parse --short HEAD`.apk

View file

@ -5,7 +5,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="in.celest.xash3d.hl" package="in.celest.xash3d.hl"
android:versionCode="0" android:versionCode="0"
android:versionName="0.17.1" android:versionName="0.18"
android:installLocation="auto"> android:installLocation="auto">
<application android:label="@string/app_name" <application android:label="@string/app_name"
@ -52,7 +52,7 @@
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
</intent-filter> </intent-filter>
</activity> </activity>
<!--
<activity android:name="org.libsdl.app.SDLActivity" <activity android:name="org.libsdl.app.SDLActivity"
android:screenOrientation="sensorLandscape" android:screenOrientation="sensorLandscape"
android:configChanges="orientation|screenSize" android:configChanges="orientation|screenSize"
@ -63,12 +63,17 @@
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
</intent-filter> </intent-filter>
</activity> </activity>
-->
<activity android:name="in.celest.xash3d.XashActivity" <activity android:name="in.celest.xash3d.XashActivity"
android:screenOrientation="landscape" android:screenOrientation="sensorLandscape"
android:configChanges="orientation|screenSize"
android:label="@string/app_name"> android:label="@string/app_name">
<intent-filter>
<action android:name="in.celest.xash3d.START" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity> </activity>
<activity android:name="in.celest.xash3d.FPicker"></activity>
<receiver android:name="in.celest.xash3d.InstallReceiver"> <receiver android:name="in.celest.xash3d.InstallReceiver">
<intent-filter android:priority="100"> <intent-filter android:priority="100">
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
@ -86,7 +91,7 @@
</application> </application>
<!-- Some devices with Android 2.2 should support native activity, it was in unstable hidden API --> <!-- Some devices with Android 2.2 should support native activity, it was in unstable hidden API -->
<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="13" /> <uses-sdk android:minSdkVersion="3" android:targetSdkVersion="19" />
<!-- OpenGL ES 1.1 --> <!-- OpenGL ES 1.1 -->
<uses-feature android:glEsVersion="0x00010000" /> <uses-feature android:glEsVersion="0x00010000" />

View file

@ -8,7 +8,7 @@ sh gen-version.sh test build
rm assets/extras.pak rm assets/extras.pak
python2.7 makepak.py xash-extras assets/extras.pak python2.7 makepak.py xash-extras assets/extras.pak
$AAPT package -m -J gen/ --rename-manifest-package in.celest.xash3d.hl -M AndroidManifest.xml -S test/res -I $ANDROID_JAR $AAPT package -m -J gen/ --rename-manifest-package in.celest.xash3d.hl -M AndroidManifest.xml -S test/res -I $ANDROID_JAR
$JAVA_HOME/bin/javac -d bin/classes -s bin/classes -cp $ANDROID_JAR src/org/libsdl/app/SDLActivity.java gen/in/celest/xash3d/hl/R.java src/in/celest/xash3d/* $JAVA_HOME/bin/javac -d bin/classes -s bin/classes -cp $ANDROID_JAR gen/in/celest/xash3d/hl/R.java src/in/celest/xash3d/*.java
$DX --dex --output=bin/classes.dex bin/classes/ $DX --dex --output=bin/classes.dex bin/classes/
/mnt/app/apktool/aapt package -f -M test/AndroidManifest.xml -S test/res -I $ANDROID_JAR -F bin/xash3d.apk.unaligned /mnt/app/apktool/aapt package -f -M test/AndroidManifest.xml -S test/res -I $ANDROID_JAR -F bin/xash3d.apk.unaligned
zip bin/xash3d.apk.unaligned assets/* zip bin/xash3d.apk.unaligned assets/*

View file

@ -1,10 +1,10 @@
#!/bin/sh #!/bin/sh
ndk-build NDK_TOOLCHAIN_VERSION=4.8 NDK_DEBUG=0 V=0 XASH_SDL=1 -j 8 APP_CFLAGS="-w -Wl,--no-undefined" APP_LDFLAGS="-Wl,--no-undefined" ndk-build NDK_TOOLCHAIN_VERSION=4.8 NDK_DEBUG=0 V=0 XASH_SDL=0 -j 8 APP_CFLAGS="-w -Wl,--no-undefined" APP_LDFLAGS="-Wl,--no-undefined"
sh gen-version.sh default-release sh gen-version.sh default-release
rm assets/extras.pak 2>/dev/null rm assets/extras.pak 2>/dev/null
python2 makepak.py xash-extras assets/extras.pak python2 makepak.py xash-extras assets/extras.pak
ant release ant release
jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore ../myks.keystore bin/xashdroid-release-unsigned.apk xashdroid jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore ../myks.keystore bin/xashdroid-release-unsigned.apk xashdroid
rm bin/xashdroid-release.apk rm bin/xashdroid-release.apk
/home/a1ba/.android/android-sdk-linux/build-tools/22.0.1/zipalign 4 bin/xashdroid-release-unsigned.apk bin/xashdroid-release.apk #/home/a1ba/.android/android-sdk-linux/build-tools/22.0.1/zipalign 4 bin/xashdroid-release-unsigned.apk bin/xashdroid-release.apk

View file

@ -3,19 +3,19 @@
# See CPLUSPLUS-SUPPORT.html in the NDK documentation for more information # See CPLUSPLUS-SUPPORT.html in the NDK documentation for more information
#APP_STL := stlport_static #APP_STL := stlport_static
XASH_SDL ?= 1 XASH_SDL ?= 0
ifeq ($(XASH_SDL),1) ifeq ($(XASH_SDL),1)
APP_PLATFORM := android-12 APP_PLATFORM := android-12
else else
APP_PLATFORM := android-8 APP_PLATFORM := android-9
endif endif
CFLAGS_OPT := -O3 -fomit-frame-pointer -ggdb -funsafe-math-optimizations -ftree-vectorize -fgraphite-identity -floop-interchange -funsafe-loop-optimizations -finline-limit=1024 CFLAGS_OPT := -O3 -fomit-frame-pointer -ggdb -funsafe-math-optimizations -ftree-vectorize -fgraphite-identity -floop-interchange -funsafe-loop-optimizations -finline-limit=256 -pipe
CFLAGS_OPT_ARM := -mthumb -mfpu=neon -mcpu=cortex-a9 -pipe -mvectorize-with-neon-quad -DVECTORIZE_SINCOS -fPIC CFLAGS_OPT_ARM := -mthumb -mfpu=neon -mcpu=cortex-a9 -pipe -mvectorize-with-neon-quad -DVECTORIZE_SINCOS -fPIC -DHAVE_EFFICIENT_UNALIGNED_ACCESS
CFLAGS_OPT_ARMv5 :=-march=armv6 -mfpu=vfp -marm -pipe #CFLAGS_OPT_ARMv5 :=-mcpu=arm1136jf-s -mtune=arm1136jf-s -mthumb -mfpu=vfp -pipe -mfloat-abi=softfp
CFLAGS_OPT_X86 := -mtune=atom -march=atom -mssse3 -mfpmath=sse -funroll-loops -pipe -DVECTORIZE_SINCOS CFLAGS_OPT_ARMv5 := -march=armv5te -mthumb -msoft-float
CFLAGS_OPT_X86 := -mtune=atom -march=atom -mssse3 -mfpmath=sse -funroll-loops -pipe -DVECTORIZE_SINCOS -DHAVE_EFFICIENT_UNALIGNED_ACCESS
CFLAGS_HARDFP := -D_NDK_MATH_NO_SOFTFP=1 -mhard-float -mfloat-abi=hard -DLOAD_HARDFP -DSOFTFP_LINK CFLAGS_HARDFP := -D_NDK_MATH_NO_SOFTFP=1 -mhard-float -mfloat-abi=hard -DLOAD_HARDFP -DSOFTFP_LINK
APPLICATIONMK_PATH = $(call my-dir) APPLICATIONMK_PATH = $(call my-dir)

@ -1 +1 @@
Subproject commit 51ccb8dbf05b56a5d01091ed7c5d3ec144d1d5d4 Subproject commit fba28cfff8c488b83b052b92a9f58678c90f2afe

@ -1 +0,0 @@
Subproject commit 1f0b6ddc873a99f1bec8a4556c86bd7b6d5a85e3

1
jni/src/SDL2/SDL-mirror Normal file
View file

@ -0,0 +1 @@
Place here SDL2 source code, if you want build SDL2 version of Xash3D Android. Note that this is neither maintained nor supported officially anymore.

@ -1 +1 @@
Subproject commit 0bfac664a3de49044356a17515cdf8a17f5e2817 Subproject commit a114800ce16bbde98d083c0b63e8782d6bbbfa2f

@ -1 +1 @@
Subproject commit 5d96c43c65f4e26dbcbbcaffeb265a6353a245b4 Subproject commit 29f4c35e6e6433fb990526683b70f809605e7025

View file

@ -11,4 +11,4 @@
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt #proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
# Project target. # Project target.
target=android-13 target=android-19

BIN
res/drawable/folder.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

View file

@ -0,0 +1,26 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingBottom="@dimen/activity_vertical_margin"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:paddingTop="@dimen/activity_vertical_margin"
tools:context="in.celest.xash3dVR.FPicker"
android:orientation="vertical">
<ListView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:id="@+id/FileView"
android:layout_weight="1"/>
<Button
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:text="@string/folder"
android:id="@+id/button_fpicker_select"
android:layout_centerHorizontal="true"
android:onClick="onFileClick" />
</LinearLayout>

View file

@ -1,95 +1,305 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<LinearLayout <LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android" xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools" xmlns:tools="http://schemas.android.com/tools"
android:id="@+id/layout_shortcut"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:paddingLeft="@dimen/activity_horizontal_margin"
android:paddingRight="@dimen/activity_horizontal_margin"
android:orientation="vertical" android:orientation="vertical"
tools:context="in.celest.xash3d.LauncherActivity" android:background="#252525"
android:id="@+id/layout_shortcut"> android:weightSum="1"
<ScrollView xmlns:android="http://schemas.android.com/apk/res/android" tools:context="in.celest.xash3d.LauncherActivity" >
<TextView
android:id="@+id/textView_tittle"
android:layout_width="fill_parent" android:layout_width="fill_parent"
android:layout_height="50dp"
android:layout_marginBottom="1dp"
android:layout_marginLeft="5dp"
android:background="#555555"
android:layout_marginRight="5dp"
android:layout_marginTop="20dp"
android:text="@string/launcher_name"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="25sp"
android:drawableLeft="@drawable/ic_launcher"
android:drawablePadding="10dp"
android:singleLine="true"
android:gravity="center_vertical" />
<TabHost
android:id="@+id/tabhost"
android:layout_width="match_parent"
android:layout_height="match_parent" android:layout_height="match_parent"
android:layout_weight="1.0"> android:layout_weight="1.20"
android:paddingBottom="10dp"
android:paddingLeft="3dp"
android:paddingRight="3dp"
android:paddingTop="8dp">
<LinearLayout <LinearLayout
xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent"
xmlns:tools="http://schemas.android.com/tools" android:layout_height="match_parent"
android:background="#555555"
android:orientation="vertical">
<TabWidget
android:id="@android:id/tabs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:showDividers="middle" />
<ScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:id="@+id/scrollView2">
<FrameLayout
android:id="@android:id/tabcontent"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/tab1"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="15dp"
android:layout_marginBottom="25dp"
android:background="#333333"
android:orientation="vertical"
android:text="@string/text_tab1"
android:weightSum="0.6">
<TextView
android:id="@+id/textView_path1"
android:layout_width="fill_parent"
android:layout_height="40dp"
android:layout_marginBottom="2dp"
android:layout_marginLeft="10dp"
android:background="#444444"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:text="@string/text_res_tittle2"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="20sp"
android:gravity="center_vertical|center_horizontal" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:background="#444444"
android:orientation="vertical"
android:weightSum="1">
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="3dp"
android:text="@string/volume"
android:textAppearance="?android:attr/textAppearanceMedium" />
<ToggleButton
android:id="@+id/useVolume"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:text="nothing"
android:textOff="@string/no_volume"
android:textOn="@string/use_volume" />
<TextView
android:id="@+id/textView_path"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="3dp"
android:text="@string/text_res_path"
android:textAppearance="?android:attr/textAppearanceMedium" />
<Button
android:id="@+id/button_select"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="bottom"
android:layout_marginLeft="10dp"
android:layout_marginTop="10dp"
android:layout_marginBottom="10dp"
android:layout_marginRight="10dp"
android:onClick="selectFolder"
android:text="@string/select_folder" />
<Button
android:id="@+id/button_shortcut"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:onClick="createShortcut"
android:text="@string/create_shortcut_button" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:id="@+id/tab2"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="15dp"
android:background="#333333"
android:orientation="vertical"
android:text="@string/text_tab2">
<TextView
android:id="@+id/textView_path2"
android:layout_width="fill_parent"
android:layout_height="40dp"
android:layout_marginBottom="2dp"
android:layout_marginLeft="10dp"
android:background="#444444"
android:layout_marginRight="10dp"
android:layout_marginTop="13dp"
android:text="@string/text_res_tittle3"
android:textAppearance="?android:attr/textAppearanceMedium"
android:textSize="20sp"
android:gravity="center_vertical|center_horizontal" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_marginBottom="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:background="#444444"
android:orientation="vertical"
android:weightSum="1">
<TextView
android:id="@+id/textView_args"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="20dp"
android:text="@string/cmd_args_text"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="@+id/cmdArgs"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="3dp" />
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="3dp"
android:text="@string/text_res_path"
android:textAppearance="?android:attr/textAppearanceMedium" />
<EditText
android:id="@+id/cmdPath"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="3dp" />
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:layout_marginBottom="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="3dp"
android:text="Pixel Format"
android:textAppearance="?android:attr/textAppearanceMedium" />
<Spinner
android:layout_height="wrap_content"
android:layout_width="match_parent"
android:id="@+id/pixelSpinner"
android:layout_marginBottom="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp" />
<ToggleButton
android:id="@+id/enableResizeWorkaround"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:text="enableResizeWorkaround"
android:textOff="Keyboard does not resize screen"
android:textOn="Keyboard resizes screen" />
<CheckBox
android:id="@+id/check_updates"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:text="@string/update_button" />
<CheckBox
android:id="@+id/check_betas"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:text="@string/update_to_beta" />
<CheckBox
android:id="@+id/immersive_mode"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="10dp"
android:layout_marginLeft="10dp"
android:layout_marginRight="10dp"
android:layout_marginTop="10dp"
android:text="@string/immersive_mode" />
<TextView
android:id="@+id/textView7"
android:layout_marginBottom="10dp"
android:layout_width="fill_parent"
android:layout_height="0dp"
android:layout_gravity="center_horizontal"
android:layout_weight="1"
android:clickable="false" />
</LinearLayout>
</LinearLayout>
</FrameLayout>
</ScrollView>
</LinearLayout>
</TabHost>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="50dp"
android:background="#444444"
android:layout_marginBottom="-20dp"
android:paddingTop="5dp"
android:layout_gravity="bottom"
android:orientation="horizontal">
<Button
android:id="@+id/button_about"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:orientation="vertical"> android:layout_gravity="left"
android:onClick="aboutXash"
<TextView android:text="@string/about_button" />
android:layout_width="wrap_content" <Button
android:layout_height="wrap_content" android:id="@+id/button_launch"
android:textAppearance="?android:attr/textAppearanceMedium" android:layout_width="wrap_content"
android:text="@string/cmd_args_text" android:layout_height="wrap_content"
android:id="@+id/textView_args" /> android:layout_column="6"
android:layout_marginLeft="0dp"
<EditText android:layout_weight="0.87"
android:layout_width="match_parent" android:onClick="startXash"
android:layout_height="wrap_content" android:text="@string/launch_button" />
android:id="@+id/cmdArgs" /> </LinearLayout>
<TextView
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="@string/text_res_path"
android:id="@+id/textView_path" />
<EditText
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:id="@+id/cmdPath" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/select_folder"
android:id="@+id/button_select"
android:onClick="selectFolder" />
<CheckBox
android:layout_height="wrap_content"
android:layout_width="wrap_content"
android:textAppearance="?android:attr/textAppearanceMedium"
android:text="@string/use_volume"
android:id="@+id/useVolume"/>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/about_button"
android:id="@+id/button"
android:onClick="aboutXash" />
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/create_shortcut_button"
android:id="@+id/button"
android:onClick="createShortcut" />
<TextView
android:layout_width="fill_parent"
android:layout_height="0dp"
android:id="@+id/textView7"
android:layout_gravity="center_horizontal"
android:layout_weight="1"
android:clickable="false" />
</LinearLayout>
</ScrollView>
<Button
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/launch_button"
android:id="@+id/button_launch"
android:onClick="startXash"
android:layout_column="6"
android:layout_gravity="right"
android:layout_weight="0.0" />
</LinearLayout> </LinearLayout>

40
res/layout/row.xml Normal file
View file

@ -0,0 +1,40 @@
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="wrap_content"
android:layout_marginTop="5dip"
android:background="#333333" android:orientation="vertical" android:layout_width="fill_parent">
<ImageView
android:id="@+id/fd_Icon1"
android:layout_width="40dip"
android:layout_height="40dip" >
</ImageView>
<TextView android:text="@+id/filename"
android:id="@+id/filename"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:singleLine="true"
android:textStyle="bold"
android:layout_toRightOf="@+id/fd_Icon1"
android:layout_marginTop="5dip"
android:layout_marginLeft="5dip">
</TextView>
<TextView android:text="@+id/fileitems"
android:id="@+id/fileitems"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_toRightOf="@+id/fd_Icon1"
android:layout_below="@+id/filename"
android:layout_marginLeft="10dip">
</TextView>
<TextView android:text="@+id/filedate"
android:id="@+id/filedate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/filename"
android:layout_alignParentRight="true"
android:layout_marginLeft="5dip">
</TextView>
</RelativeLayout>

View file

@ -1,10 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<string name="app_name">Xash3D</string>
<string name="launcher_name">Xash3D</string>
<string name="launcher_name_test">Xash3D (test)</string>
<string name="launch_button">Xash3D starten!</string> <string name="launch_button">Xash3D starten!</string>
<string name="cmd_args_text">Command line arguments(experts only)</string> <string name="cmd_args_text">Command line arguments(experts only)</string>
<string name="use_controls">Touch Kontroller aktivieren</string> <string name="use_controls">Touch Kontroller aktivieren</string>
@ -19,9 +14,8 @@
<string name="shortcut_name">Kurzbefehl Name</string> <string name="shortcut_name">Kurzbefehl Name</string>
<!-- TODO: Remove or change this placeholder text --> <!-- TODO: Remove or change this placeholder text -->
<string name="about_main">Xash3D Android</string> <string name="about_copyright">SDLash3D steht in keinem Zusammenhang zu Valve oder einem ihrer Partners. All copyrights reserved to their respective owners.</string>
<string name="about_copyright">Flying With Gauss steht in keinem Zusammenhang zu Valve oder einem ihrer Partners. All copyrights reserved to their respective owners.</string> <string name="about_authors">Portierung auf Android by SDLash3D team: \n
<string name="about_authors">Portierung auf Android by Flying With Gauss: \n
&#8226; a1batross\n &#8226; a1batross\n
&#8226; mittorn \n &#8226; mittorn \n
&#8226; nicknekit.\n &#8226; nicknekit.\n
@ -30,10 +24,10 @@ Spezieller Dank an:\n
&#8226; Uncle Mike für Xash3D engine\n &#8226; Uncle Mike für Xash3D engine\n
&#8226; Valve for Half-Life\n &#8226; Valve for Half-Life\n
&#8226; libSDL2 developers.\n</string> &#8226; libSDL2 developers.\n</string>
<string name="about_links">Folge uns auf: <string name="about_links">Folge uns auf:\n
&#8226; <a href="https://vk.com/xashdroid">VK</a> &#8226; <a href="https://vk.com/xashdroid">VK</a>\n
&#8226; <a href="http://moddb.com/game/xash3d-android">ModDB</a> &#8226; <a href="http://moddb.com/game/xash3d-android">ModDB</a>\n
&#8226; <a href="https://github.com/FWGS">GitHub</a></string> &#8226; <a href="https://github.com/SDLash3D">GitHub</a></string>
<string name="about_button">Über Xash3D Android</string> <string name="about_button">Über Xash3D Android</string>
<string name="create_shortcut_button">mod Kurzbefehl ersellen</string> <string name="create_shortcut_button">mod Kurzbefehl ersellen</string>
<string name="select_folder">(auswahl)</string> <string name="select_folder">(auswahl)</string>

View file

@ -1,10 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<string name="app_name">Xash3D</string>
<string name="launcher_name">Xash3D</string>
<string name="launcher_name_test">Xash3D (test)</string>
<string name="launch_button">¡Iniciar Xash3D!</string> <string name="launch_button">¡Iniciar Xash3D!</string>
<string name="cmd_args_text">Parámetros de línea de comandos(sólo expertos)</string> <string name="cmd_args_text">Parámetros de línea de comandos(sólo expertos)</string>
<string name="use_controls">Activar controles táctiles</string> <string name="use_controls">Activar controles táctiles</string>
@ -18,11 +13,8 @@
<string name="pkgname">Nombre del paquete del mod (sólo expertos)</string> <string name="pkgname">Nombre del paquete del mod (sólo expertos)</string>
<string name="shortcut_name">Nombre del acceso directo</string> <string name="shortcut_name">Nombre del acceso directo</string>
<!-- TODO: Remove or change this placeholder text --> <string name="about_copyright">SDLash3D no está afiliado con Valve o cualquiera de sus socios. Todos los derechos reservados a sus respectivos dueños.</string>
<string name="about_main">Xash3D Android</string> <string name="about_authors">Adaptación para Android por SDLash3D team: \n
<string name="about_copyright">Flying With Gauss no está afiliado con Valve o cualquiera de sus socios. Todos los derechos reservados a sus respectivos dueños.</string>
<string name="version_string" translatable="false">v0.17.1</string>
<string name="about_authors">Adaptación para Android por Flying With Gauss: \n
&#8226; a1batross\n &#8226; a1batross\n
&#8226; mittorn \n &#8226; mittorn \n
&#8226; nicknekit.\n &#8226; nicknekit.\n
@ -31,10 +23,10 @@ Especial agradecimiento a:\n
&#8226; Uncle Mike por Xash3D engine\n &#8226; Uncle Mike por Xash3D engine\n
&#8226; Valve por Half-Life\n &#8226; Valve por Half-Life\n
&#8226; Desarrolladores de libSDL2.\n</string> &#8226; Desarrolladores de libSDL2.\n</string>
<string name="about_links">Siguenos en: <string name="about_links">Siguenos en: \n
&#8226; <a href="https://vk.com/xashdroid">VK</a> &#8226; <a href="https://vk.com/xashdroid">VK</a>\n
&#8226; <a href="http://moddb.com/game/xash3d-android">ModDB</a> &#8226; <a href="http://moddb.com/game/xash3d-android">ModDB</a>\n
&#8226; <a href="https://github.com/FWGS">GitHub</a></string> &#8226; <a href="https://github.com/SDLash3D">GitHub</a></string>
<string name="about_button">Acerca de Xash3D Android</string> <string name="about_button">Acerca de Xash3D Android</string>
<string name="create_shortcut_button">Crear acceso directo del mod</string> <string name="create_shortcut_button">Crear acceso directo del mod</string>
<string name="select_folder">(seleccionar)</string> <string name="select_folder">(seleccionar)</string>

View file

@ -1,8 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<resources> <resources>
<string name="app_name">Xash3D</string>
<string name="launcher_name">Xash3D</string>
<string name="launcher_name_test">Xash3D (آزمایشی)</string>
<string name="launch_button">!Xash3Dاجرای</string> <string name="launch_button">!Xash3Dاجرای</string>
<string name="cmd_args_text">دستورات خط فرمان (فقط برای حرفه ای ها):</string> <string name="cmd_args_text">دستورات خط فرمان (فقط برای حرفه ای ها):</string>
<string name="use_controls">فعال کردن کنترل های لمسی</string> <string name="use_controls">فعال کردن کنترل های لمسی</string>
@ -15,11 +12,9 @@
<string name="gamedir">مسیر مود</string> <string name="gamedir">مسیر مود</string>
<string name="pkgname">نام بسته مود (فقط برای حرفه ای ها):</string> <string name="pkgname">نام بسته مود (فقط برای حرفه ای ها):</string>
<string name="shortcut_name">نام میانبر</string> <string name="shortcut_name">نام میانبر</string>
<string name="about_main">Xash3D Android</string> <string name="about_copyright">یا شرکای آن ندارد. تمامی حقوق کپی برای صاحبان هر کدام محفوظ است. Valve هیچ نسبتی با SDLash3D</string>
<string name="about_copyright">یا شرکای آن ندارد. تمامی حقوق کپی برای صاحبان هر کدام محفوظ است. Valve هیچ نسبتی با Flying With Gauss</string> <string name="about_authors">:SDLash3D پورت شده به اندروید توسط تیم \n • a1batross\n • mittorn \n • nicknekit.\n تشکر ویژه از:\n • Xash3Dبرای موتور Uncle Mike\n • Half-Life برای Valve\n • libSDL2 توسعه دهندگان.\n</string>
<string name="version_string" translatable="false">v0.17.1</string> <string name="about_links">ما را دنبال کنید در :\n •<a href="https://vk.com/xashdroid">VK</a>\n•<a href="http://moddb.com/game/xash3d-android">ModDB</a>\n•<a href="https://github.com/SDLash3D">GitHub</a></string>
<string name="about_authors">:Flying With Gauss پورت شده به اندروید توسط تیم \n • a1batross\n • mittorn \n • nicknekit.\n تشکر ویژه از:\n • Xash3Dبرای موتور Uncle Mike\n • Half-Life برای Valve\n • libSDL2 توسعه دهندگان.\n</string>
<string name="about_links">ما را دنبال کنید در : •<a href="https://vk.com/xashdroid">VK</a><a href="http://moddb.com/game/xash3d-android">ModDB</a><a href="https://github.com/FWGS">GitHub</a></string>
<string name="about_button">Xash3D Android درباره</string> <string name="about_button">Xash3D Android درباره</string>
<string name="create_shortcut_button">ایجاد میانبر مود</string> <string name="create_shortcut_button">ایجاد میانبر مود</string>
<string name="select_folder">(انتخاب)</string> <string name="select_folder">(انتخاب)</string>

View file

@ -1,10 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<resources> <resources>
<string name="app_name">Xash3D</string>
<string name="launcher_name">Xash3D</string>
<string name="launcher_name_test">Xash3D (테스트)</string>
<string name="launch_button">Xash3D 실행!</string> <string name="launch_button">Xash3D 실행!</string>
<string name="cmd_args_text">커멘드 라인 입력(고급 설정)</string> <string name="cmd_args_text">커멘드 라인 입력(고급 설정)</string>
<string name="use_controls">터치 컨트롤 사용</string> <string name="use_controls">터치 컨트롤 사용</string>
@ -17,9 +13,8 @@
<string name="gamedir">모드 디렉토리</string> <string name="gamedir">모드 디렉토리</string>
<string name="pkgname">모드 패키지 이름(고급설정)</string> <string name="pkgname">모드 패키지 이름(고급설정)</string>
<string name="shortcut_name">바로가기 이름</string> <string name="shortcut_name">바로가기 이름</string>
<string name="about_main">Xash3D 안드로이드</string> <string name="about_copyright">우리 SDLash3D는 밸브와 상업적으로 관련이 없습니다. 모든 저작권은 소유주로 보류되어있음을 알립니다..</string>
<string name="about_copyright">우리 Flying With Gauss는 밸브와 상업적으로 관련이 없습니다. 모든 저작권은 소유주로 보류되어있음을 알립니다..</string> <string name="about_authors">안드로이드 이식 by SDLash3D팀: \n
<string name="about_authors">안드로이드 이식 by Flying With Gauss: \n
• a1batross\n • a1batross\n
• mittorn \n • mittorn \n
• nicknekit.\n • nicknekit.\n
@ -29,12 +24,12 @@
• 밸브의 하프라이프\n • 밸브의 하프라이프\n
• libSDL2 개발자분들\n • libSDL2 개발자분들\n
• 한글화 byAIC from X3A NaverCafe</string> • 한글화 byAIC from X3A NaverCafe</string>
<string name="about_links"> <string name="about_links">\n
여기서 우리를: • <a href="https://vk.com/xashdroid">VK</a> 여기서 우리를: • <a href="https://vk.com/xashdroid">VK</a>\n
<a href="http://moddb.com/game/xash3d-android">모드디비</a> <a href="http://moddb.com/game/xash3d-android">모드디비</a>\n
<a href="https://github.com/FWGS">깃허브</a> <a href="https://github.com/SDLash3D">깃허브</a>
</string> </string>
<string name="about_button">Xash3D 안드로이드 정보</string> <string name="about_button">Xash3D 안드로이드 정보</string>
<string name="create_shortcut_button">바로가기 만들기</string> <string name="create_shortcut_button">바로가기 만들기</string>
<string name="select_folder">(선택)</string> <string name="select_folder">(선택)</string>
</resources> </resources>

View file

@ -1,10 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<string name="app_name">Xash3D</string>
<string name="launcher_name">Xash3D</string>
<string name="launcher_name_test">Xash3D (test)</string>
<string name="launch_button">Iniciar Xash3D!</string> <string name="launch_button">Iniciar Xash3D!</string>
<string name="cmd_args_text">Argumentos de linha de comando(apenas expecialistas)</string> <string name="cmd_args_text">Argumentos de linha de comando(apenas expecialistas)</string>
<string name="use_controls">Habilitar controles de touch</string> <string name="use_controls">Habilitar controles de touch</string>
@ -18,11 +13,8 @@
<string name="pkgname">Nome do pacote de Mod (apenas expecialistas)</string> <string name="pkgname">Nome do pacote de Mod (apenas expecialistas)</string>
<string name="shortcut_name">Nome do atalho</string> <string name="shortcut_name">Nome do atalho</string>
<!-- TODO: Remove or change this placeholder text --> <string name="about_copyright">SDLash3D não é afiliado com a Valve ou qualquer um dos seus parceiros. Todos os direitos autorais reservados aos respectivos proprietários.</string>
<string name="about_main">Xash3D Android</string> <string name="about_authors">Porta para android pelo time SDLash3D: \n
<string name="about_copyright">Flying With Gauss não é afiliado com a Valve ou qualquer um dos seus parceiros. Todos os direitos autorais reservados aos respectivos proprietários.</string>
<string name="version_string" translatable="false">v0.17.1</string>
<string name="about_authors">Porta para android pelo Flying With Gauss: \n
&#8226; a1batross\n &#8226; a1batross\n
&#8226; mittorn \n &#8226; mittorn \n
&#8226; nicknekit.\n &#8226; nicknekit.\n
@ -31,10 +23,10 @@ Agradecimentos especiais para:\n
&#8226; Uncle Mike pelo motor Xash3D\n &#8226; Uncle Mike pelo motor Xash3D\n
&#8226; Valve pelo Half-Life\n &#8226; Valve pelo Half-Life\n
&#8226; Desenvolvedores libSDL2.\n</string> &#8226; Desenvolvedores libSDL2.\n</string>
<string name="about_links">Siga-nos no: <string name="about_links">Siga-nos no:\n
&#8226; <a href="https://vk.com/xashdroid">VK</a> &#8226; <a href="https://vk.com/xashdroid">VK</a>\n
&#8226; <a href="http://moddb.com/game/xash3d-android">ModDB</a> &#8226; <a href="http://moddb.com/game/xash3d-android">ModDB</a>\n
&#8226; <a href="https://github.com/FWGS">GitHub</a></string> &#8226; <a href="https://github.com/SDLash3D">GitHub</a></string>
<string name="about_button">Sobre Android Xash3D</string> <string name="about_button">Sobre Android Xash3D</string>
<string name="create_shortcut_button">Criar atalho para o mod</string> <string name="create_shortcut_button">Criar atalho para o mod</string>
<string name="select_folder">(selecionar)</string> <string name="select_folder">(selecionar)</string>

View file

@ -1,29 +1,58 @@
<?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<!--<string name="app_name" translatable="false">Xash3D</string>
<string name="cmd_args_text">Аргументы командной строки(только для экспертов)</string> <string name="launcher_name" translatable="false">Xash3D</string>
<string name="launcher_name_test" translatable="false">Xash3D (test)</string>-->
<string name="launch_button">Запустить Xash3D</string> <string name="launch_button">Запустить Xash3D</string>
<string name="cmd_args_text">Аргументы командной строки(только для экспертов)</string>
<string name="use_controls">Включить экранное управление</string> <string name="use_controls">Включить экранное управление</string>
<string name="use_volume">Использовать кнопки громкости</string> <string name="volume">Действие кнопок громкости</string>
<string name="use_volume">Регулировка громкости</string>
<string name="no_volume">Использовать в игре</string>
<string name="text_res_path">Путь к ресурсам игры</string> <string name="text_res_path">Путь к ресурсам игры</string>
<string name="touch_set">Настройки управления</string> <string name="touch_set">Настройки управления</string>
<string name="text_shortcut">Ярлык Xash3D</string> <string name="text_shortcut">Ярлык Xash3D</string>
<string name="text_shortcut_test">Ярлык Xash3D (тест)</string>
<string name="shortcut_button_save">Сохранить ярлык</string> <string name="shortcut_button_save">Сохранить ярлык</string>
<string name="gamedir">Каталог мода</string> <string name="gamedir">Каталог мода</string>
<string name="pkgname">Пакет мода (только для экспертов)</string> <string name="pkgname">Пакет мода (только для экспертов)</string>
<string name="shortcut_name">Название ярлыка</string> <string name="shortcut_name">Название ярлыка</string>
<string name="about_authors">Порт на Android осуществлен Flying With Gauss:\n
&#8226; a1batross\n
&#8226; mittorn\n
&#8226; nicknekit\n
Особые благодарности:\n <!--<string name="about_main" translatable="false">Xash3D Android</string>-->
&#8226; Дяде Мише за Xash3D\n <string name="about_copyright">SDLash3D не связан с Valve или с любыми из их партнеров. Все авторские права принадлежат их соотвественным обладателям.</string>
&#8226; Valve за Half-Life\n <!-- Seems Android skips any line breaks and tabs here. -->
&#8226; Beloko Games за поддержку сенсорного управления\n <string name="about_authors">
&#8226; Разработчикам libSDL2</string> Порт на Android осуществлен командой SDLash3D:\n
&#8226; a1batross\n
&#8226; mittorn\n
&#8226; nicknekit\n
Особые благодарности:\n
&#8226; Дяде Мише за Xash3D\n
&#8226; Valve за Half-Life\n
&#8226; Разработчикам libSDL2
</string>
<string name="about_links">
Подпишись на нас: \n
&#8226; <a href="https://vk.com/xashdroid">VK</a>\n
&#8226; <a href="http://moddb.com/game/xash3d-android">ModDB</a>\n
&#8226; <a href="https://github.com/SDLash3D">GitHub</a>
</string>
<string name="about_button">О Xash3D Android</string> <string name="about_button">О Xash3D Android</string>
<string name="about_copyright">Flying With Gauss не связан с Valve или с любыми из их партнеров. Все авторские права принадлежат их соотвественным обладателям.</string>
<string name="action_settings">Настройки</string>
<string name="text_shortcut_test">Ярлык Xash3D (тест)</string>
<string name="create_shortcut_button">Создать ярлык</string> <string name="create_shortcut_button">Создать ярлык</string>
<string name="select_folder">Выбрать путь игровых файлов</string>
<string name="text_tab1">Стандартный</string>
<string name="text_tab2">Продвинутый</string>
<string name="text_res_tittle2">Стандартные настройки</string>
<string name="text_res_tittle3">Продвинутые настройки</string>
<string name="update_button">Проверять обновления при запуске</string>
<string name="update_to_beta">Обновлять до нестабильной версии, если доступно</string>
<string name="update_message">%s доступен! Скачай его сейчас!</string>
<string name="update">Обновить</string>
<string name="cancel">Отмена</string>
<string name="no_updates">Обновления не найдены</string>
<string name="checking_updates">Работаю...</string>
</resources> </resources>

View file

@ -1,10 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<string name="app_name">Xash3D</string>
<string name="launcher_name">Xash3D</string>
<string name="launcher_name_test">Xash3D (test)</string>
<string name="launch_button">Xash3D\'yi Başlat!</string> <string name="launch_button">Xash3D\'yi Başlat!</string>
<string name="cmd_args_text">Komut satırı parametreleri(uzmanlar için)</string> <string name="cmd_args_text">Komut satırı parametreleri(uzmanlar için)</string>
<string name="use_controls">Dokunmatik kontrolleri etkinleştir</string> <string name="use_controls">Dokunmatik kontrolleri etkinleştir</string>
@ -18,9 +13,8 @@
<string name="pkgname">Mod\'un paket adı (uzmanlar için)</string> <string name="pkgname">Mod\'un paket adı (uzmanlar için)</string>
<string name="shortcut_name">Kısayol adı</string> <string name="shortcut_name">Kısayol adı</string>
<string name="about_main">Xash3D Android</string> <string name="about_copyright">SDLash3D, Valve veya Valve\'ın herhangi bir partnerine bağlı değildir. Tüm telif hakları kendi sahiplerine aittir.</string>
<string name="about_copyright">Flying With Gauss, Valve veya Valve\'ın herhangi bir partnerine bağlı değildir. Tüm telif hakları kendi sahiplerine aittir.</string> <string name="about_authors">SDLash3D takımından Android Port\'u: \n
<string name="about_authors">Flying With Gauss takımından Android Port\'u: \n
&#8226; a1batross\n &#8226; a1batross\n
&#8226; mittorn \n &#8226; mittorn \n
&#8226; nicknekit.\n &#8226; nicknekit.\n
@ -29,10 +23,10 @@
&#8226; Uncle Mike for Xash3D engine\n &#8226; Uncle Mike for Xash3D engine\n
&#8226; Valve for Half-Life\n &#8226; Valve for Half-Life\n
&#8226; libSDL2 developers.\n</string> &#8226; libSDL2 developers.\n</string>
<string name="about_links">Bizi buralardan takip edin: <string name="about_links">Bizi buralardan takip edin: \n
&#8226; <a href="https://vk.com/xashdroid">VK</a> &#8226; <a href="https://vk.com/xashdroid">VK</a>\n
&#8226; <a href="http://moddb.com/game/xash3d-android">ModDB</a> &#8226; <a href="http://moddb.com/game/xash3d-android">ModDB</a>\n
&#8226; <a href="https://github.com/FWGS">GitHub</a></string> &#8226; <a href="https://github.com/SDLash3D">GitHub</a></string>
<string name="about_button">Xash3D Android Hakkında</string> <string name="about_button">Xash3D Android Hakkında</string>
<string name="create_shortcut_button">Mod kısayolu oluştur</string> <string name="create_shortcut_button">Mod kısayolu oluştur</string>
<string name="select_folder">(seç)</string> <string name="select_folder">(seç)</string>

View file

@ -1,9 +1,5 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<string name="app_name">Xash3D</string>
<string name="launcher_name">Xash3D</string>
<string name="launcher_name_test">Xash3D (test)</string>
<string name="launch_button">Запустити Xash3D</string> <string name="launch_button">Запустити Xash3D</string>
<string name="cmd_args_text">Аргументи командного рядка(тільки для експертів)</string> <string name="cmd_args_text">Аргументи командного рядка(тільки для експертів)</string>
<string name="use_controls">Включити екранне управління</string> <string name="use_controls">Включити екранне управління</string>
@ -16,10 +12,8 @@
<string name="gamedir">Каталог мода</string> <string name="gamedir">Каталог мода</string>
<string name="pkgname">Пакет мода (тільки для експертів)</string> <string name="pkgname">Пакет мода (тільки для експертів)</string>
<string name="shortcut_name">Назва ярлика</string> <string name="shortcut_name">Назва ярлика</string>
<string name="about_copyright">SDLash3D не пов\'язаний з Valve або з будь-якими з їх партнерів. Всі авторські права належать їх відповідним власникам.</string>
<string name="about_main">Xash3D Android</string> <string name="about_authors">Порт на Android здійснений командою SDLash3D:\n
<string name="about_copyright">Flying With Gauss не пов\'язаний з Valve або з будь-якими з їх партнерів. Всі авторські права належать їх відповідним власникам.</string>
<string name="about_authors">Порт на Android здійснений Flying With Gauss:\n
&#8226; a1batross\n &#8226; a1batross\n
&#8226; mittorn\n &#8226; mittorn\n
&#8226; nicknekit\n &#8226; nicknekit\n
@ -28,10 +22,10 @@
&#8226; Дяде Мише за Xash3D\n &#8226; Дяде Мише за Xash3D\n
&#8226; Valve за Half-Life\n &#8226; Valve за Half-Life\n
&#8226; Розробникам libSDL2.\n</string> &#8226; Розробникам libSDL2.\n</string>
<string name="about_links">Слідуйте за нами в: <string name="about_links">Слідуйте за нами в:\n
&#8226; <a href="https://vk.com/xashdroid">VK</a> &#8226; <a href="https://vk.com/xashdroid">VK</a>\n
&#8226; <a href="http://moddb.com/game/xash3d-android">ModDB</a> &#8226; <a href="http://moddb.com/game/xash3d-android">ModDB</a>\n
&#8226; <a href="https://github.com/FWGS">GitHub</a></string> &#8226; <a href="https://github.com/SDLash3D">GitHub</a></string>
<string name="about_button">О Xash3D Android</string> <string name="about_button">О Xash3D Android</string>
<string name="create_shortcut_button">Створити ярлик мода</string> <string name="create_shortcut_button">Створити ярлик мода</string>
<string name="select_folder">(вибрати)</string> <string name="select_folder">(вибрати)</string>

View file

@ -1,77 +1,33 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<string name="app_name">Xash3D</string>
<string name="launcher_name">Xash3D</string>
<string name="launcher_name_test">Xash3D (test)</string>
<string name="launch_button">启动 Xash3D!</string> <string name="launch_button">启动 Xash3D!</string>
<string name="cmd_args_text">命令行参数(高级)</string> <string name="cmd_args_text">命令行参数(高级)</string>
<string name="use_controls">启用触摸控制</string> <string name="use_controls">启用触摸控制</string>
<string name="use_volume">使用音量键</string> <string name="use_volume">使用音量键</string>
<string name="text_res_path">游戏资源路径</string> <string name="text_res_path">游戏资源路径</string>
<string name="touch_set">控制设置</string> <string name="touch_set">控制设置</string>
<string name="text_shortcut">Xash3D 快捷方式</string> <string name="text_shortcut">Xash3D 快捷方式</string>
<string name="text_shortcut_test">Xash3D_test 快捷方式</string> <string name="text_shortcut_test">Xash3D_test 快捷方式</string>
<string name="shortcut_button_save">保存快捷方式</string> <string name="shortcut_button_save">保存快捷方式</string>
<string name="gamedir">Mod 目录</string> <string name="gamedir">Mod 目录</string>
<string name="pkgname">Mod 资源包名字(高级)</string> <string name="pkgname">Mod 资源包名字(高级)</string>
<string name="shortcut_name">快捷方式名字</string> <string name="shortcut_name">快捷方式名字</string>
<string name="about_copyright">SDLash3D不隶属于Valve或其合作伙伴。 版权归各自所有。</string>
<string name="about_authors">由SDLash3D团队移植到Android系统成员 \n
<!-- TODO: Remove or change this placeholder text -->
<string name="about_main">Xash3D Android</string>
<string name="about_copyright">Flying With Gauss不隶属于Valve或其合作伙伴。 版权归各自所有。</string>
<string name="version_string" translatable="false">v0.17.1</string>
<string name="about_authors">由Flying With Gauss团队移植到Android系统成员 \n
&#8226; a1batross\n &#8226; a1batross\n
&#8226; mittorn \n &#8226; mittorn \n
&#8226; nicknekit.\n &#8226; nicknekit.\n
特别感谢:\n 特别感谢:\n
&#8226; Uncle Mike 制作的 Xash3D 引擎\n &#8226; Uncle Mike 制作的 Xash3D 引擎\n
&#8226; Valve 制作的 《半条命》\n &#8226; Valve 制作的 《半条命》\n
&#8226; libSDL2 开发商\n</string> &#8226; libSDL2 开发商\n</string>
<string name="about_links">联系我们: \n
<string name="about_links">联系我们: &#8226; <a href="https://vk.com/xashdroid">VK</a>\n
&#8226; <a href="http://moddb.com/game/xash3d-android">ModDB</a>\n
&#8226; <a href="https://vk.com/xashdroid">VK</a> &#8226; <a href="https://github.com/SDLash3D">GitHub</a></string>
&#8226; <a href="http://moddb.com/game/xash3d-android">ModDB</a>
&#8226; <a href="https://github.com/FWGS">GitHub</a></string>
<string name="about_button">关于 Xash3D Android</string> <string name="about_button">关于 Xash3D Android</string>
<string name="create_shortcut_button">创建mod快捷方式</string> <string name="create_shortcut_button">创建mod快捷方式</string>
<string name="select_folder">(选择)</string> <string name="select_folder">(选择)</string>
</resources> </resources>

View file

@ -1,13 +1,12 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<string name="app_name" translatable="false">Xash3D</string>
<string name="launcher_name" translatable="false">Xash3D</string>
<string name="launcher_name_test" translatable="false">Xash3D (test)</string>
<string name="version_string" translatable="false">v0.18</string>
<string name="app_name">Xash3D</string>
<string name="launcher_name">Xash3D</string>
<string name="launcher_name_test">Xash3D (test)</string>
<string name="launch_button">Launch Xash3D!</string> <string name="launch_button">Launch Xash3D!</string>
<string name="cmd_args_text">Command line arguments(experts only)</string> <string name="cmd_args_text">Command line arguments(experts only)</string>
<string name="use_controls">Enable touch controls</string>
<string name="use_volume">Use volume keys</string>
<string name="text_res_path">Path to game resources</string> <string name="text_res_path">Path to game resources</string>
<string name="touch_set">Controls settings</string> <string name="touch_set">Controls settings</string>
<string name="text_shortcut">Xash3D shortcut</string> <string name="text_shortcut">Xash3D shortcut</string>
@ -16,23 +15,46 @@
<string name="gamedir">Mod directory</string> <string name="gamedir">Mod directory</string>
<string name="pkgname">Mod package name (experts only)</string> <string name="pkgname">Mod package name (experts only)</string>
<string name="shortcut_name">Shortcut name</string> <string name="shortcut_name">Shortcut name</string>
<string name="about_main">Xash3D Android</string>
<string name="about_copyright">Flying With Gauss is not affiliated with Valve or any of their partners. All copyrights reserved to their respective owners.</string>
<string name="version_string" translatable="false">v0.17.1</string>
<string name="about_authors">Port to Android by Flying With Gauss: \n
&#8226; a1batross\n
&#8226; mittorn \n
&#8226; nicknekit.\n
Special thanks to:\n <string name="about_main" translatable="false">Xash3D Android</string>
&#8226; Uncle Mike for Xash3D engine\n <string name="about_copyright">SDLash3D is not affiliated with Valve or any of their partners. All copyrights reserved to their respective owners.</string>
&#8226; Valve for Half-Life\n <!-- Seems Android skips any line breaks and tabs here. -->
&#8226; libSDL2 developers.\n</string> <string name="about_authors">
<string name="about_links">Follow us in: Port to Android by SDLash3D team: \n
&#8226; <a href="https://vk.com/xashdroid">VK</a> &#8226; a1batross\n
&#8226; <a href="http://moddb.com/game/xash3d-android">ModDB</a> &#8226; mittorn \n
&#8226; <a href="https://github.com/FWGS">GitHub</a></string> &#8226; nicknekit.\n
<string name="about_button">About Xash3D Android</string>
Special thanks to:\n
&#8226; Uncle Mike for Xash3D engine\n
&#8226; Valve for Half-Life\n
&#8226; libSDL2 developers.\n
</string>
<string name="about_links">
Follow us in: \n
&#8226; <a href="https://vk.com/xashdroid">VK</a>\n
&#8226; <a href="http://moddb.com/game/xash3d-android">ModDB</a>\n
&#8226; <a href="https://github.com/SDLash3D">GitHub</a>
</string>
<string name="about_button">About</string>
<string name="create_shortcut_button">Create mod shortcut</string> <string name="create_shortcut_button">Create mod shortcut</string>
<string name="select_folder">(select)</string> <string name="select_folder">Select game data location</string>
<string name="text_tab1">Normal</string>
<string name="text_tab2">Advanced</string>
<string name="text_res_tittle2">Normal settings</string>
<string name="text_res_tittle3">Advanced settings</string>
<string name="volume">Volume buttons mode</string>
<string name="use_volume">Default action</string>
<string name="no_volume">Use in game</string>
<string name="folder">Set current folder</string>
<string name="update_button">Check updates on start</string>
<string name="update_to_beta">Update to unstable version if available</string>
<string name="update_message">%s is available! Download it now!</string>
<string name="update">Update</string>
<string name="cancel">Cancel</string>
<string name="no_updates">No updates was found</string>
<string name="checking_updates">Working...</string>
<string name="immersive_mode">Enable Immersive Mode(fullscreen, KitKat or higher)</string>
</resources> </resources>

75
scripts/auto-rename.sh Executable file
View file

@ -0,0 +1,75 @@
#!/bin/bash
# Was used to move bunch of travis autobuilds to new path
# Remove unneeded info
function clearName
{
echo $1 | sed 's/xashdroid-//;s/.apk//'
}
function getYear
{
echo $1 | awk -F- '{ print $(NF-4)}'
}
function getMonth
{
echo $1 | awk -F- '{ print $(NF-3)}'
}
function getDay
{
echo $1 | awk -F- '{ print $(NF-2)}' | awk -F_ '{ print $1 }'
}
function getHour
{
echo $1 | awk -F- '{ print $(NF-2)}' | awk -F_ '{ print $2 }'
}
function getMinute
{
echo $1 | awk -F- '{ print $(NF-1)}'
}
function getHash
{
echo $1 | awk -F- '{ print $(NF)}'
}
function getArch
{
local SECOND=`echo $1 | awk -F- '{ print $(NF-5)}'`
local FIRST=`echo $1 | awk -F- '{ print $(NF-6)}'`
if [ "$SECOND" = "tegra2" ]; then
echo $FIRST-$SECOND
else
echo $SECOND
fi
}
function getDaysSinceRelease
{
printf %04d $(( ( $(date -ud "$1$2$3" +'%s') - $(date -ud '150401' +'%s') )/60/60/24 ))
}
for i in *.apk;
do
NAME=`clearName ${i}`
YEAR=`getYear ${NAME}`
MONTH=`getMonth ${NAME}`
DAY=`getDay ${NAME}`
HOUR=`getHour ${NAME}`
MINUTE=`getMinute ${NAME}`
ARCH=`getArch ${NAME}`
HASH=`getHash ${NAME}`
DAYSSINCERELEASE=`getDaysSinceRelease ${YEAR} ${MONTH} ${DAY}`
echo "Moving ${i} to 20${YEAR}/${MONTH}/${DAY}/xash3d-${DAYSSINCERELEASE}-${HOUR}-${MINUTE}-${ARCH}-${HASH}.apk"
mkdir -p 20${YEAR}/${MONTH}/${DAY}/
mv ${i} 20${YEAR}/${MONTH}/${DAY}/xash3d-${DAYSSINCERELEASE}-${HOUR}-${MINUTE}-${ARCH}-${HASH}.apk
done

63
scripts/travis-upload.sh Executable file
View file

@ -0,0 +1,63 @@
#!/bin/bash
# Upload travis generated APKs to the Transfer.sh and Yandex.Disk
function getDaysSinceRelease
{
printf %04d $(( ( $(date +'%s') - $(date -ud '150401' +'%s') )/60/60/24 ))
}
DAYSSINCERELEASE=`getDaysSinceRelease`
COMMITHASH=$(git rev-parse --short HEAD)
CURRENTBRANCH=$(git rev-parse --abbrev-ref HEAD)
function generateFileName
{
echo "xash3d-$DAYSSINCERELEASE-$(date +"%H-%M")-$1-$COMMITHASH.apk"
}
# Transfer.sh
TRANSFERSH_ARMV5=`curl --upload-file xashdroid-armv5.apk https://transfer.sh/$(generateFileName armv5)`
TRANSFERSH_ARMV6=`curl --upload-file xashdroid-armv6.apk https://transfer.sh/$(generateFileName armv6)`
TRANSFERSH_ARMV7=`curl --upload-file xashdroid-armv7.apk https://transfer.sh/$(generateFileName armv7)`
TRANSFERSH_ARMV7TEGRA2=`curl --upload-file xashdroid-armv7-tegra2.apk https://transfer.sh/$(generateFileName armv7-tegra2)`
TRANSFERSH_X86=`curl --upload-file xashdroid-x86.apk https://transfer.sh/$(generateFileName x86)`
echo "Transfer.sh links:"
echo "armv5: ${TRANSFERSH_ARMV5}"
echo "armv6: ${TRANSFERSH_ARMV6}"
echo "armv7: ${TRANSFERSH_ARMV7}"
echo "tegra2: ${TRANSFERSH_ARMV7TEGRA2}"
echo "x86: ${TRANSFERSH_X86}"
# YaDisk
YADISKPATH=`date +%Y/%m/%d`
curl -u $YADISK_USERNAME:$YADISK_PASSWORD -X MKCOL https://webdav.yandex.ru/XashTestVersions/`date +%Y`
curl -u $YADISK_USERNAME:$YADISK_PASSWORD -X MKCOL https://webdav.yandex.ru/XashTestVersions/`date +%Y/%m`/
curl -u $YADISK_USERNAME:$YADISK_PASSWORD -X MKCOL https://webdav.yandex.ru/XashTestVersions/`date +%Y/%m/%d`/
curl -T xashdroid-armv7.apk -u $YADISK_USERNAME:$YADISK_PASSWORD https://webdav.yandex.ru/XashTestVersions/$YADISKPATH/$(generateFileName armv7)
curl -T xashdroid-armv6.apk -u $YADISK_USERNAME:$YADISK_PASSWORD https://webdav.yandex.ru/XashTestVersions/$YADISKPATH/$(generateFileName armv6)
curl -T xashdroid-armv5.apk -u $YADISK_USERNAME:$YADISK_PASSWORD https://webdav.yandex.ru/XashTestVersions/$YADISKPATH/$(generateFileName armv5)
curl -T xashdroid-armv7-tegra2.apk -u $YADISK_USERNAME:$YADISK_PASSWORD https://webdav.yandex.ru/XashTestVersions/$YADISKPATH/$(generateFileName armv7-tegra2)
curl -T xashdroid-x86.apk -u $YADISK_USERNAME:$YADISK_PASSWORD https://webdav.yandex.ru/XashTestVersions/$YADISKPATH/$(generateFileName x86)
# Update current
# $TRAVIS_BRANCH is predefined by Travis CI
function generateFileName_current
{
echo "xash3d-current-$1-$TRAVIS_BRANCH.apk"
}
curl -T xashdroid-armv7.apk -u $YADISK_USERNAME:$YADISK_PASSWORD https://webdav.yandex.ru/XashTestVersions/$(generateFileName_current armv7)
curl -T xashdroid-armv6.apk -u $YADISK_USERNAME:$YADISK_PASSWORD https://webdav.yandex.ru/XashTestVersions/$(generateFileName_current armv6)
curl -T xashdroid-armv5.apk -u $YADISK_USERNAME:$YADISK_PASSWORD https://webdav.yandex.ru/XashTestVersions/$(generateFileName_current armv5)
curl -T xashdroid-armv7-tegra2.apk -u $YADISK_USERNAME:$YADISK_PASSWORD https://webdav.yandex.ru/XashTestVersions/$(generateFileName_current armv7-tegra2)
curl -T xashdroid-x86.apk -u $YADISK_USERNAME:$YADISK_PASSWORD https://webdav.yandex.ru/XashTestVersions/$(generateFileName_current x86)
exit 0

View file

@ -0,0 +1,263 @@
package in.celest.xash3d;
//Created by Solexid
import android.app.Activity;
import android.app.ListActivity;
import android.content.Context;
import android.content.Intent;
import android.graphics.drawable.Drawable;
import android.os.AsyncTask;
import android.os.Environment;
import android.os.Bundle;
import android.os.Build;
import android.util.Log;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.Window;
import android.view.WindowManager;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ImageView;
import android.widget.ListView;
import android.widget.TextView;
import android.widget.Toast;
import android.widget.Button;
import java.io.File;
import java.text.DateFormat;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import in.celest.xash3d.hl.R;
public class FPicker extends Activity {
private File currentDir;
private FileArrayAdapter adapter;
static ListView delta;
public static final int sdk = Integer.valueOf(Build.VERSION.SDK);
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
if ( sdk >= 21 )
super.setTheme( 0x01030224 );
setContentView(R.layout.activity_fpicker);
String path = Environment.getExternalStorageDirectory().toString();
currentDir = new File(path);
((Button)findViewById( R.id.button_fpicker_select )).setOnClickListener(new View.OnClickListener()
{
@Override
public void onClick(View v)
{
onFileClick(v);
}
});
fill(currentDir);
}
private void fill(File folder)
{
new Fill(folder).execute();
}
private class Fill extends AsyncTask<Void, Void, List<Item>>
{
File folder;
public Fill(File f)
{
folder = f;
}
protected List<Item> doInBackground(Void... voids)
{
File[] dirs = folder.listFiles();
List<Item> dir = new ArrayList<Item>();
while( dirs == null )
{
folder = new File(folder.getParent());
if( folder == null )
return dir;
dirs = folder.listFiles();
}
for(File ff: dirs)
{
Date lastModDate = new Date(ff.lastModified());
DateFormat formater = DateFormat.getDateTimeInstance();
String date_modify = formater.format(lastModDate);
if(ff.isDirectory())
{
boolean isXashDir=false;
File[] fbuf = ff.listFiles();
int buf = 0;
if(fbuf != null&&fbuf.length<20)
{
buf = fbuf.length;
for (File valves: fbuf)
{
if (valves.isDirectory() && valves.getName().contains("valve"))
isXashDir=true;
}
}
String num_item = String.valueOf(buf);
if(buf == 0)
num_item = "Some items";
else
num_item +=" items";
if(isXashDir)
{
dir.add(new Item(ff.getName(), num_item, date_modify, ff.getAbsolutePath(), R.drawable.ic_launcher));
}
else
{
dir.add(new Item(ff.getName(), num_item, date_modify, ff.getAbsolutePath(), R.drawable.folder));
}
}
}
Collections.sort(dir);
if(folder.getName().length() > 1)
dir.add(0, new Item( "..", "Parent Directory", "", folder.getParent(), R.drawable.folder));
return dir;
}
protected void onPostExecute(List<Item> dir)
{
setTitle("Current Dir: "+folder.getName());
adapter = new FileArrayAdapter(FPicker.this,R.layout.row,dir);
delta = (ListView)findViewById(R.id.FileView);
delta.setAdapter(adapter);
delta.setOnItemClickListener(new AdapterView.OnItemClickListener()
{
@Override
public void onItemClick(AdapterView<?> parent , View v, int position, long id)
{
Item o = adapter.getItem(position);
currentDir = new File(o.getPath());
fill(currentDir);
}
});
}
}
public void onFileClick(View v)
{
Toast.makeText(this, "Chosen path : " + currentDir, Toast.LENGTH_SHORT).show();
Intent intent = new Intent();
intent.putExtra("GetPath",currentDir.toString());
setResult(RESULT_OK, intent);
finish();
}
}
class FileArrayAdapter extends ArrayAdapter<Item>
{
private Context c;
private int id;
private List<Item>items;
public FileArrayAdapter(Context context, int textViewResourceId, List<Item> objects)
{
super(context, textViewResourceId, objects);
c = context;
id = textViewResourceId;
items = objects;
}
public Item getItem(int i)
{
return items.get(i);
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
View v = convertView;
if (v == null)
{
LayoutInflater vi = (LayoutInflater)c.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
v = vi.inflate(id, null);
}
final Item finstance = items.get(position);
if (finstance != null)
{
TextView filename = (TextView) v.findViewById(R.id.filename);
TextView fileitems = (TextView) v.findViewById(R.id.fileitems);
TextView filedate = (TextView) v.findViewById(R.id.filedate);
ImageView imageicon = (ImageView) v.findViewById(R.id.fd_Icon1);
Drawable image = c.getResources().getDrawable(finstance.getImage());
imageicon.setImageDrawable(image);
if(filename!=null)
filename.setText(finstance.getName());
if(fileitems!=null)
fileitems.setText(finstance.getData());
if(filedate!=null)
filedate.setText(finstance.getDate());
}
return v;
}
}
class Item implements Comparable<Item>{
private String name;
private String data;
private String date;
private String path;
private int image;
public Item(String n,String d, String dt, String p, int img)
{
name = n;
data = d;
date = dt;
path = p;
image = img;
}
public String getName()
{
return name;
}
public String getData()
{
return data;
}
public String getDate()
{
return date;
}
public String getPath()
{
return path;
}
public int getImage()
{
return image;
}
public int compareTo(Item o)
{
if(this.name != null)
return this.name.toLowerCase().compareTo(o.getName().toLowerCase());
else
throw new IllegalArgumentException();
}
}

View file

@ -3,12 +3,46 @@ import android.content.BroadcastReceiver;
import android.content.Context; import android.content.Context;
import android.content.Intent; import android.content.Intent;
import android.util.Log; import android.util.Log;
import java.io.FileOutputStream;
import java.io.InputStream;
import android.content.SharedPreferences;
public class InstallReceiver extends BroadcastReceiver { public class InstallReceiver extends BroadcastReceiver {
private static final String TAG = "XASH3D"; private static final String TAG = "XASH3D";
@Override @Override
public void onReceive(Context context, Intent arg1) { public void onReceive(Context context, Intent arg1) {
Log.d( TAG, "Install received, extracting PAK" ); String pkgname = arg1.getData().getEncodedSchemeSpecificPart();
org.libsdl.app.SDLActivity.extractPAK( context, true ); Log.d( TAG, "Install received, package " + pkgname );
} if( context.getPackageName().equals(pkgname) )
extractPAK(context, true);
}
public static SharedPreferences mPref = null;
private static final int PAK_VERSION = 5;
public static void extractPAK(Context context, Boolean force) {
InputStream is = null;
FileOutputStream os = null;
try {
if( mPref == null )
mPref = context.getSharedPreferences("engine", 0);
if( mPref.getInt( "pakversion", 0 ) == PAK_VERSION && !force )
return;
String path = context.getFilesDir().getPath()+"/extras.pak";
is = context.getAssets().open("extras.pak");
os = new FileOutputStream(path);
byte[] buffer = new byte[1024];
int length;
while ((length = is.read(buffer)) > 0) {
os.write(buffer, 0, length);
}
os.close();
is.close();
SharedPreferences.Editor editor = mPref.edit();
editor.putInt( "pakversion", PAK_VERSION );
editor.commit();
} catch( Exception e )
{
Log.e( TAG, "Failed to extract PAK:" + e.toString() );
}
}
} }

View file

@ -2,38 +2,74 @@ package in.celest.xash3d;
import android.app.Activity; import android.app.Activity;
import android.app.Dialog; import android.app.Dialog;
import android.app.AlertDialog;
import android.os.AsyncTask;
import android.os.Bundle; import android.os.Bundle;
import android.os.Build; import android.os.Build;
import android.text.method.LinkMovementMethod; import android.text.method.LinkMovementMethod;
import android.os.Environment;
import android.view.Menu; import android.view.Menu;
import android.view.MenuItem; import android.view.MenuItem;
import android.view.View; import android.view.View;
import android.view.Window;
import android.view.WindowManager;
import android.content.Intent; import android.content.Intent;
import android.widget.EditText;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.Button;
import android.widget.TextView;
import android.content.ComponentName; import android.content.ComponentName;
import android.content.Context; import android.content.Context;
import android.content.pm.PackageManager; import android.content.pm.PackageManager;
import android.content.SharedPreferences; import android.content.SharedPreferences;
import android.content.DialogInterface; import android.content.DialogInterface;
import android.content.DialogInterface.OnDismissListener; import android.content.DialogInterface.OnDismissListener;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.CheckBox;
import android.widget.CompoundButton;
import android.widget.Button;
import android.widget.Spinner;
import android.widget.ArrayAdapter;
import android.widget.TabHost;
import android.widget.ToggleButton;
import android.widget.Toast;
import android.net.Uri; import android.net.Uri;
import android.os.Environment;
import android.util.Log;
import java.lang.reflect.Method; import java.lang.reflect.Method;
import java.util.List; import java.util.List;
import java.io.File; import java.io.File;
import java.io.ByteArrayOutputStream;
import java.io.InputStream;
import java.io.FileOutputStream;
import java.net.URLConnection;
import java.net.URL;
import org.json.*;
import in.celest.xash3d.hl.R; import in.celest.xash3d.hl.R;
public class LauncherActivity extends Activity { public class LauncherActivity extends Activity {
// public final static String ARGV = "in.celest.xash3d.MESSAGE"; // public final static String ARGV = "in.celest.xash3d.MESSAGE";
public final static int sdk = Integer.valueOf(Build.VERSION.SDK);
public final static String UPDATE_LINK = "https://api.github.com/repos/FWGS/xash3d-android-project/releases"; // releases/latest doesn't return prerelease and drafts
static EditText cmdArgs; static EditText cmdArgs;
static CheckBox useVolume;
static EditText resPath; static EditText resPath;
static ToggleButton useVolume;
static ToggleButton resizeWorkaround;
static CheckBox checkUpdates;
static CheckBox updateToBeta;
static CheckBox immersiveMode;
static SharedPreferences mPref; static SharedPreferences mPref;
static Spinner pixelSpinner;
static TextView tvResPath;
String getDefaultPath() String getDefaultPath()
{ {
File dir = Environment.getExternalStorageDirectory(); File dir = Environment.getExternalStorageDirectory();
@ -41,46 +77,125 @@ public class LauncherActivity extends Activity {
return dir.getPath() + "/xash"; return dir.getPath() + "/xash";
return "/sdcard/xash"; return "/sdcard/xash";
} }
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_launcher);
Button selectFolder = ( Button ) findViewById( R.id.button_select );
if ( Build.VERSION.SDK_INT < 21 )
selectFolder.setVisibility( View.GONE );
mPref = getSharedPreferences("engine", 0);
cmdArgs = (EditText)findViewById(R.id.cmdArgs);
cmdArgs.setText(mPref.getString("argv","-dev 3 -log"));
useVolume = ( CheckBox ) findViewById( R.id.useVolume );
useVolume.setChecked(mPref.getBoolean("usevolume",true));
resPath = ( EditText ) findViewById( R.id.cmdPath );
resPath.setText(mPref.getString("basedir", getDefaultPath()));
}
@Override
protected void onCreate(Bundle savedInstanceState)
{
super.onCreate(savedInstanceState);
this.requestWindowFeature(Window.FEATURE_NO_TITLE);
//super.setTheme( 0x01030005 );
if ( sdk >= 21 )
{
super.setTheme( 0x01030224 );
}
setContentView(R.layout.activity_launcher);
TabHost tabHost = (TabHost) findViewById(R.id.tabhost);
tabHost.setup();
TabHost.TabSpec tabSpec;
tabSpec = tabHost.newTabSpec("tabtag1");
tabSpec.setIndicator(getString(R.string.text_tab1));
tabSpec.setContent(R.id.tab1);
tabHost.addTab(tabSpec);
tabSpec = tabHost.newTabSpec("tabtag2");
tabSpec.setIndicator(getString(R.string.text_tab2));
tabSpec.setContent(R.id.tab2);
tabHost.addTab(tabSpec);
mPref = getSharedPreferences("engine", 0);
cmdArgs = (EditText) findViewById(R.id.cmdArgs);
useVolume = (ToggleButton) findViewById( R.id.useVolume );
resPath = (EditText) findViewById( R.id.cmdPath );
checkUpdates = (CheckBox)findViewById( R.id.check_updates );
updateToBeta = (CheckBox)findViewById( R.id.check_betas );
pixelSpinner = (Spinner) findViewById( R.id.pixelSpinner );
resizeWorkaround = (ToggleButton) findViewById( R.id.enableResizeWorkaround );
tvResPath = (TextView) findViewById( R.id.textView_path );
immersiveMode = (CheckBox) findViewById( R.id.immersive_mode );
final String[] list = {
"32 bit (RGBA8888)",
"24 bit (RGB888)",
"16 bit (RGB565)",
"15 bit (RGBA5551)",
"12 bit (RGBA4444)",
"8 bit (RGB332)"
};
ArrayAdapter<String> adapter = new ArrayAdapter<String>(this,android.R.layout.simple_spinner_item, list);
adapter.setDropDownViewResource(android.R.layout.simple_spinner_item);
pixelSpinner.setAdapter(adapter);
useVolume.setChecked(mPref.getBoolean("usevolume",true));
checkUpdates.setChecked(mPref.getBoolean("check_updates",true));
updateToBeta.setChecked(mPref.getBoolean("check_betas", false));
updatePath(mPref.getString("basedir", getDefaultPath()));
cmdArgs.setText(mPref.getString("argv","-dev 3 -log"));
pixelSpinner.setSelection(mPref.getInt("pixelformat", 0));
resizeWorkaround.setChecked(mPref.getBoolean("enableResizeWorkaround", true));
if( sdk >= 19 )
{
immersiveMode.setChecked(mPref.getBoolean("immersive_mode", true));
}
else
{
immersiveMode.setVisibility(View.GONE); // not available
}
resPath.setOnFocusChangeListener( new View.OnFocusChangeListener()
{
@Override
public void onFocusChange(View v, boolean hasFocus)
{
updatePath( resPath.getText().toString() );
}
} );
if(mPref.getBoolean("check_updates", true))
{
new CheckUpdate(true, updateToBeta.isChecked()).execute(UPDATE_LINK);
}
}
void updatePath( String text )
{
tvResPath.setText(getResources().getString(R.string.text_res_path) + ":\n" + text );
resPath.setText(text);
}
public void startXash(View view) public void startXash(View view)
{ {
Intent intent = new Intent(this, org.libsdl.app.SDLActivity.class); Intent intent = new Intent(this, XashActivity.class);
intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
SharedPreferences.Editor editor = mPref.edit(); SharedPreferences.Editor editor = mPref.edit();
editor.putString("argv", cmdArgs.getText().toString()); editor.putString("argv", cmdArgs.getText().toString());
editor.putBoolean("usevolume",useVolume.isChecked()); editor.putBoolean("usevolume",useVolume.isChecked());
editor.putString("basedir", resPath.getText().toString()); editor.putString("basedir", resPath.getText().toString());
editor.commit(); editor.putInt("pixelformat", pixelSpinner.getSelectedItemPosition());
editor.apply(); editor.putBoolean("enableResizeWorkaround",resizeWorkaround.isChecked());
startActivity(intent); editor.putBoolean("check_updates", checkUpdates.isChecked());
if( sdk >= 19 )
editor.putBoolean("immersive_mode", immersiveMode.isChecked());
else
editor.putBoolean("immersive_mode", false); // just in case...
editor.commit();
startActivity(intent);
} }
public void aboutXash(View view) public void aboutXash(View view)
{ {
final Activity a = this; final Activity a = this;
this.runOnUiThread(new Runnable() { this.runOnUiThread(new Runnable()
{
public void run() public void run()
{ {
final Dialog dialog = new Dialog(a); final Dialog dialog = new Dialog(a);
dialog.setContentView(R.layout.about); dialog.setContentView(R.layout.about);
dialog.setCancelable(true); dialog.setCancelable(true);
dialog.show(); dialog.show();
TextView tView6 = (TextView) dialog.findViewById(R.id.textView6); TextView tView6 = (TextView) dialog.findViewById(R.id.textView6);
tView6.setMovementMethod(LinkMovementMethod.getInstance()); tView6.setMovementMethod(LinkMovementMethod.getInstance());
@ -90,26 +205,28 @@ public class LauncherActivity extends Activity {
public void selectFolder(View view) public void selectFolder(View view)
{ {
Intent intent = new Intent("android.intent.action.OPEN_DOCUMENT_TREE"); Intent intent = new Intent(this, in.celest.xash3d.FPicker.class);
//intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
//Intent intent = new Intent("android.intent.action.OPEN_DOCUMENT_TREE");
startActivityForResult(intent, 42); startActivityForResult(intent, 42);
resPath.setEnabled(false); resPath.setEnabled(false);
} }
public void onActivityResult(int requestCode, int resultCode, Intent resultData) { public void onActivityResult(int requestCode, int resultCode, Intent resultData)
if (resultCode == RESULT_OK) { {
try{ if (resultCode == RESULT_OK)
final List<String> paths = resultData.getData().getPathSegments();
String[] parts = paths.get(1).split(":");
String storagepath = Environment.getExternalStorageDirectory().getPath() + "/";
String path = storagepath + parts[1];
if( path != null)
resPath.setText( path );
resPath.setEnabled(true);
}
catch(Exception e)
{ {
e.printStackTrace(); try
} {
if( resPath == null )
return;
updatePath(resultData.getStringExtra("GetPath"));
resPath.setEnabled(true);
}
catch(Exception e)
{
e.printStackTrace();
}
} }
resPath.setEnabled(true); resPath.setEnabled(true);
} }
@ -144,4 +261,130 @@ try{
return super.onOptionsItemSelected(item); return super.onOptionsItemSelected(item);
} }
private class CheckUpdate extends AsyncTask<String, Void, String> {
InputStream is = null;
ByteArrayOutputStream os = null;
boolean mSilent;
boolean mBeta;
public CheckUpdate( boolean silent, boolean beta )
{
mSilent = silent;
mBeta = beta;
}
protected String doInBackground(String... urls)
{
try
{
URL url = new URL(urls[0]);
is = url.openConnection().getInputStream();
os = new ByteArrayOutputStream();
byte[] buffer = new byte[8196];
int len;
while ((len = is.read(buffer)) > 0)
{
os.write(buffer, 0, len);
}
os.flush();
return os.toString();
}
catch(Exception e)
{
e.printStackTrace();
return null;
}
}
protected void onPostExecute(String result)
{
JSONArray releases = null;
try
{
if (is != null)
{
is.close();
is = null;
}
}
catch(Exception e)
{
e.printStackTrace();
}
try
{
if (os != null)
{
releases = new JSONArray(os.toString());
os.close();
os = null;
}
}
catch(Exception e)
{
e.printStackTrace();
return;
}
if( releases == null )
return;
for( int i = 0; i < releases.length(); i++ )
{
final JSONObject obj;
try
{
obj = releases.getJSONObject(i);
final String version, url, name;
final boolean beta = obj.getBoolean("prerelease");
if( beta && !mBeta )
continue;
version = obj.getString("tag_name");
url = obj.getString("html_url");
name = obj.getString("name");
Log.d("Xash", "Found: " + version +
", I: " + getString(R.string.version_string));
// this is an update
if( getString(R.string.version_string).compareTo(version) < 0 )
{
String dialog_message = String.format(getString(R.string.update_message), name);
AlertDialog.Builder builder = new AlertDialog.Builder(getBaseContext());
builder.setMessage(dialog_message)
.setPositiveButton(R.string.update, new DialogInterface.OnClickListener()
{
public void onClick(DialogInterface dialog, int id)
{
final Intent intent = new Intent(Intent.ACTION_VIEW).setData(Uri.parse(url));
startActivity(intent);
}
})
.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener()
{ public void onClick(DialogInterface dialog, int id) {} } );
builder.create().show();
}
else if( !mSilent )
{
Toast.makeText(getBaseContext(), R.string.no_updates, Toast.LENGTH_SHORT).show();
}
// No need to check other releases, so we will stop here.
break;
}
catch(Exception e)
{
e.printStackTrace();
continue;
}
}
}
}
} }

View file

@ -8,6 +8,7 @@ import android.graphics.BitmapFactory;
import android.widget.Toast; import android.widget.Toast;
import in.celest.xash3d.hl.R; import in.celest.xash3d.hl.R;
import android.widget.EditText; import android.widget.EditText;
import android.widget.Button;
import java.io.File; import java.io.File;
import java.io.FilenameFilter; import java.io.FilenameFilter;
@ -17,16 +18,26 @@ public class ShortcutActivity extends Activity
{ {
static EditText name, gamedir, pkgname, argv; static EditText name, gamedir, pkgname, argv;
String [] env = null; String [] env = null;
public static final int sdk = Integer.valueOf(Build.VERSION.SDK);
@Override @Override
protected void onCreate(Bundle bundle) protected void onCreate(Bundle bundle)
{ {
super.onCreate(bundle); super.onCreate(bundle);
//material dialog
if ( sdk >= 21 )
super.setTheme( 0x01030225 );
setContentView(R.layout.activity_shortcut); setContentView(R.layout.activity_shortcut);
Intent intent=getIntent(); Intent intent=getIntent();
name = (EditText)findViewById(R.id.shortcut_name); name = (EditText)findViewById(R.id.shortcut_name);
pkgname = (EditText)findViewById(R.id.shortcut_pkgname); pkgname = (EditText)findViewById(R.id.shortcut_pkgname);
gamedir = (EditText)findViewById(R.id.shortcut_gamedir); gamedir = (EditText)findViewById(R.id.shortcut_gamedir);
argv = (EditText)findViewById(R.id.shortcut_cmdArgs); argv = (EditText)findViewById(R.id.shortcut_cmdArgs);
((Button)findViewById( R.id.shortcut_buttonOk )).setOnClickListener(new View.OnClickListener(){
@Override
public void onClick(View v) {
saveShortcut(v);
}
});
String argvs = intent.getStringExtra("argv"); String argvs = intent.getStringExtra("argv");
if( argvs != null ) if( argvs != null )
argv.setText(argvs); argv.setText(argvs);
@ -40,7 +51,7 @@ public class ShortcutActivity extends Activity
if( names != null ) if( names != null )
name.setText(names); name.setText(names);
env = intent.getStringArrayExtra("env"); env = intent.getStringArrayExtra("env");
//name.setText("Name"); //name.setText("Name");
} }
public void saveShortcut(View view) public void saveShortcut(View view)
@ -59,7 +70,7 @@ public class ShortcutActivity extends Activity
Intent wrapIntent = new Intent(); Intent wrapIntent = new Intent();
wrapIntent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, intent); wrapIntent.putExtra(Intent.EXTRA_SHORTCUT_INTENT, intent);
wrapIntent.putExtra(Intent.EXTRA_SHORTCUT_NAME, name.getText().toString()); wrapIntent.putExtra(Intent.EXTRA_SHORTCUT_NAME, name.getText().toString());
Bitmap icon = null; Bitmap icon = null;
// Try find icon // Try find icon
int size = (int) getResources().getDimension(android.R.dimen.app_icon_size); int size = (int) getResources().getDimension(android.R.dimen.app_icon_size);
@ -88,7 +99,7 @@ public class ShortcutActivity extends Activity
return false; return false;
} }
}; };
File gamedirfile = new File(gamedirstring); File gamedirfile = new File(gamedirstring);
String files[] = gamedirfile.list(icoFilter); String files[] = gamedirfile.list(icoFilter);
icon = Bitmap.createScaledBitmap(BitmapFactory.decodeFile(gamedirstring+"/"+files[0]), size, size, false); icon = Bitmap.createScaledBitmap(BitmapFactory.decodeFile(gamedirstring+"/"+files[0]), size, size, false);

File diff suppressed because it is too large Load diff

1
src/org/json Submodule

@ -0,0 +1 @@
Subproject commit 9a81b40334ff2eba531478d013654c5d1b12ad24

View file

@ -5,7 +5,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="in.celest.xash3d.hl.test" package="in.celest.xash3d.hl.test"
android:versionCode="1" android:versionCode="1"
android:versionName="0.17-beta.2" android:versionName="0.18-beta"
android:installLocation="auto"> android:installLocation="auto">
<!-- Create a Java class extending SDLActivity and place it in a <!-- Create a Java class extending SDLActivity and place it in a
@ -54,27 +54,35 @@
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
</intent-filter> </intent-filter>
</activity> </activity>
<activity android:name="org.libsdl.app.SDLActivity" <activity android:name="in.celest.xash3d.FPicker"></activity>
<!--<activity android:name="org.libsdl.app.SDLActivity"
android:screenOrientation="sensorLandscape" android:screenOrientation="sensorLandscape"
android:configChanges="orientation|screenSize" android:configChanges="orientation|screenSize"
android:label="@string/app_name" android:label="@string/app_name"
android:taskAffinity="org.libsdl.app.SDLActivity" android:taskAffinity="org.libsdl.app.SDLActivity"
> >
<!--<intent-filter> <intent-filter>
As user can add now empty shortcut, disable this As user can add now empty shortcut, disable this
<action android:name="org.libsdl.app.SDLActivity"/> <action android:name="org.libsdl.app.SDLActivity"/>
<action android:name="android.intent.action.MAIN" /> <action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" /> <category android:name="android.intent.category.LAUNCHER" />
</intent-filter>--> </intent-filter>
<intent-filter> <intent-filter>
<action android:name="in.celest.xash3d.START" /> <action android:name="in.celest.xash3d.START" />
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
</intent-filter> </intent-filter>
</activity> </activity>-->
<!--<activity android:name="in.celest.xash3d.XashActivity" <activity android:name="in.celest.xash3d.XashActivity"
android:screenOrientation="landscape" android:screenOrientation="sensorLandscape"
android:configChanges="orientation|screenSize"
android:windowSoftInputMode="adjustResize"
android:label="@string/app_name"> android:label="@string/app_name">
</activity> --> <intent-filter>
<action android:name="in.celest.xash3d.START" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
</activity>
<receiver android:name="in.celest.xash3d.InstallReceiver"> <receiver android:name="in.celest.xash3d.InstallReceiver">
<intent-filter android:priority="100"> <intent-filter android:priority="100">
<category android:name="android.intent.category.DEFAULT" /> <category android:name="android.intent.category.DEFAULT" />
@ -90,7 +98,7 @@
</application> </application>
<!-- Android 2.3 --> <!-- Android 2.3 -->
<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="9" /> <uses-sdk android:minSdkVersion="3" android:targetSdkVersion="9" />
<!-- OpenGL ES 1.1 --> <!-- OpenGL ES 1.1 -->
<uses-feature android:glEsVersion="0x00010000" /> <uses-feature android:glEsVersion="0x00010000" />

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.9 KiB

After

Width:  |  Height:  |  Size: 5.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.5 KiB

After

Width:  |  Height:  |  Size: 3.4 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.1 KiB

After

Width:  |  Height:  |  Size: 7.2 KiB

View file

@ -65,19 +65,18 @@ import android.content.*;
*/ */
public class SDLActivity extends Activity { public class SDLActivity extends Activity {
private static final String TAG = "SDL"; private static final String TAG = "SDL";
private static final int PAK_VERSION = 5;
// Keep track of the paused state // Keep track of the paused state
public static boolean mIsPaused, mIsSurfaceReady, mHasFocus, mUseVolume; public static boolean mIsPaused, mIsSurfaceReady, mHasFocus, mUseVolume;
public static boolean mExitCalledFromJava; public static boolean mExitCalledFromJava;
/** If shared libraries (e.g. SDL or the native application) could not be loaded. */ /** If shared libraries (e.g. SDL or the native application) could not be loaded. */
public static boolean mBrokenLibraries; public static boolean mBrokenLibraries;
// If we want to separate mouse and touch events. // If we want to separate mouse and touch events.
// This is only toggled in native code when a hint is set! // This is only toggled in native code when a hint is set!
public static boolean mSeparateMouseAndTouch; public static boolean mSeparateMouseAndTouch;
private static Vibrator mVibrator; private static Vibrator mVibrator;
// Main components // Main components
@ -95,7 +94,7 @@ public class SDLActivity extends Activity {
// Preferences // Preferences
public static SharedPreferences mPref = null; public static SharedPreferences mPref = null;
// Arguments // Arguments
public static String[] mArgv; public static String[] mArgv;
/** /**
@ -153,15 +152,15 @@ public class SDLActivity extends Activity {
Log.v("SDL", "Model: " + android.os.Build.MODEL); Log.v("SDL", "Model: " + android.os.Build.MODEL);
Log.v("SDL", "onCreate():" + mSingleton); Log.v("SDL", "onCreate():" + mSingleton);
super.onCreate(savedInstanceState); super.onCreate(savedInstanceState);
// fullscreen // fullscreen
requestWindowFeature(Window.FEATURE_NO_TITLE); requestWindowFeature(Window.FEATURE_NO_TITLE);
if(Build.VERSION.SDK_INT >= 12) { if(Build.VERSION.SDK_INT >= 12) {
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN, getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN); WindowManager.LayoutParams.FLAG_FULLSCREEN);
} }
// keep screen on // keep screen on
getWindow().setFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON, getWindow().setFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON,
WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
@ -205,7 +204,7 @@ public class SDLActivity extends Activity {
return; return;
} }
Intent intent=getIntent(); Intent intent=getIntent();
String argv = intent.getStringExtra("argv"); String argv = intent.getStringExtra("argv");
if(argv == null) argv = mPref.getString("argv", "-dev 3 -log"); if(argv == null) argv = mPref.getString("argv", "-dev 3 -log");
@ -220,13 +219,13 @@ public class SDLActivity extends Activity {
String basedir = intent.getStringExtra("basedir"); String basedir = intent.getStringExtra("basedir");
if(basedir == null) if(basedir == null)
basedir = mPref.getString("basedir","/sdcard/xash/"); basedir = mPref.getString("basedir","/sdcard/xash/");
setenv("XASH3D_BASEDIR", basedir, true); setenv("XASH3D_BASEDIR", basedir, true);
setenv("XASH3D_ENGLIBDIR", getFilesDir().getParentFile().getPath() + "/lib", true); setenv("XASH3D_ENGLIBDIR", getFilesDir().getParentFile().getPath() + "/lib", true);
setenv("XASH3D_GAMELIBDIR", gamelibdir, true); setenv("XASH3D_GAMELIBDIR", gamelibdir, true);
setenv("XASH3D_GAMEDIR", gamedir, true); setenv("XASH3D_GAMEDIR", gamedir, true);
extractPAK(this, false); in.celest.xash3d.InstallReceiver.extractPAK(this, false);
setenv("XASH3D_EXTRAS_PAK1", getFilesDir().getPath() + "/extras.pak", true); setenv("XASH3D_EXTRAS_PAK1", getFilesDir().getPath() + "/extras.pak", true);
String pakfile = intent.getStringExtra("pakfile"); String pakfile = intent.getStringExtra("pakfile");
if( pakfile != null && pakfile != "" ) if( pakfile != null && pakfile != "" )
@ -271,7 +270,7 @@ public class SDLActivity extends Activity {
} }
if( mVibrator != null ) mVibrator.cancel(); if( mVibrator != null ) mVibrator.cancel();
SDLActivity.handlePause(); SDLActivity.handlePause();
} }
@ -322,10 +321,10 @@ public class SDLActivity extends Activity {
and kills process while engine is writing config. and kills process while engine is writing config.
it results in configuration loss, so we preferred to disable it it results in configuration loss, so we preferred to disable it
*/ */
/* /*
if( mVibrator != null ) mVibrator.cancel(); if( mVibrator != null ) mVibrator.cancel();
if (SDLActivity.mBrokenLibraries) { if (SDLActivity.mBrokenLibraries) {
super.onDestroy(); super.onDestroy();
// Reset everything in case the user re opens the app // Reset everything in case the user re opens the app
@ -352,7 +351,7 @@ public class SDLActivity extends Activity {
super.onDestroy(); super.onDestroy();
// Reset everything in case the user re opens the app // Reset everything in case the user re opens the app
finish(); finish();
} }
@Override @Override
@ -511,23 +510,23 @@ public class SDLActivity extends Activity {
public static native int nativeRemoveJoystick(int device_id); public static native int nativeRemoveJoystick(int device_id);
public static native String nativeGetHint(String name); public static native String nativeGetHint(String name);
public static native int setenv(String key, String value, boolean overwrite); public static native int setenv(String key, String value, boolean overwrite);
/** /**
* This method is called by SDL using JNI. * This method is called by SDL using JNI.
*/ */
public static void flipBuffers() { public static void flipBuffers() {
SDLActivity.nativeFlipBuffers(); SDLActivity.nativeFlipBuffers();
} }
/** /**
* This method is called by Xash3D engine using JNI * This method is called by Xash3D engine using JNI
*/ */
public void vibrate( short time ) { public void vibrate( short time ) {
mVibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE); mVibrator = (Vibrator) getSystemService(Context.VIBRATOR_SERVICE);
mVibrator.vibrate( time ); mVibrator.vibrate( time );
} }
/** /**
* This method is called by SDL using JNI. * This method is called by SDL using JNI.
*/ */
@ -1033,34 +1032,7 @@ public class SDLActivity extends Activity {
Log.e( TAG, "Failed to extract PAK:" + e.toString() ); Log.e( TAG, "Failed to extract PAK:" + e.toString() );
} }
}*/ }*/
public static void extractPAK(Context context, Boolean force) {
InputStream is = null;
FileOutputStream os = null;
try {
if( mPref == null )
mPref = context.getSharedPreferences("engine", 0);
if( mPref.getInt( "pakversion", 0 ) == PAK_VERSION && !force )
return;
String path = context.getFilesDir().getPath()+"/extras.pak";
is = context.getAssets().open("extras.pak");
os = new FileOutputStream(path);
byte[] buffer = new byte[1024];
int length;
while ((length = is.read(buffer)) > 0) {
os.write(buffer, 0, length);
}
os.close();
is.close();
SharedPreferences.Editor editor = mPref.edit();
editor.putInt( "pakversion", PAK_VERSION );
editor.commit();
editor.apply();
} catch( Exception e )
{
Log.e( TAG, "Failed to extract PAK:" + e.toString() );
}
}
} }
/** /**
@ -1070,7 +1042,7 @@ class SDLMain implements Runnable {
@Override @Override
public void run() { public void run() {
// Runs SDL_main() // Runs SDL_main()
SDLActivity.nativeInit(SDLActivity.mArgv); SDLActivity.nativeInit(SDLActivity.mArgv);
//Log.v("SDL", "SDL thread terminated"); //Log.v("SDL", "SDL thread terminated");
} }
} }
@ -1278,7 +1250,7 @@ View.OnKeyListener, View.OnTouchListener, SensorEventListener {
public boolean onTouch(View v, MotionEvent event) { public boolean onTouch(View v, MotionEvent event) {
/* Ref: http://developer.android.com/training/gestures/multi.html */ /* Ref: http://developer.android.com/training/gestures/multi.html */
final int touchDevId = event.getDeviceId(); final int touchDevId = event.getDeviceId();
final int pointerCount = event.getPointerCount(); final int pointerCount = event.getPointerCount();
int action = event.getActionMasked(); int action = event.getActionMasked();

@ -1 +1 @@
Subproject commit 58d6e0d91034a8b44491c017972b88d7eddaf91f Subproject commit 3e0b87b9e2c66ae8d80686f44d540e36f9753b35