Option for main() commandline parameters in ChangeAppSettings.sh, fixed UQM translation packs
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
CHANGE_APP_SETTINGS_VERSION=14
|
CHANGE_APP_SETTINGS_VERSION=15
|
||||||
AUTO=
|
AUTO=
|
||||||
|
|
||||||
if [ "X$1" = "X-a" ]; then
|
if [ "X$1" = "X-a" ]; then
|
||||||
@@ -254,7 +254,7 @@ fi
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$AUTO" ]; then
|
if [ -z "$AUTO" ]; then
|
||||||
echo -n "\nAditional LDFLAGS for application ($AppLdflags): "
|
echo -n "\nAdditional LDFLAGS for application ($AppLdflags): "
|
||||||
read var
|
read var
|
||||||
if [ -n "$var" ] ; then
|
if [ -n "$var" ] ; then
|
||||||
AppLdflags="$var"
|
AppLdflags="$var"
|
||||||
@@ -278,6 +278,14 @@ if [ -n "$var" ] ; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
if [ -z "$AUTO" ]; then
|
||||||
|
echo -n "\nApplication command line parameters, including app name as 0-th param ($AppCmdline): "
|
||||||
|
read var
|
||||||
|
if [ -n "$var" ] ; then
|
||||||
|
AppCmdline="$var"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
if [ -z "$ReadmeText" -o -z "$AUTO" ]; then
|
if [ -z "$ReadmeText" -o -z "$AUTO" ]; then
|
||||||
echo -n "\nHere you may type some short readme text that will be shown when app data is downloaded."
|
echo -n "\nHere you may type some short readme text that will be shown when app data is downloaded."
|
||||||
echo -n "\nCurrent text:\n"
|
echo -n "\nCurrent text:\n"
|
||||||
@@ -332,6 +340,7 @@ echo AppCflags=\'$AppCflags\' >> AndroidAppSettings.cfg
|
|||||||
echo AppLdflags=\'$AppLdflags\' >> AndroidAppSettings.cfg
|
echo AppLdflags=\'$AppLdflags\' >> AndroidAppSettings.cfg
|
||||||
echo AppSubdirsBuild=\'$AppSubdirsBuild\' >> AndroidAppSettings.cfg
|
echo AppSubdirsBuild=\'$AppSubdirsBuild\' >> AndroidAppSettings.cfg
|
||||||
echo AppUseCrystaXToolchain=$AppUseCrystaXToolchain >> AndroidAppSettings.cfg
|
echo AppUseCrystaXToolchain=$AppUseCrystaXToolchain >> AndroidAppSettings.cfg
|
||||||
|
echo AppCmdline=\'$AppCmdline\' >> AndroidAppSettings.cfg
|
||||||
echo ReadmeText=\'$ReadmeText\' >> AndroidAppSettings.cfg
|
echo ReadmeText=\'$ReadmeText\' >> AndroidAppSettings.cfg
|
||||||
|
|
||||||
AppShortName=`echo $AppName | sed 's/ //g'`
|
AppShortName=`echo $AppName | sed 's/ //g'`
|
||||||
@@ -486,6 +495,7 @@ cat project/src/Globals.java | \
|
|||||||
sed "s/public static int AppTouchscreenKeyboardKeysAmount = .*;/public static int AppTouchscreenKeyboardKeysAmount = $AppTouchscreenKeyboardKeysAmount;/" | \
|
sed "s/public static int AppTouchscreenKeyboardKeysAmount = .*;/public static int AppTouchscreenKeyboardKeysAmount = $AppTouchscreenKeyboardKeysAmount;/" | \
|
||||||
sed "s/public static int AppTouchscreenKeyboardKeysAmountAutoFire = .*;/public static int AppTouchscreenKeyboardKeysAmountAutoFire = $AppTouchscreenKeyboardKeysAmountAutoFire;/" | \
|
sed "s/public static int AppTouchscreenKeyboardKeysAmountAutoFire = .*;/public static int AppTouchscreenKeyboardKeysAmountAutoFire = $AppTouchscreenKeyboardKeysAmountAutoFire;/" | \
|
||||||
sed "s%public static String ReadmeText = .*%public static String ReadmeText = \"$ReadmeText\".replace(\"^\",\"\\\n\");%" | \
|
sed "s%public static String ReadmeText = .*%public static String ReadmeText = \"$ReadmeText\".replace(\"^\",\"\\\n\");%" | \
|
||||||
|
sed "s%public static String CommandLine = .*%public static String CommandLine = \"$AppCmdline\";%" | \
|
||||||
sed "s/public LoadLibrary() .*/public LoadLibrary() { $LibrariesToLoad };/" > \
|
sed "s/public LoadLibrary() .*/public LoadLibrary() { $LibrariesToLoad };/" > \
|
||||||
project/src/Globals.java.1
|
project/src/Globals.java.1
|
||||||
mv -f project/src/Globals.java.1 project/src/Globals.java
|
mv -f project/src/Globals.java.1 project/src/Globals.java
|
||||||
|
|||||||
@@ -22,6 +22,8 @@ class Globals {
|
|||||||
// Readme text to be shown on download page
|
// Readme text to be shown on download page
|
||||||
public static String ReadmeText = "^You may press \"Home\" now - the data will be downloaded in background".replace("^","\n");
|
public static String ReadmeText = "^You may press \"Home\" now - the data will be downloaded in background".replace("^","\n");
|
||||||
|
|
||||||
|
public static String CommandLine = "";
|
||||||
|
|
||||||
public static boolean AppUsesMouse = false;
|
public static boolean AppUsesMouse = false;
|
||||||
|
|
||||||
public static boolean AppNeedsTwoButtonMouse = false;
|
public static boolean AppNeedsTwoButtonMouse = false;
|
||||||
|
|||||||
@@ -210,7 +210,7 @@ class DemoRenderer extends GLSurfaceView_SDL.Renderer {
|
|||||||
// Tweak video thread priority, if user selected big audio buffer
|
// Tweak video thread priority, if user selected big audio buffer
|
||||||
if(Globals.AudioBufferConfig >= 2)
|
if(Globals.AudioBufferConfig >= 2)
|
||||||
Thread.currentThread().setPriority( (Thread.NORM_PRIORITY + Thread.MIN_PRIORITY) / 2 ); // Lower than normal
|
Thread.currentThread().setPriority( (Thread.NORM_PRIORITY + Thread.MIN_PRIORITY) / 2 ); // Lower than normal
|
||||||
nativeInit(); // Calls main() and never returns, hehe - we'll call eglSwapBuffers() from native code
|
nativeInit(Globals.CommandLine); // Calls main() and never returns, hehe - we'll call eglSwapBuffers() from native code
|
||||||
System.exit(0); // The main() returns here - I don't bother with deinit stuff, just terminate process
|
System.exit(0); // The main() returns here - I don't bother with deinit stuff, just terminate process
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -249,7 +249,7 @@ class DemoRenderer extends GLSurfaceView_SDL.Renderer {
|
|||||||
};
|
};
|
||||||
|
|
||||||
private native void nativeInitJavaCallbacks();
|
private native void nativeInitJavaCallbacks();
|
||||||
private native void nativeInit();
|
private native void nativeInit(String CommandLine);
|
||||||
private native void nativeResize(int w, int h);
|
private native void nativeResize(int w, int h);
|
||||||
private native void nativeDone();
|
private native void nativeDone();
|
||||||
private native void nativeGlContextLost();
|
private native void nativeGlContextLost();
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
# The application settings for Android libSDL port
|
# The application settings for Android libSDL port
|
||||||
AppSettingVersion=14
|
AppSettingVersion=15
|
||||||
LibSdlVersion=1.2
|
LibSdlVersion=1.2
|
||||||
AppName="Ur-Quan Masters"
|
AppName="Ur-Quan Masters"
|
||||||
AppFullName=com.sourceforge.sc2
|
AppFullName=com.sourceforge.sc2
|
||||||
ScreenOrientation=h
|
ScreenOrientation=h
|
||||||
InhibitSuspend=n
|
InhibitSuspend=n
|
||||||
AppDataDownloadUrl="Game data is 14 Mb|https://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/sc2-data.zip/download|https://sites.google.com/site/xpelyax/Home/sc2-data.zip?attredirects=0&d=1|http://sitesproxy.goapk.com/site/xpelyax/Home/sc2-data.zip^3DO remixed music (19 Mb) - enable it in Setup->Sound Options->3DO Remixes|:addons/3domusic/3domusic.zip:https://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/3domusic.zip/download|:addons/3domusic/3domusic.zip:https://sites.google.com/site/xpelyax/Home/3domusic.zip?attredirects=0&d=1|:addons/3domusic/3domusic.zip:http://sitesproxy.goapk.com/site/xpelyax/Home/3domusic.zip^UQM music remix pack (150 Mb) - enable it in Setup->Sound Options->UQM Remixes|:addons/remix/remix.zip:https://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/remix.zip/download^3DO voice (115 Mb) - go to Setup->Sound Options and increase Voice volume from zero|:addons/3dovoice/3dovoice.zip:https://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/3dovoice.zip/download^Russian translation|http://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/translations/russian.zip/download^Deutsch translation|http://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/translations/deutsch.zip/download^Spanish translation|http://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/translations/spanish.zip/download^Slovak translation|http://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/translations/slovak.zip/download^Finnish translation|http://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/translations/finnish.zip/download^3DO video support - after installing this pack copy all files from|https://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/3dovideo.zip/download^your 3DO Star Control II game CD from 'duckart' dir to the SD card to dir|https://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/3dovideo.zip/download^'app-data/com.sourceforge.sc2/addons/3dovideo', to extract files from 3DO disk use|https://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/3dovideo.zip/download^'3DO Commander' or 'uncd-rom' apps from http://madroms.free.fr/3do/|https://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/3dovideo.zip/download^Then from the game change 'Setup->PC/3DO compat->Cutscenes' to Movies, and restart game|https://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/3dovideo.zip/download"
|
AppDataDownloadUrl="Game data is 14 Mb|https://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/sc2-data.zip/download|https://sites.google.com/site/xpelyax/Home/sc2-data.zip?attredirects=0&d=1|http:// sitesproxy.goapk.com/site/xpelyax/Home/sc2-data.zip^3DO remixed music (19 Mb) - enable it in Setup->Sound Options->3DO Remixes|:addons/3domusic/3domusic.zip:https://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/3domusic.zip/download|:addons/3domusic/3domusic.zip:https://sites. google.com/site/xpelyax/Home/3domusic.zip?attredirects=0&d=1|:addons/3domusic/3domusic.zip:http://sitesproxy.goapk.com/site/xpelyax/Home/3domusic.zip^UQM music remix pack (150 Mb) - enable it in Setup->Sound Options->UQM Remixes|:addons/remix/remix.zip:https://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/remix.zip/download^3DO voice (115 Mb) - go to Setup->Sound Options and increase Voice volume from zero|:addons/3dovoice/3dovoice.zip:https://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/3dovoice.zip/download^Russian translation|:addons/lang/shadow-content/lang.zip:http://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/translations/2/russian.zip/download^Deutsch translation|:addons/lang/shadow-content/lang.zip:http://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/translations/2/deutsch.zip/download^Spanish translation|:addons/lang/shadow-content/lang.zip:http://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/translations/2/spanish.zip/download^Slovak translation|:addons/lang/shadow-content/lang.zip:http://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/translations/2/slovak.zip/download^Finnish translation|:addons/lang/shadow-content/lang.zip:http://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/translations/2/finnish.zip/download^3DO video support - after installing this pack copy all files from|https://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/3dovideo.zip/download^your 3DO Star Control II game CD from 'duckart' dir to the SD card to dir|https://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/3dovideo.zip/download^'app-data/com.sourceforge.sc2/addons/3dovideo', to extract files from 3DO disk use|https://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/3dovideo.zip/download^'3DO Commander' or 'uncd-rom' apps from http://madroms.free.fr/3do/|https://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/3dovideo.zip/download^Then from the game change 'Setup->PC/3DO compat->Cutscenes' to Movies, and restart game|https://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/3dovideo.zip/download"
|
||||||
SdlVideoResize=y
|
SdlVideoResize=y
|
||||||
SdlVideoResizeKeepAspect=n
|
SdlVideoResizeKeepAspect=n
|
||||||
NeedDepthBuffer=n
|
NeedDepthBuffer=n
|
||||||
@@ -21,12 +21,13 @@ RedefinedKeys="RETURN RSHIFT KP_PLUS KP_MINUS RCTRL F10"
|
|||||||
AppTouchscreenKeyboardKeysAmount=2
|
AppTouchscreenKeyboardKeysAmount=2
|
||||||
AppTouchscreenKeyboardKeysAmountAutoFire=0
|
AppTouchscreenKeyboardKeysAmountAutoFire=0
|
||||||
MultiABI=n
|
MultiABI=n
|
||||||
AppVersionCode=06917
|
AppVersionCode=06918
|
||||||
AppVersionName="0.6.9.17 - Added Russian, Deutsch, Spanish, Slovak and Finnish translations for game dialogs"
|
AppVersionName="0.6.9.18 - translation packages work for real now"
|
||||||
CompiledLibraries="sdl_image tremor ogg"
|
CompiledLibraries="sdl_image tremor ogg"
|
||||||
CustomBuildScript=n
|
CustomBuildScript=n
|
||||||
AppCflags='-O3 -DTHREADLIB_SDL=1 -DTIMELIB=SDL -DOVCODEC_TREMOR=1 -DNETPLAY=1 -DHAVE_REGEX=1 -DHAVE_GETOPT_LONG=1 -DHAVE_ZIP=1 -DHAVE_JOYSTICK=1 -DDIRECTIONAL_JOYSTICK_MELEE=1'
|
AppCflags='-O3 -DTHREADLIB_SDL=1 -DTIMELIB=SDL -DOVCODEC_TREMOR=1 -DNETPLAY=1 -DHAVE_REGEX=1 -DHAVE_GETOPT_LONG=1 -DHAVE_ZIP=1 -DHAVE_JOYSTICK=1 -DDIRECTIONAL_JOYSTICK_MELEE=1'
|
||||||
AppLdflags=''
|
AppLdflags=''
|
||||||
AppSubdirsBuild=''
|
AppSubdirsBuild=''
|
||||||
AppUseCrystaXToolchain=n
|
AppUseCrystaXToolchain=n
|
||||||
|
AppCmdline='uqm --addon lang'
|
||||||
ReadmeText='^You may press "Home" now - the data will be downloaded in background'
|
ReadmeText='^You may press "Home" now - the data will be downloaded in background'
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -14,16 +14,16 @@
|
|||||||
#define CONTENTDIR ""
|
#define CONTENTDIR ""
|
||||||
|
|
||||||
/* Directory where game data will be stored */
|
/* Directory where game data will be stored */
|
||||||
#define USERDIR "/data/data/com.sourceforge.sc2/files/config/"
|
#define USERDIR "config/"
|
||||||
|
|
||||||
/* Directory where config files will be stored */
|
/* Directory where config files will be stored */
|
||||||
#define CONFIGDIR USERDIR
|
#define CONFIGDIR USERDIR
|
||||||
|
|
||||||
/* Directory where supermelee teams will be stored */
|
/* Directory where supermelee teams will be stored */
|
||||||
#define MELEEDIR "${UQM_CONFIG_DIR}/teams/"
|
#define MELEEDIR "teams/"
|
||||||
|
|
||||||
/* Directory where save games will be stored */
|
/* Directory where save games will be stored */
|
||||||
#define SAVEDIR "${UQM_CONFIG_DIR}/save/"
|
#define SAVEDIR "save/"
|
||||||
|
|
||||||
/* Defined if words are stored with the most significant byte first */
|
/* Defined if words are stored with the most significant byte first */
|
||||||
#ifdef __ARMEL__
|
#ifdef __ARMEL__
|
||||||
|
|||||||
@@ -27,11 +27,13 @@
|
|||||||
static int isSdcardUsed = 0;
|
static int isSdcardUsed = 0;
|
||||||
|
|
||||||
extern C_LINKAGE void
|
extern C_LINKAGE void
|
||||||
JAVA_EXPORT_NAME(DemoRenderer_nativeInit) ( JNIEnv* env, jobject thiz )
|
JAVA_EXPORT_NAME(DemoRenderer_nativeInit) ( JNIEnv* env, jobject thiz, jstring cmdline )
|
||||||
{
|
{
|
||||||
int argc = 1;
|
|
||||||
char * argv[] = { "sdl" };
|
|
||||||
char curdir[512];
|
char curdir[512];
|
||||||
|
const jbyte *str;
|
||||||
|
int argc = 1;
|
||||||
|
char ** argv = { "sdl" };
|
||||||
|
|
||||||
if( isSdcardUsed )
|
if( isSdcardUsed )
|
||||||
{
|
{
|
||||||
strcpy(curdir, "/sdcard/app-data/");
|
strcpy(curdir, "/sdcard/app-data/");
|
||||||
@@ -46,8 +48,45 @@ JAVA_EXPORT_NAME(DemoRenderer_nativeInit) ( JNIEnv* env, jobject thiz )
|
|||||||
chdir(curdir);
|
chdir(curdir);
|
||||||
setenv("HOME", curdir, 1);
|
setenv("HOME", curdir, 1);
|
||||||
|
|
||||||
__android_log_print(ANDROID_LOG_INFO, "libSDL", "Calling SDL_main()" );
|
str = (*env)->GetStringUTFChars(env, cmdline, NULL);
|
||||||
|
|
||||||
|
if (str != NULL && strlen(str) > 0)
|
||||||
|
{
|
||||||
|
char * str1, * str2;
|
||||||
|
argc = 0;
|
||||||
|
str1 = strdup(str);
|
||||||
|
str2 = str1;
|
||||||
|
int i = 0;
|
||||||
|
while(str2)
|
||||||
|
{
|
||||||
|
argc++;
|
||||||
|
str2 = strchr(str2, ' ');
|
||||||
|
if(!str2)
|
||||||
|
break;
|
||||||
|
str2++;
|
||||||
|
}
|
||||||
|
|
||||||
|
argv = (char **)malloc(argc*sizeof(char *));
|
||||||
|
str2 = str1;
|
||||||
|
while(str2)
|
||||||
|
{
|
||||||
|
argv[i] = str2;
|
||||||
|
i++;
|
||||||
|
str2 = strchr(str2, ' ');
|
||||||
|
if(str2)
|
||||||
|
*str2 = 0;
|
||||||
|
else
|
||||||
|
break;
|
||||||
|
str2++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
__android_log_print(ANDROID_LOG_INFO, "libSDL", "Calling SDL_main(\"%s\")", str);
|
||||||
|
|
||||||
|
(*env)->ReleaseStringUTFChars(env, cmdline, str);
|
||||||
|
|
||||||
main( argc, argv );
|
main( argc, argv );
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
extern C_LINKAGE void
|
extern C_LINKAGE void
|
||||||
|
|||||||
Reference in New Issue
Block a user