Integrated Michi's changes to accelerometer joystick and to video aspect ratio

This commit is contained in:
pelya
2010-10-15 16:04:42 +03:00
parent ebaff58990
commit a8f3d8b6b7
19 changed files with 152 additions and 65 deletions

View File

@@ -1,6 +1,6 @@
#!/bin/sh
CHANGE_APP_SETTINGS_VERSION=10
CHANGE_APP_SETTINGS_VERSION=11
AUTO=
if [ "X$1" = "X-a" ]; then
@@ -72,6 +72,13 @@ if [ -n "$var" ] ; then
SdlVideoResize="$var"
fi
echo -n "\nApplication resizing should preserve the aspect ratio, creating black bars (y) or (n) ($SdlVideoResizeKeepAspect): "
read var
if [ -n "$var" ] ; then
SdlVideoResizeKeepAspect="$var"
fi
echo -n "\nEnable OpenGL depth buffer (needed only for 3-d applications, small speed decrease) (y) or (n) ($NeedDepthBuffer): "
read var
if [ -n "$var" ] ; then
@@ -110,6 +117,13 @@ if [ -n "$var" ] ; then
NonBlockingSwapBuffers="$var"
fi
echo -n "\nPrevent device from going to suspend mode while application is running (y/n) ($InhibitSuspend): "
read var
if [ -n "$var" ] ; then
InhibitSuspend="$var"
fi
echo -n "\nRedefine common keys to SDL keysyms: TOUCHSCREEN SEARCH/CALL/DPAD_CENTER VOLUMEUP VOLUMEDOWN MENU BACK CAMERA ENTER DEL"
echo -n "\nMENU and BACK hardware keys and TOUCHSCREEN virtual 'key' are available on all devices, other keys may be absent"
echo -n "\nThe same key values are used if touchscreen keyboard is enabled, except for MENU and BACK\n($RedefinedKeys)\n: "
@@ -217,8 +231,10 @@ echo LibSdlVersion=$LibSdlVersion >> AndroidAppSettings.cfg
echo AppName=\"$AppName\" >> AndroidAppSettings.cfg
echo AppFullName=$AppFullName >> AndroidAppSettings.cfg
echo ScreenOrientation=$ScreenOrientation >> AndroidAppSettings.cfg
echo InhibitSuspend=$InhibitSuspend >> AndroidAppSettings.cfg
echo AppDataDownloadUrl=\"$AppDataDownloadUrl\" >> AndroidAppSettings.cfg
echo SdlVideoResize=$SdlVideoResize >> AndroidAppSettings.cfg
echo SdlVideoResizeKeepAspect=$SdlVideoResizeKeepAspect >> AndroidAppSettings.cfg
echo NeedDepthBuffer=$NeedDepthBuffer >> AndroidAppSettings.cfg
echo AppUsesMouse=$AppUsesMouse >> AndroidAppSettings.cfg
echo AppNeedsArrowKeys=$AppNeedsArrowKeys >> AndroidAppSettings.cfg
@@ -245,21 +261,38 @@ AppFullNameUnderscored=`echo $AppFullName | sed 's/[.]/_/g'`
AppSharedLibrariesPath=/data/data/$AppFullName/lib
ScreenOrientation1=portrait
HorizontalOrientation=false
if [ "$ScreenOrientation" = "h" ] ; then
ScreenOrientation1=landscape
HorizontalOrientation=true
fi
AppDataDownloadUrl1="`echo $AppDataDownloadUrl | sed 's/[&]/%26/g'`"
if [ "$SdlVideoResize" = "y" ] ; then
SdlVideoResize=1
else
SdlVideoResize=0
fi
if [ "$SdlVideoResizeKeepAspect" = "y" ] ; then
SdlVideoResizeKeepAspect=1
else
SdlVideoResizeKeepAspect=0
fi
if [ "$InhibitSuspend" = "y" ] ; then
InhibitSuspend=true
else
InhibitSuspend=false
fi
if [ "$NeedDepthBuffer" = "y" ] ; then
NeedDepthBuffer=true
else
NeedDepthBuffer=false
fi
MouseKeycode=UNKNOWN
if [ "$AppUsesMouse" = "y" ] ; then
AppUsesMouse=true
@@ -269,16 +302,19 @@ else
MouseKeycode=$AppUsesMouse
AppUsesMouse=false
fi
if [ "$AppNeedsArrowKeys" = "y" ] ; then
AppNeedsArrowKeys=true
else
AppNeedsArrowKeys=false
fi
if [ "$AppUsesJoystick" = "y" ] ; then
AppUsesJoystick=true
else
AppUsesJoystick=false
fi
if [ "$AppUsesMultitouch" = "y" ] ; then
AppUsesMultitouch=true
else
@@ -337,6 +373,7 @@ cat project/src/Globals.java | \
sed "s@public static String DataDownloadUrl = .*@public static String DataDownloadUrl = \"$AppDataDownloadUrl1\";@" | \
sed "s/public static boolean NeedDepthBuffer = .*;/public static boolean NeedDepthBuffer = $NeedDepthBuffer;/" | \
sed "s/public static boolean HorizontalOrientation = .*;/public static boolean HorizontalOrientation = $HorizontalOrientation;/" | \
sed "s/public static boolean InhibitSuspend = .*;/public static boolean InhibitSuspend = $InhibitSuspend;/" | \
sed "s/public static boolean AppUsesMouse = .*;/public static boolean AppUsesMouse = $AppUsesMouse;/" | \
sed "s/public static boolean AppNeedsArrowKeys = .*;/public static boolean AppNeedsArrowKeys = $AppNeedsArrowKeys;/" | \
sed "s/public static boolean AppUsesJoystick = .*;/public static boolean AppUsesJoystick = $AppUsesJoystick;/" | \
@@ -354,6 +391,7 @@ cat project/jni/Android.mk | \
sed "s/SDL_JAVA_PACKAGE_PATH := .*/SDL_JAVA_PACKAGE_PATH := $AppFullNameUnderscored/" | \
sed "s^SDL_CURDIR_PATH := .*^SDL_CURDIR_PATH := $DataPath^" | \
sed "s^SDL_VIDEO_RENDER_RESIZE := .*^SDL_VIDEO_RENDER_RESIZE := $SdlVideoResize^" | \
sed "s^SDL_VIDEO_RENDER_RESIZE_KEEP_ASPECT := .*^SDL_VIDEO_RENDER_RESIZE_KEEP_ASPECT := $SdlVideoResizeKeepAspect^" | \
sed "s^COMPILED_LIBRARIES := .*^COMPILED_LIBRARIES := $CompiledLibraries^" | \
sed "s^APPLICATION_ADDITIONAL_CFLAGS :=.*^APPLICATION_ADDITIONAL_CFLAGS := $AppCflags^" | \
sed "s^APPLICATION_ADDITIONAL_LDFLAGS :=.*^APPLICATION_ADDITIONAL_LDFLAGS := $AppLdflags^" | \

