Permalink
Browse files

Added MOAR DIRTY HACKZ to the SDL compatibility mode, MilkyTracker no…

…w does not have any drawing glitches.
  • Loading branch information...
1 parent 90211ac commit 690a8c70f9f871d00b3e77032a73ed7d55f6ade4 @pelya committed Jun 12, 2012
@@ -444,19 +444,27 @@ public void onDrawFrame(GL10 gl) {
public int swapBuffers() // Called from native code
{
- synchronized(this)
- {
- this.notify();
- }
if( ! super.SwapBuffers() && Globals.NonBlockingSwapBuffers )
+ {
+ synchronized(this)
+ {
+ this.notify();
+ }
return 0;
+ }
+
if(mGlContextLost) {
mGlContextLost = false;
Settings.SetupTouchscreenKeyboardGraphics(context); // Reload on-screen buttons graphics
DrawLogo(mGl);
super.SwapBuffers();
}
-
+
+ // Unblock event processing thread only after we've finished rendering
+ synchronized(this)
+ {
+ this.notify();
+ }
return 1;
}
@@ -600,7 +608,7 @@ public boolean onGenericMotionEvent (final MotionEvent event)
public void limitEventRate(final MotionEvent event)
{
// Wait a bit, and try to synchronize to app framerate, or event thread will eat all CPU and we'll lose FPS
- // With Froyo the rate of touch events is limited, but they are arriving faster then we're redrawing anyway
+ // With Froyo the rate of touch events seems to be limited by OS, but they are arriving faster then we're redrawing anyway
if((event.getAction() == MotionEvent.ACTION_MOVE ||
event.getAction() == MotionEvent.ACTION_HOVER_MOVE))
{
@@ -31,10 +31,10 @@ AppTouchscreenKeyboardKeysAmountAutoFire=0
RedefinedKeysScreenKb="SPACE TAB PLUS MINUS RETURN ESCAPE DELETE"
StartupMenuButtonTimeout=3000
HiddenMenuOptions='OptionalDownloadConfig'
-FirstStartMenuOptions=''
+FirstStartMenuOptions='new Settings.DummyMenu()'
MultiABI=n
-AppVersionCode=0908504
-AppVersionName="0.90.85.04"
+AppVersionCode=0908505
+AppVersionName="0.90.85.05"
ResetSdlConfigForThisVersion=y
DeleteFilesOnUpgrade="%"
CompiledLibraries="jpeg png zzip"
@@ -6,12 +6,15 @@ LOCAL_PATH=`cd $LOCAL_PATH && pwd`
ln -sf libsdl-1.2.so $LOCAL_PATH/../../../obj/local/armeabi/libSDL.so
+[ -d milkytracker-0.90.85 ] || { curl "http://www.milkytracker.org/files/milkytracker-0.90.85.tar.bz2" | bunzip2 | tar xv && patch -p0 < milkytrackey-0.90.85-android.diff || exit 1 ; }
+
if [ \! -f milkytracker-0.90.85/configure ] ; then
sh -c "cd milkytracker-0.90.85 && ./autogen.sh"
fi
if [ \! -f milkytracker-0.90.85/Makefile ] ; then
+ env CFLAGS=-D__LOWRES__ \
../setEnvironment.sh sh -c "cd milkytracker-0.90.85 && ZZIP_CFLAGS='-I$LOCAL_PATH/../../zzip/include' ZZIP_LIBS='-L$LOCAL_PATH/../../../obj/local/armeabi -lzzip' LIBS=-lgnustl_static ./configure --host=arm-linux-androideabi"
fi
-make -C milkytracker-0.90.85 && mv -f milkytracker-0.90.85/src/tracker/milkytracker libapplication.so
+make -j4 -C milkytracker-0.90.85 && mv -f milkytracker-0.90.85/src/tracker/milkytracker libapplication.so
Oops, something went wrong.
@@ -1,8 +1,8 @@
You should download the SDL for Andorid repository from https://github.com/pelya/commandergenius
and also the MilkyTracker sources - extract them to the directory project/jni/application/milkytracker in the SDL repo.
-To compile you will need to install need a recent Android SDK and NDK r7b, and put the dirs
-android-ndk-r7b
-android-ndk-r7b/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin
+To compile you will need to install need a recent Android SDK and NDK r8, and put the dirs
+android-ndk-r8
+android-ndk-r8/toolchains/arm-linux-androideabi-4.4.3/prebuilt/linux-x86/bin
android-sdk-linux
android-sdk-linux/tools
android-sdk-linux/platform-tools
@@ -33,8 +33,8 @@ StartupMenuButtonTimeout=3000
HiddenMenuOptions='OptionalDownloadConfig DisplaySizeConfig'
FirstStartMenuOptions=''
MultiABI=n
-AppVersionCode=2119
-AppVersionName="2.1.19"
+AppVersionCode=2120
+AppVersionName="2.1.20"
ResetSdlConfigForThisVersion=y
DeleteFilesOnUpgrade="%"
CompiledLibraries="sdl_net"
@@ -33,8 +33,8 @@ StartupMenuButtonTimeout=3000
HiddenMenuOptions=''
FirstStartMenuOptions=''
MultiABI=n
-AppVersionCode=07021
-AppVersionName="0.7.0.21"
+AppVersionCode=07022
+AppVersionName="0.7.0.22"
ResetSdlConfigForThisVersion=y
DeleteFilesOnUpgrade="%"
CompiledLibraries="sdl_image tremor ogg"
@@ -38,6 +38,7 @@ echo $APP_MODULES | xargs -n 1 echo | while read LIB ; do
done
)
+
MISSING_INCLUDE=
MISSING_LIB=
@@ -61,7 +62,7 @@ CFLAGS="\
-isystem$NDK/sources/cxx-stl/gnu-libstdc++/libs/armeabi/include \
-isystem$LOCAL_PATH/../sdl-1.2/include \
`echo $APP_MODULES | sed \"s@\([-a-zA-Z0-9_.]\+\)@-isystem$LOCAL_PATH/../\1/include@g\"` \
-$MISSING_INCLUDE"
+$MISSING_INCLUDE $CFLAGS"
SHARED="-shared -Wl,-soname,libapplication.so"
if [ -n "$BUILD_EXECUTABLE" ]; then
@@ -87,7 +88,7 @@ $NDK/platforms/$PLATFORMVER/arch-arm/usr/lib/libz.so \
-L$NDK/platforms/$PLATFORMVER/arch-arm/usr/lib \
-L$LOCAL_PATH/../../obj/local/armeabi -Wl,--no-undefined -Wl,-z,noexecstack \
-Wl,-rpath-link=$NDK/platforms/$PLATFORMVER/arch-arm/usr/lib -lsupc++ \
-$MISSING_LIB"
+$MISSING_LIB $LDFLAGS"
#echo env CFLAGS=\""$CFLAGS"\" LDFLAGS=\""$LDFLAGS"\" "$@"
@@ -1169,12 +1169,18 @@ void SDL_ANDROID_MultiThreadedVideoLoop()
ANDROID_VideoQuit(videoThread._this);
break;
case CMD_UPDATERECTS:
- ANDROID_FlipHWSurfaceInternal(videoThread.numrects, videoThread.rects);
- swapBuffersNeeded = 1;
+ if( ! SDL_ANDROID_CompatibilityHacks ) // DIRTY HACK for MilkyTracker
+ {
+ ANDROID_FlipHWSurfaceInternal(videoThread.numrects, videoThread.rects);
+ swapBuffersNeeded = 1;
+ }
break;
case CMD_FLIP:
- ANDROID_FlipHWSurfaceInternal(0, NULL);
- swapBuffersNeeded = 1;
+ if( ! SDL_ANDROID_CompatibilityHacks ) // DIRTY HACK for MilkyTracker
+ {
+ ANDROID_FlipHWSurfaceInternal(0, NULL);
+ swapBuffersNeeded = 1;
+ }
break;
}
videoThread.execute = 0;
@@ -35,7 +35,7 @@ CFLAGS="\
-DNDEBUG -O2 -g \
-isystem$NDK/sources/cxx-stl/gnu-libstdc++/include \
-isystem$NDK/sources/cxx-stl/gnu-libstdc++/libs/armeabi/include \
-$MISSING_INCLUDE"
+$MISSING_INCLUDE $CFLAGS"
SHARED="-shared -Wl,-soname,libapplication.so"
if [ -n "$BUILD_EXECUTABLE" ]; then
@@ -60,7 +60,7 @@ LDFLAGS="\
-Wl,--no-undefined -Wl,-z,noexecstack \
-Wl,-rpath=/system/lib \
-Wl,-rpath-link=$NDK/platforms/$PLATFORMVER/arch-arm/usr/lib \
-$MISSING_LIB"
+$MISSING_LIB $LDFLAGS"
#echo env CFLAGS=\""$CFLAGS"\" LDFLAGS=\""$LDFLAGS"\" "$@"
View
@@ -97,7 +97,7 @@ the app will re-download the data if URL does not match the saved URL from previ
All devices have different screen resolutions, you may toggle automatic screen resizing
in ChangeAppSettings.sh and draw to virtual 640x480 screen - it will be HW accelerated
and will not impact performance. Automatic screen resizing does not work in SDL 1.3/2.0.
-SDL_ListModes()[0] will always return native screen resolution.
+SDL_GetVideoInfo() will always return native screen resolution.
Also make sure that your HW textures are not wider than 1024 pixels, or it will fail to allocate such
texture on HTC G1, and other low-end devices. Software surfaces may be of any size of course.

0 comments on commit 690a8c7

Please sign in to comment.