diff -r 4feced261c68 -r de822cd3df3a project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/frontlib/Flib.java --- a/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/frontlib/Flib.java Tue Jan 21 22:38:13 2014 +0100 +++ b/project_files/Android-build/SDL-android-project/src/org/hedgewars/hedgeroid/frontlib/Flib.java Tue Jan 21 22:43:06 2014 +0100 @@ -27,36 +27,36 @@ import com.sun.jna.Native; public class Flib { - static { - System.loadLibrary("SDL"); - System.loadLibrary("SDL_net"); - System.setProperty("jna.encoding", "UTF8"); // Ugly global setting, but it seems JNA doesn't allow setting this per-library... - } - public static final Frontlib INSTANCE = (Frontlib)Native.loadLibrary("frontlib", Frontlib.class, Collections.singletonMap(Library.OPTION_TYPE_MAPPER, AndroidTypeMapper.INSTANCE)); - - static { - // We'll just do it here and never quit it again... - if(Flib.INSTANCE.flib_init() != 0) { - throw new RuntimeException("Unable to initialize frontlib"); - } - } - - // Hook frontlib logging into Android logging - private static final Frontlib.LogCallback logCb = new Frontlib.LogCallback() { - public void callback(int level, String message) { - if(level >= Frontlib.FLIB_LOGLEVEL_ERROR) { - Log.e("Frontlib", message); - } else if(level == Frontlib.FLIB_LOGLEVEL_WARNING){ - Log.w("Frontlib", message); - } else if(level == Frontlib.FLIB_LOGLEVEL_INFO){ - Log.i("Frontlib", message); - } else if(level <= Frontlib.FLIB_LOGLEVEL_DEBUG){ - Log.d("Frontlib", message); - } - } - }; - static { - INSTANCE.flib_log_setLevel(Frontlib.FLIB_LOGLEVEL_INFO); - INSTANCE.flib_log_setCallback(logCb); - } + static { + System.loadLibrary("SDL"); + System.loadLibrary("SDL_net"); + System.setProperty("jna.encoding", "UTF8"); // Ugly global setting, but it seems JNA doesn't allow setting this per-library... + } + public static final Frontlib INSTANCE = (Frontlib)Native.loadLibrary("frontlib", Frontlib.class, Collections.singletonMap(Library.OPTION_TYPE_MAPPER, AndroidTypeMapper.INSTANCE)); + + static { + // We'll just do it here and never quit it again... + if(Flib.INSTANCE.flib_init() != 0) { + throw new RuntimeException("Unable to initialize frontlib"); + } + } + + // Hook frontlib logging into Android logging + private static final Frontlib.LogCallback logCb = new Frontlib.LogCallback() { + public void callback(int level, String message) { + if(level >= Frontlib.FLIB_LOGLEVEL_ERROR) { + Log.e("Frontlib", message); + } else if(level == Frontlib.FLIB_LOGLEVEL_WARNING){ + Log.w("Frontlib", message); + } else if(level == Frontlib.FLIB_LOGLEVEL_INFO){ + Log.i("Frontlib", message); + } else if(level <= Frontlib.FLIB_LOGLEVEL_DEBUG){ + Log.d("Frontlib", message); + } + } + }; + static { + INSTANCE.flib_log_setLevel(Frontlib.FLIB_LOGLEVEL_INFO); + INSTANCE.flib_log_setCallback(logCb); + } }