View File

@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="de.schwardtnet.alienblaster"
android:versionCode="110011"
android:versionName="1.1.0.11 - fixed keys stuck sometimes for on-screen keyboard, fixed restoring app from background"
package="org.enigmagame.enigma"
android:versionCode="1"
android:versionName="0.1"
android:installLocation="preferExternal"
>
<application android:label="@string/app_name"

View File

@@ -1,6 +1,6 @@
# The namespace in Java file, with dots replaced with underscores
SDL_JAVA_PACKAGE_PATH := de_schwardtnet_alienblaster
SDL_JAVA_PACKAGE_PATH := org_enigmagame_enigma
# Path to shared libraries - Android 1.6 cannot load them properly, thus we have to specify absolute path here
# SDL_SHARED_LIBRARIES_PATH := /data/data/de.schwardtnet.alienblaster/lib
@@ -10,7 +10,7 @@ SDL_JAVA_PACKAGE_PATH := de_schwardtnet_alienblaster
# Typically /sdcard/alienblaster
# Or /data/data/de.schwardtnet.alienblaster/files if you're planning to unpack data in application private folder
# Your application will just set current directory there
SDL_CURDIR_PATH := de.schwardtnet.alienblaster
SDL_CURDIR_PATH := org.enigmagame.enigma
# Android Dev Phone G1 has trackball instead of cursor keys, and
# sends trackball movement events as rapid KeyDown/KeyUp events,
@@ -23,11 +23,13 @@ SDL_TRACKBALL_KEYUP_DELAY := 1
# resized in HW-accelerated way, however it eats a tiny bit of CPU
SDL_VIDEO_RENDER_RESIZE := 1
COMPILED_LIBRARIES := sdl_mixer sdl_image
SDL_VIDEO_RENDER_RESIZE_KEEP_ASPECT := 1
COMPILED_LIBRARIES := sdl_mixer sdl_image sdl_ttf intl lua
APPLICATION_ADDITIONAL_CFLAGS := -finline-functions -O2
APPLICATION_ADDITIONAL_LDFLAGS :=
APPLICATION_ADDITIONAL_LDFLAGS := -lpng -lxerces
APPLICATION_SUBDIRS_BUILD :=
@@ -35,7 +37,7 @@ APPLICATION_CUSTOM_BUILD_SCRIPT :=
SDL_ADDITIONAL_CFLAGS := -DSDL_ANDROID_KEYCODE_MOUSE=UNKNOWN -DSDL_ANDROID_KEYCODE_0=RETURN -DSDL_ANDROID_KEYCODE_1=LCTRL -DSDL_ANDROID_KEYCODE_2=PAGEUP -DSDL_ANDROID_KEYCODE_3=PAGEDOWN -DSDL_ANDROID_KEYCODE_4=LCTRL
SDL_VERSION := 1.3
SDL_VERSION := 1.2
# If SDL_Mixer should link to libMAD
SDL_MIXER_USE_LIBMAD :=

View File

@@ -6,6 +6,6 @@ APP_PROJECT_PATH := $(call my-dir)/..
# sdl_image depends on png and jpeg
# sdl_ttf depends on freetype
APP_MODULES := application sdl-1.3 sdl_main stlport tremor png jpeg freetype xerces sdl_mixer sdl_image
APP_MODULES := application sdl-1.2 sdl_main stlport tremor png jpeg freetype xerces sdl_mixer sdl_image sdl_ttf intl lua
APP_ABI := armeabi

View File

@@ -6,6 +6,17 @@
IFS='
'
MYARCH=linux-x86
if uname -s | grep -i "linux" ; then
MYARCH=linux-x86
fi
if uname -s | grep -i "darwin" ; then
MYARCH=darwin-x86
fi
if uname -s | grep -i "windows" ; then
MYARCH=windows-x86
fi
NDK=`which ndk-build`
NDK=`dirname $NDK`
GCCVER=4.4.0
@@ -17,14 +28,15 @@ LOCAL_PATH=`cd $LOCAL_PATH && pwd`
rm -rf $LOCAL_PATH/../../obj/local/armeabi/libSDL_*.so
rm -rf $LOCAL_PATH/../../obj/local/armeabi/libsdl_main.so
if [ -e $LOCAL_PATH/../../obj/local/armeabi/libsdl_mixer.so ] ; then
ln -sf libsdl_mixer.so $LOCAL_PATH/../../obj/local/armeabi/libSDL_Mixer.so
fi
# Uncomment if your configure expects SDL libraries in form "libSDL_name.so"
#if [ -e $LOCAL_PATH/../../obj/local/armeabi/libsdl_mixer.so ] ; then
# ln -sf libsdl_mixer.so $LOCAL_PATH/../../obj/local/armeabi/libSDL_Mixer.so
#fi
for F in $LOCAL_PATH/../../obj/local/armeabi/libsdl_*.so; do
LIBNAME=`echo $F | sed "s@$LOCAL_PATH/../../obj/local/armeabi/libsdl_\(.*\)[.]so@\1@"`
ln -sf libsdl_$LIBNAME.so $LOCAL_PATH/../../obj/local/armeabi/libSDL_$LIBNAME.so
done
#for F in $LOCAL_PATH/../../obj/local/armeabi/libsdl_*.so; do
# LIBNAME=`echo $F | sed "s@$LOCAL_PATH/../../obj/local/armeabi/libsdl_\(.*\)[.]so@\1@"`
# ln -sf libsdl_$LIBNAME.so $LOCAL_PATH/../../obj/local/armeabi/libSDL_$LIBNAME.so
#done
CFLAGS="-I$NDK/build/platforms/$PLATFORMVER/arch-arm/usr/include \
-fpic -mthumb-interwork -ffunction-sections -funwind-tables -fstack-protector -fno-short-enums \
@@ -36,8 +48,7 @@ CFLAGS="-I$NDK/build/platforms/$PLATFORMVER/arch-arm/usr/include \
LDFLAGS="-nostdlib -Wl,-soname,libapplication.so -Wl,-shared,-Bsymbolic \
-Wl,--whole-archive -Wl,--no-whole-archive \
$LOCAL_PATH/../../obj/local/armeabi/libstlport.a \
$NDK/build/prebuilt/linux-x86/arm-eabi-$GCCVER/lib/gcc/arm-eabi/4.4.0/libgcc.a \
$NDK/build/prebuilt/$MYARCH/arm-eabi-$GCCVER/lib/gcc/arm-eabi/4.4.0/libgcc.a \
`echo $LOCAL_PATH/../../obj/local/armeabi/*.so | sed "s@$LOCAL_PATH/../../obj/local/armeabi/libsdl_main.so@@" | sed "s@$LOCAL_PATH/../../obj/local/armeabi/libapplication.so@@"` \
$NDK/build/platforms/$PLATFORMVER/arch-arm/usr/lib/libc.so \
$NDK/build/platforms/$PLATFORMVER/arch-arm/usr/lib/libstdc++.so \
@@ -48,17 +59,20 @@ $NDK/build/platforms/$PLATFORMVER/arch-arm/usr/lib/libm.so \
-Wl,-rpath-link=$NDK/build/platforms/$PLATFORMVER/arch-arm/usr/lib \
-L$LOCAL_PATH/../../obj/local/armeabi"
env PATH=$NDK/build/prebuilt/linux-x86/arm-eabi-$GCCVER/bin:$LOCAL_PATH:$PATH \
# Comment out if you're using CrystaX toolchain
LDFLAGS="$LDFLAGS $LOCAL_PATH/../../obj/local/armeabi/libstlport.a"
env PATH=$NDK/build/prebuilt/$MYARCH/arm-eabi-$GCCVER/bin:$LOCAL_PATH:$PATH \
CFLAGS="$CFLAGS" \
CXXFLAGS="$CFLAGS" \
LDFLAGS="$LDFLAGS" \
CC="$NDK/build/prebuilt/linux-x86/arm-eabi-$GCCVER/bin/arm-eabi-gcc" \
CXX="$NDK/build/prebuilt/linux-x86/arm-eabi-$GCCVER/bin/arm-eabi-g++" \
RANLIB="$NDK/build/prebuilt/linux-x86/arm-eabi-$GCCVER/bin/arm-eabi-ranlib" \
LD="$NDK/build/prebuilt/linux-x86/arm-eabi-$GCCVER/bin/arm-eabi-gcc" \
AR="$NDK/build/prebuilt/linux-x86/arm-eabi-$GCCVER/bin/arm-eabi-ar" \
CPP="$NDK/build/prebuilt/linux-x86/arm-eabi-$GCCVER/bin/arm-eabi-cpp $CFLAGS" \
NM="$NDK/build/prebuilt/linux-x86/arm-eabi-$GCCVER/bin/arm-eabi-nm" \
AS="$NDK/build/prebuilt/linux-x86/arm-eabi-$GCCVER/bin/arm-eabi-as" \
STRIP="$NDK/build/prebuilt/linux-x86/arm-eabi-$GCCVER/bin/arm-eabi-strip" \
CC="$NDK/build/prebuilt/$MYARCH/arm-eabi-$GCCVER/bin/arm-eabi-gcc" \
CXX="$NDK/build/prebuilt/$MYARCH/arm-eabi-$GCCVER/bin/arm-eabi-g++" \
RANLIB="$NDK/build/prebuilt/$MYARCH/arm-eabi-$GCCVER/bin/arm-eabi-ranlib" \
LD="$NDK/build/prebuilt/$MYARCH/arm-eabi-$GCCVER/bin/arm-eabi-gcc" \
AR="$NDK/build/prebuilt/$MYARCH/arm-eabi-$GCCVER/bin/arm-eabi-ar" \
CPP="$NDK/build/prebuilt/$MYARCH/arm-eabi-$GCCVER/bin/arm-eabi-cpp $CFLAGS" \
NM="$NDK/build/prebuilt/$MYARCH/arm-eabi-$GCCVER/bin/arm-eabi-nm" \
AS="$NDK/build/prebuilt/$MYARCH/arm-eabi-$GCCVER/bin/arm-eabi-as" \
STRIP="$NDK/build/prebuilt/$MYARCH/arm-eabi-$GCCVER/bin/arm-eabi-strip" \
./configure --host=arm-eabi "$@"

