From 41fd185b161fa8ca5ef5e32283944d235535855e Mon Sep 17 00:00:00 2001 From: pelya Date: Thu, 20 Sep 2012 14:32:55 +0300 Subject: [PATCH] Texture linear filtering is enabled by default, tiny tweak to Biniax2 --- project/java/Globals.java | 2 +- project/java/Settings.java | 16 ++++++++-------- .../application/biniax2/AndroidAppSettings.cfg | 4 ++-- project/jni/application/biniax2/src/gfx.c | 4 ++-- .../src/video/android/SDL_androidvideo-1.2.c | 8 ++++---- .../sdl-1.3/src/video/android/SDL_androidvideo.c | 6 +++--- .../sdl-1.3/src/video/android/SDL_androidvideo.h | 2 +- .../src/video/android/SDL_touchscreenkeyboard.c | 2 +- 8 files changed, 22 insertions(+), 22 deletions(-) diff --git a/project/java/Globals.java b/project/java/Globals.java index 64126761e..decc8571c 100644 --- a/project/java/Globals.java +++ b/project/java/Globals.java @@ -107,7 +107,7 @@ class Globals public static int MultitouchGestureSensitivity = 1; public static int TouchscreenCalibration[] = new int[4]; public static String DataDir = new String(""); - public static boolean SmoothVideo = false; + public static boolean VideoLinearFilter = true; public static boolean MultiThreadedVideo = false; public static boolean BrokenLibCMessageShown = false; } diff --git a/project/java/Settings.java b/project/java/Settings.java index 6e915b9b5..42886adb4 100644 --- a/project/java/Settings.java +++ b/project/java/Settings.java @@ -132,7 +132,7 @@ class Settings out.writeInt(Globals.ScreenKbControlsLayout[i][ii]); out.writeInt(Globals.LeftClickKey); out.writeInt(Globals.RightClickKey); - out.writeBoolean(Globals.SmoothVideo); + out.writeBoolean(Globals.VideoLinearFilter); out.writeInt(Globals.LeftClickTimeout); out.writeInt(Globals.RightClickTimeout); out.writeBoolean(Globals.RelativeMouseMovement); @@ -278,7 +278,7 @@ class Settings Globals.ScreenKbControlsLayout[i][ii] = settingsFile.readInt(); Globals.LeftClickKey = settingsFile.readInt(); Globals.RightClickKey = settingsFile.readInt(); - Globals.SmoothVideo = settingsFile.readBoolean(); + Globals.VideoLinearFilter = settingsFile.readBoolean(); Globals.LeftClickTimeout = settingsFile.readInt(); Globals.RightClickTimeout = settingsFile.readInt(); Globals.RelativeMouseMovement = settingsFile.readBoolean(); @@ -2292,7 +2292,7 @@ class Settings }; boolean defaults[] = { Globals.KeepAspectRatio, - Globals.SmoothVideo + Globals.VideoLinearFilter }; if(Globals.SwVideoMode && !Globals.CompatibilityHacksVideo) @@ -2304,7 +2304,7 @@ class Settings }; boolean defaults2[] = { Globals.KeepAspectRatio, - Globals.SmoothVideo, + Globals.VideoLinearFilter, Globals.MultiThreadedVideo }; items = items2; @@ -2332,7 +2332,7 @@ class Settings if( item == 0 ) Globals.KeepAspectRatio = isChecked; if( item == 1 ) - Globals.SmoothVideo = isChecked; + Globals.VideoLinearFilter = isChecked; if( item == 2 ) Globals.MultiThreadedVideo = isChecked; } @@ -2388,8 +2388,8 @@ class Settings static void Apply(Activity p) { nativeSetVideoDepth(Globals.VideoDepthBpp, Globals.NeedGles2 ? 1 : 0); - if(Globals.SmoothVideo) - nativeSetSmoothVideo(); + if(Globals.VideoLinearFilter) + nativeSetVideoLinearFilter(); if( Globals.CompatibilityHacksVideo ) { Globals.MultiThreadedVideo = true; @@ -2583,7 +2583,7 @@ class Settings private static native void nativeSetAccelerometerUsed(); private static native void nativeSetMultitouchUsed(); private static native void nativeSetTouchscreenKeyboardUsed(); - private static native void nativeSetSmoothVideo(); + private static native void nativeSetVideoLinearFilter(); private static native void nativeSetVideoDepth(int bpp, int gles2); private static native void nativeSetCompatibilityHacks(); private static native void nativeSetVideoMultithreaded(); diff --git a/project/jni/application/biniax2/AndroidAppSettings.cfg b/project/jni/application/biniax2/AndroidAppSettings.cfg index 24c4b60a1..c82faf540 100644 --- a/project/jni/application/biniax2/AndroidAppSettings.cfg +++ b/project/jni/application/biniax2/AndroidAppSettings.cfg @@ -30,9 +30,9 @@ RedefinedKeys="RETURN" AppTouchscreenKeyboardKeysAmount=0 AppTouchscreenKeyboardKeysAmountAutoFire=0 RedefinedKeysScreenKb="RETURN SPACE" -StartupMenuButtonTimeout=1000 +StartupMenuButtonTimeout=0 HiddenMenuOptions='DisplaySizeConfig MouseConfigMainMenu' -FirstStartMenuOptions='new Settings.VideoSettingsConfig()' +FirstStartMenuOptions='' MultiABI=n AppVersionCode=1401 AppVersionName="1.4.01" diff --git a/project/jni/application/biniax2/src/gfx.c b/project/jni/application/biniax2/src/gfx.c index 504e29271..043a894e8 100644 --- a/project/jni/application/biniax2/src/gfx.c +++ b/project/jni/application/biniax2/src/gfx.c @@ -1121,9 +1121,9 @@ void gfxNewFallingBlock( BNX_INT16 x, BNX_INT16 y, BNX_INT16 id ) j %= cGfxMaxParticles; _Gfx.falling_blocks[ j ].id = id; _Gfx.falling_blocks[ j ].x = cGfxZeroX + x * cGfxPairPlusX; - _Gfx.falling_blocks[ j ].y = cGfxZeroY + y * cGfxPairPlusY + cGfxParticleFall; + _Gfx.falling_blocks[ j ].y = cGfxZeroY + y * cGfxPairPlusY + cGfxParticleMinSp; _Gfx.falling_blocks[ j ].dx = cGfxParticleSpeed - ( sysRand( cGfxParticleSpeed<<1 ) + cGfxParticleMinSp ); - _Gfx.falling_blocks[ j ].dy = cGfxParticleFall; + _Gfx.falling_blocks[ j ].dy = cGfxParticleMinSp; } void gfxUpdateFallingBlocks() diff --git a/project/jni/sdl-1.2/src/video/android/SDL_androidvideo-1.2.c b/project/jni/sdl-1.2/src/video/android/SDL_androidvideo-1.2.c index 5ff27936b..83e4b0a18 100644 --- a/project/jni/sdl-1.2/src/video/android/SDL_androidvideo-1.2.c +++ b/project/jni/sdl-1.2/src/video/android/SDL_androidvideo-1.2.c @@ -368,7 +368,7 @@ SDL_Surface *ANDROID_SetVideoMode(_THIS, SDL_Surface *current, SDL_OutOfMemory(); return(NULL); } - if( SDL_ANDROID_SmoothVideo ) + if( SDL_ANDROID_VideoLinearFilter ) SDL_SetTextureScaleMode((SDL_Texture *)current->hwdata, SDL_SCALEMODE_SLOW); // Register main video texture to be recreated when needed @@ -518,7 +518,7 @@ static int ANDROID_AllocHWSurface(_THIS, SDL_Surface *surface) return(-1); } - if( SDL_ANDROID_SmoothVideo ) + if( SDL_ANDROID_VideoLinearFilter ) SDL_SetTextureScaleMode((SDL_Texture *)surface->hwdata, SDL_SCALEMODE_SLOW); if( surface->format->Amask ) @@ -604,7 +604,7 @@ static int ANDROID_LockHWSurface(_THIS, SDL_Surface *surface) SDL_OutOfMemory(); return(-1); } - if( SDL_ANDROID_SmoothVideo ) + if( SDL_ANDROID_VideoLinearFilter ) SDL_SetTextureScaleMode((SDL_Texture *)SDL_CurrentVideoSurface->hwdata, SDL_SCALEMODE_SLOW); // Register main video texture to be recreated when needed HwSurfaceCount++; @@ -1102,7 +1102,7 @@ void SDL_ANDROID_VideoContextRecreated() SDL_OutOfMemory(); return; } - if( SDL_ANDROID_SmoothVideo ) + if( SDL_ANDROID_VideoLinearFilter ) SDL_SetTextureScaleMode((SDL_Texture *)HwSurfaceList[i]->hwdata, SDL_SCALEMODE_SLOW); ANDROID_UnlockHWSurface(NULL, HwSurfaceList[i]); // Re-fill texture with graphics } diff --git a/project/jni/sdl-1.3/src/video/android/SDL_androidvideo.c b/project/jni/sdl-1.3/src/video/android/SDL_androidvideo.c index 30beb323d..eab52d9f8 100644 --- a/project/jni/sdl-1.3/src/video/android/SDL_androidvideo.c +++ b/project/jni/sdl-1.3/src/video/android/SDL_androidvideo.c @@ -71,7 +71,7 @@ static int glContextLost = 0; static int showScreenKeyboardDeferred = 0; static const char * showScreenKeyboardOldText = ""; static int showScreenKeyboardSendBackspace = 0; -int SDL_ANDROID_SmoothVideo = 0; +int SDL_ANDROID_VideoLinearFilter = 0; int SDL_ANDROID_VideoMultithreaded = 0; int SDL_ANDROID_VideoForceSoftwareMode = 0; int SDL_ANDROID_CompatibilityHacks = 0; @@ -332,9 +332,9 @@ int SDL_ANDROID_SetOpenALPutToBackgroundCallback( } JNIEXPORT void JNICALL -JAVA_EXPORT_NAME(Settings_nativeSetSmoothVideo) (JNIEnv* env, jobject thiz) +JAVA_EXPORT_NAME(Settings_nativeSetVideoLinearFilter) (JNIEnv* env, jobject thiz) { - SDL_ANDROID_SmoothVideo = 1; + SDL_ANDROID_VideoLinearFilter = 1; } JNIEXPORT void JNICALL diff --git a/project/jni/sdl-1.3/src/video/android/SDL_androidvideo.h b/project/jni/sdl-1.3/src/video/android/SDL_androidvideo.h index 57216978e..c24bc205d 100644 --- a/project/jni/sdl-1.3/src/video/android/SDL_androidvideo.h +++ b/project/jni/sdl-1.3/src/video/android/SDL_androidvideo.h @@ -40,7 +40,7 @@ extern int SDL_ANDROID_TouchscreenCalibrationWidth; extern int SDL_ANDROID_TouchscreenCalibrationHeight; extern int SDL_ANDROID_TouchscreenCalibrationX; extern int SDL_ANDROID_TouchscreenCalibrationY; -extern int SDL_ANDROID_SmoothVideo; +extern int SDL_ANDROID_VideoLinearFilter; extern int SDL_ANDROID_VideoMultithreaded; extern int SDL_ANDROID_VideoForceSoftwareMode; extern int SDL_ANDROID_CompatibilityHacks; diff --git a/project/jni/sdl-1.3/src/video/android/SDL_touchscreenkeyboard.c b/project/jni/sdl-1.3/src/video/android/SDL_touchscreenkeyboard.c index aaf549c82..ca94dd998 100644 --- a/project/jni/sdl-1.3/src/video/android/SDL_touchscreenkeyboard.c +++ b/project/jni/sdl-1.3/src/video/android/SDL_touchscreenkeyboard.c @@ -179,7 +179,7 @@ static inline void drawCharTexFlip(GLTexture_t * tex, SDL_Rect * src, SDL_Rect * glEnable(GL_BLEND); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); - if( SDL_ANDROID_SmoothVideo ) + if( SDL_ANDROID_VideoLinearFilter ) { glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR);