TeeWorlds do not crash, but buggy as hell
This commit is contained in:
@@ -23,9 +23,9 @@ SDL_TRACKBALL_KEYUP_DELAY := 1
|
||||
# resized in HW-accelerated way, however it eats a tiny bit of CPU
|
||||
SDL_VIDEO_RENDER_RESIZE := 0
|
||||
|
||||
COMPILED_LIBRARIES := sdl_image sdl_mixer
|
||||
COMPILED_LIBRARIES := sdl_image
|
||||
|
||||
APPLICATION_ADDITIONAL_CFLAGS := -O2 -DCONF_FAMILY_UNIX=1
|
||||
APPLICATION_ADDITIONAL_CFLAGS := -O2
|
||||
|
||||
APPLICATION_ADDITIONAL_LDFLAGS := -Lbin/ndk/local/armeabi -lfreetype
|
||||
|
||||
|
||||
@@ -5,6 +5,6 @@ APP_PROJECT_PATH := $(call my-dir)/..
|
||||
# sdl_image depends on png and jpeg
|
||||
# sdl_ttf depends on freetype
|
||||
|
||||
APP_MODULES := application sdl sdl_main stlport tremor png jpeg freetype sdl_image sdl_mixer
|
||||
APP_MODULES := application sdl sdl_main stlport tremor png jpeg freetype sdl_image
|
||||
|
||||
APP_ABI := armeabi
|
||||
|
||||
@@ -3,7 +3,7 @@ LibSdlVersion=1.2
|
||||
AppName="TeeWorlds"
|
||||
AppFullName=com.teeworlds
|
||||
ScreenOrientation=h
|
||||
AppDataDownloadUrl="Game data is 5 Mb|http://sourceforge.net/projects/libsdl-android/files/TeeWorlds/teeworlds.zip/download"
|
||||
AppDataDownloadUrl="Game data is 8 Mb|http://sourceforge.net/projects/libsdl-android/files/TeeWorlds/teeworlds.zip/download"
|
||||
SdlVideoResize=n
|
||||
NeedDepthBuffer=n
|
||||
AppUsesMouse=y
|
||||
@@ -16,7 +16,7 @@ AppTouchscreenKeyboardKeysAmountAutoFire=1
|
||||
MultiABI=n
|
||||
AppVersionCode=5201
|
||||
AppVersionName="0.5.2.01"
|
||||
CompiledLibraries="sdl_image sdl_mixer"
|
||||
AppCflags='-O2 -DCONF_FAMILY_UNIX=1'
|
||||
CompiledLibraries="sdl_image"
|
||||
AppCflags='-O2'
|
||||
AppLdflags='-Lbin/ndk/local/armeabi -lfreetype'
|
||||
ReadmeText='^You may press "Home" now - the data will be downloaded in background'
|
||||
|
||||
@@ -31,8 +31,13 @@ MACRO_CONFIG_INT(b_sort, 0, 0, 256, CFGFLAG_SAVE|CFGFLAG_CLIENT, "")
|
||||
MACRO_CONFIG_INT(b_sort_order, 0, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "")
|
||||
MACRO_CONFIG_INT(b_max_requests, 10, 0, 1000, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Number of requests to use when refreshing server browser")
|
||||
|
||||
#ifdef ANDROID
|
||||
MACRO_CONFIG_INT(snd_buffer_size, 1024, 0, 0, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Sound buffer size")
|
||||
MACRO_CONFIG_INT(snd_rate, 22050, 0, 0, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Sound mixing rate")
|
||||
#else
|
||||
MACRO_CONFIG_INT(snd_buffer_size, 512, 0, 0, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Sound buffer size")
|
||||
MACRO_CONFIG_INT(snd_rate, 48000, 0, 0, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Sound mixing rate")
|
||||
#endif
|
||||
MACRO_CONFIG_INT(snd_enable, 1, 0, 1, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Sound enable")
|
||||
MACRO_CONFIG_INT(snd_volume, 100, 0, 100, CFGFLAG_SAVE|CFGFLAG_CLIENT, "Sound volume")
|
||||
MACRO_CONFIG_INT(snd_device, -1, 0, 0, CFGFLAG_SAVE|CFGFLAG_CLIENT, "(deprecated) Sound device to use")
|
||||
|
||||
@@ -167,8 +167,15 @@ static int ANDROIDAUD_OpenAudio (_THIS, SDL_AudioSpec *spec)
|
||||
return (-1); // TODO: enable format conversion? Don't know how to do that in SDL
|
||||
}
|
||||
|
||||
__android_log_print(ANDROID_LOG_INFO, "libSDL", "ANDROIDAUD_OpenAudio(): app requested audio bytespersample %d freq %d channels %d samples %d", bytesPerSample, audioFormat->freq, (int)audioFormat->channels, (int)audioFormat->samples);
|
||||
|
||||
bytesPerSample = (audioFormat->format & 0xFF) / 8;
|
||||
audioFormat->format = ( bytesPerSample == 2 ) ? AUDIO_S16 : AUDIO_S8;
|
||||
if( audioFormat->samples > 32768 ) // Why anyone need so huge audio buffer?
|
||||
audioFormat->samples = 32768;
|
||||
|
||||
SDL_CalculateAudioSpec(spec);
|
||||
|
||||
|
||||
(*jniVM)->AttachCurrentThread(jniVM, &jniEnv, NULL);
|
||||
|
||||
@@ -180,7 +187,7 @@ static int ANDROIDAUD_OpenAudio (_THIS, SDL_AudioSpec *spec)
|
||||
|
||||
audioBufferSize = (*jniEnv)->CallIntMethod( jniEnv, JavaAudioThread, JavaInitAudio,
|
||||
(jint)audioFormat->freq, (jint)audioFormat->channels,
|
||||
(jint)(( bytesPerSample == 2 ) ? 1 : 0), (jint)audioFormat->size);
|
||||
(jint)(( bytesPerSample == 2 ) ? 1 : 0), (jint)(audioFormat->size > 0 ? audioFormat->size : 100) );
|
||||
|
||||
if( audioBufferSize == 0 )
|
||||
{
|
||||
@@ -194,7 +201,7 @@ static int ANDROIDAUD_OpenAudio (_THIS, SDL_AudioSpec *spec)
|
||||
|
||||
audioFormat->samples = audioBufferSize / bytesPerSample / audioFormat->channels;
|
||||
audioFormat->size = audioBufferSize;
|
||||
__android_log_print(ANDROID_LOG_INFO, "libSDL", "ANDROIDAUD_OpenAudio(): app opened audio bytespersample %d freq %d channels %d bufsize %d", bytesPerSample, audioFormat->freq, (jint)audioFormat->channels, audioBufferSize);
|
||||
__android_log_print(ANDROID_LOG_INFO, "libSDL", "ANDROIDAUD_OpenAudio(): app opened audio bytespersample %d freq %d channels %d bufsize %d", bytesPerSample, audioFormat->freq, (int)audioFormat->channels, audioBufferSize);
|
||||
|
||||
SDL_CalculateAudioSpec(audioFormat);
|
||||
|
||||
|
||||
@@ -48,5 +48,5 @@ class Globals {
|
||||
}
|
||||
|
||||
class LoadLibrary {
|
||||
public LoadLibrary() { System.loadLibrary("sdl"); System.loadLibrary("sdl_image"); System.loadLibrary("sdl_mixer"); };
|
||||
public LoadLibrary() { System.loadLibrary("sdl"); System.loadLibrary("sdl_image"); };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user