View File

@@ -1 +1 @@
alienblaster
enigma

View File

@@ -12,6 +12,7 @@ LOCAL_CFLAGS := -I$(LOCAL_PATH)/include \
-DSDL_JAVA_PACKAGE_PATH=$(SDL_JAVA_PACKAGE_PATH) \
-DSDL_CURDIR_PATH=\"$(SDL_CURDIR_PATH)\" \
-DSDL_TRACKBALL_KEYUP_DELAY=$(SDL_TRACKBALL_KEYUP_DELAY) \
-DSDL_VIDEO_RENDER_RESIZE_KEEP_ASPECT=$(SDL_VIDEO_RENDER_RESIZE_KEEP_ASPECT) \
-DSDL_VIDEO_RENDER_RESIZE=$(SDL_VIDEO_RENDER_RESIZE) \
$(SDL_ADDITIONAL_CFLAGS)

View File

@@ -376,11 +376,11 @@ void updateOrientation ( float accX, float accY, float accZ )
if( isJoystickUsed && CurrentJoysticks[0] ) // TODO: mutex for that stuff?
{
// TODO: fix coefficients
SDL_PrivateJoystickAxis(CurrentJoysticks[0], 0, (accX - midX) * 1000);
SDL_PrivateJoystickAxis(CurrentJoysticks[0], 1, (accY - midY) * 1000);
SDL_PrivateJoystickAxis(CurrentJoysticks[0], 2, (accZ - midZ) * 1000);
SDL_PrivateJoystickAxis(CurrentJoysticks[0], 0, (Sint16)(fmin(32767, fmax(-32768, (accX - midX) * 400.0))));
SDL_PrivateJoystickAxis(CurrentJoysticks[0], 1, (Sint16)(fmin(32767, fmax(-32768, (accY - midY) * 400.0))));
SDL_PrivateJoystickAxis(CurrentJoysticks[0], 2, (Sint16)(fmin(32767, fmax(-32768, (accZ - midZ) * 400.0))));
// TODO: option for fixed/floating center pos
if( accY < midY - dy*2 )
midY = accY + dy*2;
if( accY > midY + dy*2 )
@@ -389,9 +389,12 @@ void updateOrientation ( float accX, float accY, float accZ )
midZ = accZ + dz*2;
if( accZ > midZ + dz*2 )
midZ = accZ - dz*2;
return;
}
if(isJoystickUsed)
return;
if( accX < midX - dx )
{
@@ -643,7 +646,7 @@ void SDL_ANDROID_processAndroidTrackballDampening()
int SDL_SYS_JoystickInit(void)
{
SDL_numjoysticks = MAX_MULTITOUCH_POINTERS+1;
return(0);
return(SDL_numjoysticks);
}
/* Function to get the device-dependent name of a joystick */

View File

@@ -94,8 +94,19 @@ JAVA_EXPORT_NAME(DemoRenderer_nativeResize) ( JNIEnv* env, jobject thiz, jint
{
if( SDL_ANDROID_sWindowWidth == 0 )
{
#if SDL_VIDEO_RENDER_RESIZE_KEEP_ASPECT
// TODO: tweak that parameters when app calls SetVideoMode(), not here - app may request something else than 640x480, it's okay for most apps though
// Also this should be user-configurable setting, not compiler option
SDL_ANDROID_sWindowWidth = (SDL_ANDROID_sFakeWindowWidth*h)/SDL_ANDROID_sFakeWindowHeight;
SDL_ANDROID_sWindowHeight = h;
if(SDL_ANDROID_sWindowWidth > w) {
SDL_ANDROID_sWindowWidth = w;
SDL_ANDROID_sWindowHeight = (SDL_ANDROID_sFakeWindowHeight*w)/SDL_ANDROID_sFakeWindowWidth;
}
#else
SDL_ANDROID_sWindowWidth = w;
SDL_ANDROID_sWindowHeight = h;
#endif
__android_log_print(ANDROID_LOG_INFO, "libSDL", "Physical screen resolution is %dx%d", w, h);
}
}

View File

@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">Alien Blaster</string>
<string name="app_name">enigma</string>
<string name="init">Initializing</string>
@@ -54,9 +54,10 @@
<string name="accel_slow">Slow</string>
<string name="accel_question">Accelerometer sensitivity</string>
<string name="audiobuf_small">Small (fast devices, less lag)</string>
<string name="audiobuf_verysmall">Very small (fast devices, less lag)</string>
<string name="audiobuf_small">Small</string>
<string name="audiobuf_medium">Medium</string>
<string name="audiobuf_large">Large (if sound is choppy)</string>
<string name="audiobuf_large">Large (older devices, if sound is choppy)</string>
<string name="audiobuf_question">Size of audio buffer</string>
</resources>

View File

@@ -1,5 +1,5 @@
// This string is autogenerated by ChangeAppSettings.sh, do not change spaces amount
package de.schwardtnet.alienblaster;
package org.enigmagame.enigma;
import android.app.Activity;
import android.content.Context;
@@ -52,16 +52,19 @@ class AccelerometerReader implements SensorEventListener {
if (event.sensor.getType() == Sensor.TYPE_ACCELEROMETER)
{
if( Globals.HorizontalOrientation )
nativeAccelerometer(event.values[1], -event.values[0], event.values[2]);
// TODO: it feels better for me to use tilt as X value instead of intuitive horizontal phone orientation
// because then I can hold device comfortably, we need another user-configurable option for that
// nativeOrientation(event.values[1], -event.values[2], event.values[0]); // Comfortable setting
nativeAccelerometer(event.values[1], -event.values[0], event.values[2]); // Intuitive setting
else
nativeAccelerometer(event.values[0], event.values[1], event.values[2]);
}
else
{
if( Globals.HorizontalOrientation )
nativeOrientation(event.values[1], -event.values[0], event.values[2]);
nativeOrientation(event.values[1], -event.values[2], event.values[0]);
else
nativeOrientation(event.values[0], event.values[1], event.values[2]);
nativeOrientation(event.values[2], event.values[1], event.values[0]);
}
}

View File

@@ -1,6 +1,6 @@
// This string is autogenerated by ChangeAppSettings.sh, do not change
// spaces amount
package de.schwardtnet.alienblaster;
package org.enigmagame.enigma;
import java.util.zip.*;
import java.io.*;

View File

@@ -1,5 +1,5 @@
// This string is autogenerated by ChangeAppSettings.sh, do not change spaces amount
package de.schwardtnet.alienblaster;
package org.enigmagame.enigma;
import android.app.Activity;
@@ -23,6 +23,7 @@ class AudioThread {
private Activity mParent;
private AudioTrack mAudio;
private byte[] mAudioBuffer;
private int mVirtualBufSize;
public AudioThread(Activity parent)
{
@@ -34,7 +35,7 @@ class AudioThread {
public int fillBuffer()
{
mAudio.write( mAudioBuffer, 0, mAudioBuffer.length );
mAudio.write( mAudioBuffer, 0, mVirtualBufSize );
return 1;
}
@@ -47,11 +48,15 @@ class AudioThread {
encoding = ( encoding == 1 ) ? AudioFormat.ENCODING_PCM_16BIT :
AudioFormat.ENCODING_PCM_8BIT;
mVirtualBufSize = bufSize;
if( AudioTrack.getMinBufferSize( rate, channels, encoding ) > bufSize )
bufSize = AudioTrack.getMinBufferSize( rate, channels, encoding );
bufSize = (int)((float)bufSize * (((float)Globals.AudioBufferConfig * 2.5f) + 1.0f));
if(Globals.AudioBufferConfig != 0) { // application's choice - use minimal buffer
bufSize = (int)((float)bufSize * (((float)(Globals.AudioBufferConfig - 1) * 2.5f) + 1.0f));
mVirtualBufSize = bufSize;
}
mAudioBuffer = new byte[bufSize];
mAudio = new AudioTrack(AudioManager.STREAM_MUSIC,
@@ -62,7 +67,7 @@ class AudioThread {
AudioTrack.MODE_STREAM );
mAudio.play();
}
return mAudioBuffer.length;
return mVirtualBufSize;
}
public byte[] getBuffer()

View File

@@ -1,5 +1,5 @@
// This string is autogenerated by ChangeAppSettings.sh, do not change spaces amount
package de.schwardtnet.alienblaster;
package org.enigmagame.enigma;
import android.app.Activity;
import android.content.Context;

View File

@@ -18,7 +18,7 @@
fixed with a hammer and rasp to work with libSDL port */
// This string is autogenerated by ChangeAppSettings.sh, do not change spaces amount
package de.schwardtnet.alienblaster;
package org.enigmagame.enigma;
import java.io.Writer;
import java.util.ArrayList;

View File

@@ -1,37 +1,40 @@
// This string is autogenerated by ChangeAppSettings.sh, do not change spaces amount anywhere
package de.schwardtnet.alienblaster;
package org.enigmagame.enigma;
import android.app.Activity;
import android.content.Context;
class Globals {
public static String ApplicationName = "AlienBlaster";
public static String ApplicationName = "enigma";
// Should be zip file
public static String DataDownloadUrl = "Data size is 2 Mb|alienblaster110_data.zip|http://sites.google.com/site/xpelyax/Home/alienblaster110_data.zip?attredirects=0%26d=1|http://sitesproxy.goapk.com/site/xpelyax/Home/alienblaster110_data.zip";
public static String DataDownloadUrl = "Enigma Game Data (6.5 MiB)|http://sites.google.com/site/droidsdl/data/enigma-data32.zip?attredirects=0%26d=1";
// Set this value to true if you're planning to render 3D using OpenGL - it eats some GFX resources, so disabled for 2D
public static boolean NeedDepthBuffer = false;
// Set this value to true if you're planning to render 3D using OpenGL - it eats some GFX resources, so disabled for 2D
public static boolean HorizontalOrientation = true;
// prevent device from going to suspend mode
public static boolean InhibitSuspend = true;
// Readme text to be shown on download page
public static String ReadmeText = "^You can press \"Home\" now - the data will be downloaded in background^In game press \"Menu\" for secondary fire, \"Volume Up/Down\" to cycle weapons".replace("^","\n");
public static String ReadmeText = "^You can press \"Home\" now - the data will be downloaded in background^Have fun playing enigma!^".replace("^","\n");
public static boolean AppUsesMouse = false;
public static boolean AppUsesMouse = true;
public static boolean AppNeedsArrowKeys = true;
public static boolean AppNeedsArrowKeys = false;
public static boolean AppUsesJoystick = false;
public static boolean AppUsesJoystick = true;
public static boolean AppUsesMultitouch = false;
public static boolean NonBlockingSwapBuffers = false;
public static int AppTouchscreenKeyboardKeysAmount = 4;
public static int AppTouchscreenKeyboardKeysAmount = 0;
public static int AppTouchscreenKeyboardKeysAmountAutoFire = 1;
public static int AppTouchscreenKeyboardKeysAmountAutoFire = 0;
// Phone-specific config
// It will download app data to /sdcard/alienblaster if set to true,
@@ -50,5 +53,5 @@ class Globals {
}
class LoadLibrary {
public LoadLibrary() { System.loadLibrary("sdl-1.3"); System.loadLibrary("sdl_mixer"); System.loadLibrary("sdl_image"); };
public LoadLibrary() { System.loadLibrary("sdl-1.2"); System.loadLibrary("sdl_mixer"); System.loadLibrary("sdl_image"); System.loadLibrary("sdl_ttf"); System.loadLibrary("intl"); System.loadLibrary("lua"); };
}

View File

@@ -1,5 +1,5 @@
// This string is autogenerated by ChangeAppSettings.sh, do not change spaces amount
package de.schwardtnet.alienblaster;
package org.enigmagame.enigma;
import android.app.Activity;
import android.content.Context;
@@ -21,6 +21,11 @@ public class MainActivity extends Activity {
requestWindowFeature(Window.FEATURE_NO_TITLE);
getWindow().setFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN,
WindowManager.LayoutParams.FLAG_FULLSCREEN);
if(Globals.InhibitSuspend)
getWindow().setFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON,
WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
_tv = new TextView(this);
_tv.setText(R.string.init);

View File

@@ -1,5 +1,5 @@
// This string is autogenerated by ChangeAppSettings.sh, do not change spaces amount
package de.schwardtnet.alienblaster;
package org.enigmagame.enigma;
import android.app.Activity;
import android.content.Context;
@@ -433,7 +433,8 @@ class Settings
static void showAudioConfig(final MainActivity p)
{
final CharSequence[] items = { p.getResources().getString(R.string.audiobuf_small),
final CharSequence[] items = { p.getResources().getString(R.string.audiobuf_verysmall),
p.getResources().getString(R.string.audiobuf_small),
p.getResources().getString(R.string.audiobuf_medium),
p.getResources().getString(R.string.audiobuf_large) };

View File

@@ -1,5 +1,5 @@
// This string is autogenerated by ChangeAppSettings.sh, do not change spaces amount
package de.schwardtnet.alienblaster;
package org.enigmagame.enigma;
import javax.microedition.khronos.opengles.GL10;