From f72e72272af6df2736a2b4aaee9dc3978678423b Mon Sep 17 00:00:00 2001 From: pelya Date: Mon, 19 Jul 2010 18:46:43 +0300 Subject: [PATCH] Removed "always resize" option for screen resizing from ChangeAppSettings.sh, it now equals to "y" It still leaves part of screen not resized on my widescreen HTC Evo --- alienblaster/AppSettings.cfg | 4 +-- alienblaster/ChangeAppSettings.sh | 4 +-- alienblaster/project/jni/Android.mk | 2 +- alienblaster/project/jni/sdl | 2 +- .../project/sdl/sdl-1.3/src/video/SDL_video.c | 27 +++++-------------- 5 files changed, 11 insertions(+), 28 deletions(-) diff --git a/alienblaster/AppSettings.cfg b/alienblaster/AppSettings.cfg index 88025ed78..fd5859f30 100644 --- a/alienblaster/AppSettings.cfg +++ b/alienblaster/AppSettings.cfg @@ -1,10 +1,10 @@ -LibSdlVersion=1.2 +LibSdlVersion=1.3 AppName="Alien Blaster" AppFullName=de.schwardtnet.alienblaster ScreenOrientation=h AppDataDownloadUrl="http://sites.google.com/site/xpelyax/Home/alienblaster110_data.zip?attredirects=0&d=1" DownloadToSdcard=n -SdlVideoResize=a +SdlVideoResize=y NeedDepthBuffer=n MultiABI=n AppVersionCode=110001 diff --git a/alienblaster/ChangeAppSettings.sh b/alienblaster/ChangeAppSettings.sh index c783a88c5..d2df5aee8 100755 --- a/alienblaster/ChangeAppSettings.sh +++ b/alienblaster/ChangeAppSettings.sh @@ -40,7 +40,7 @@ if [ -n "$var" ] ; then DownloadToSdcard="$var" fi -echo -n "\nApplication window should be resized to fit into 480x320 screen,\n(y) or (n) or (a)lways resize, even if screen is bigger ($SdlVideoResize): " +echo -n "\nApplication window should be resized to fit into 480x320 screen (y) or (n) ($SdlVideoResize): " read var if [ -n "$var" ] ; then SdlVideoResize="$var" @@ -132,8 +132,6 @@ fi AppDataDownloadUrl1="`echo $AppDataDownloadUrl | sed 's/[&]/%26/g'`" if [ "$SdlVideoResize" = "y" ] ; then SdlVideoResize=1 -elif [ "$SdlVideoResize" = "a" ] ; then - SdlVideoResize=2 else SdlVideoResize=0 fi diff --git a/alienblaster/project/jni/Android.mk b/alienblaster/project/jni/Android.mk index 75a001f7d..9da565b55 100644 --- a/alienblaster/project/jni/Android.mk +++ b/alienblaster/project/jni/Android.mk @@ -21,7 +21,7 @@ SDL_TRACKBALL_KEYUP_DELAY := 1 # If the application designed for higher screen resolution enable this to get the screen # resized in HW-accelerated way, however it eats a tiny bit of CPU -SDL_VIDEO_RENDER_RESIZE := 2 +SDL_VIDEO_RENDER_RESIZE := 1 COMPILED_LIBRARIES := sdl_mixer sdl_image diff --git a/alienblaster/project/jni/sdl b/alienblaster/project/jni/sdl index 73bcf85be..d92c7931b 120000 --- a/alienblaster/project/jni/sdl +++ b/alienblaster/project/jni/sdl @@ -1 +1 @@ -../sdl/sdl-1.2 \ No newline at end of file +../sdl/sdl-1.3 \ No newline at end of file diff --git a/alienblaster/project/sdl/sdl-1.3/src/video/SDL_video.c b/alienblaster/project/sdl/sdl-1.3/src/video/SDL_video.c index b195f14fc..3e8178462 100644 --- a/alienblaster/project/sdl/sdl-1.3/src/video/SDL_video.c +++ b/alienblaster/project/sdl/sdl-1.3/src/video/SDL_video.c @@ -2371,12 +2371,6 @@ SDL_RenderClear() #if SDL_VIDEO_RENDER_RESIZE -#if ( SDL_VIDEO_RENDER_RESIZE == 2 ) -#define SDL_VIDEO_RENDER_RESIZE_ALWAYS 1 -#else -#define SDL_VIDEO_RENDER_RESIZE_ALWAYS -#endif - static inline void SDL_RESIZE_resizePoints(int realW, int fakeW, int realH, int fakeH, const SDL_Point * src, SDL_Point * dest, int count ) @@ -2402,6 +2396,7 @@ SDL_RESIZE_resizeRects(int realW, int fakeW, int realH, int fakeH, dest[i].h = (src[i]->h + src[i]->y) * realH / fakeH - dest[i].y; } } + #endif int @@ -2445,9 +2440,7 @@ SDL_RenderDrawPoints(const SDL_Point * points, int count) realH = renderer->window->display->current_mode.h; fakeW = renderer->window->w; fakeH = renderer->window->h; -#if !(SDL_VIDEO_RENDER_RESIZE_ALWAYS) - if( fakeW > realW || fakeH > realH ) -#endif + //if( fakeW > realW || fakeH > realH ) { SDL_Point * resized = SDL_stack_alloc( SDL_Point, count ); if( ! resized ) { @@ -2506,9 +2499,7 @@ SDL_RenderDrawLines(const SDL_Point * points, int count) realH = renderer->window->display->current_mode.h; fakeW = renderer->window->w; fakeH = renderer->window->h; -#if !(SDL_VIDEO_RENDER_RESIZE_ALWAYS) - if( fakeW > realW || fakeH > realH ) -#endif + //if( fakeW > realW || fakeH > realH ) { SDL_Point * resized = SDL_stack_alloc( SDL_Point, count ); if( ! resized ) { @@ -2577,9 +2568,7 @@ SDL_RenderDrawRects(const SDL_Rect ** rects, int count) realH = renderer->window->display->current_mode.h; fakeW = renderer->window->w; fakeH = renderer->window->h; -#if !(SDL_VIDEO_RENDER_RESIZE_ALWAYS) - if( fakeW > realW || fakeH > realH ) -#endif + //if( fakeW > realW || fakeH > realH ) { SDL_Rect * resized = SDL_stack_alloc( SDL_Rect, count ); if( ! resized ) { @@ -2659,9 +2648,7 @@ SDL_RenderFillRects(const SDL_Rect ** rects, int count) realH = renderer->window->display->current_mode.h; fakeW = renderer->window->w; fakeH = renderer->window->h; -#if !(SDL_VIDEO_RENDER_RESIZE_ALWAYS) - if( fakeW > realW || fakeH > realH ) -#endif + //if( fakeW > realW || fakeH > realH ) { SDL_Rect * resized = SDL_stack_alloc( SDL_Rect, count ); if( ! resized ) { @@ -2758,9 +2745,7 @@ SDL_RenderCopy(SDL_Texture * texture, const SDL_Rect * srcrect, realH = window->display->current_mode.h; fakeW = window->w; fakeH = window->h; -#if !(SDL_VIDEO_RENDER_RESIZE_ALWAYS) - if( fakeW > realW || fakeH > realH ) -#endif + //if( fakeW > realW || fakeH > realH ) { // Calculate bottom-right corner instead of width/height, and substract upper-left corner, // otherwise we'll have rounding errors and holes between textures