From 9bc29e567095ee1245aa5fda728e4d5bd2573cee Mon Sep 17 00:00:00 2001 From: pelya Date: Mon, 17 Feb 2014 00:54:11 +0200 Subject: [PATCH] Xserver: fixes --- .../xserver/AndroidAppSettings.cfg | 4 +-- project/jni/application/xserver/gfx.c | 28 +++++++++++++------ 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/project/jni/application/xserver/AndroidAppSettings.cfg b/project/jni/application/xserver/AndroidAppSettings.cfg index ed6a2b014..087240d6c 100644 --- a/project/jni/application/xserver/AndroidAppSettings.cfg +++ b/project/jni/application/xserver/AndroidAppSettings.cfg @@ -7,10 +7,10 @@ AppName="XServer XSDL" AppFullName=x.org.server # Application version code (integer) -AppVersionCode=11111 +AppVersionCode=11112 # Application user-visible version name (string) -AppVersionName="1.11.11" +AppVersionName="1.11.12" # Specify path to download application data in zip archive in the form 'Description|URL|MirrorURL^Description2|URL2|MirrorURL2^...' # If you'll start Description with '!' symbol it will be enabled by default, other downloads should be selected by user from startup config menu diff --git a/project/jni/application/xserver/gfx.c b/project/jni/application/xserver/gfx.c index 0e140a04a..621da44dc 100644 --- a/project/jni/application/xserver/gfx.c +++ b/project/jni/application/xserver/gfx.c @@ -158,7 +158,7 @@ void XSDL_showConfigMenu(int * resolutionW, int * displayW, int * resolutionH, i int x, y, i, ii; SDL_Event event; int res = -1, dpi = -1; - char native[32] = "0x0"; + char native[32] = "0x0", native78[32], native68[32], native58[32], native48[32]; int vertical = SDL_ListModes(NULL, 0)[0]->w < SDL_ListModes(NULL, 0)[0]->h; char cfgpath[PATH_MAX]; FILE * cfgfile; @@ -174,11 +174,17 @@ void XSDL_showConfigMenu(int * resolutionW, int * displayW, int * resolutionH, i } const char * resStr[] = { - native, "1920x1080", "1280x960", "1280x720", + native, native78, native68, native58, + native48, "1280x1024", "1280x960", "1024x768", "800x600", "800x480", "640x480" }; const int resVal[][2] = { - {*resolutionW, *resolutionH}, {1920,1080}, {1280,960}, {1280,720}, + {*resolutionW, *resolutionH}, + {*resolutionW * 7 / 8, *resolutionH * 7 / 8}, + {*resolutionW * 6 / 8, *resolutionH * 6 / 8}, + {*resolutionW * 5 / 8, *resolutionH * 5 / 8}, + {*resolutionW * 4 / 8, *resolutionH * 4 / 8}, + {1280,1024}, {1280,960}, {1024,768}, {800,600}, {800,480}, {640,480} }; @@ -195,7 +201,11 @@ void XSDL_showConfigMenu(int * resolutionW, int * displayW, int * resolutionH, i 0.3f, 0.2f, 0.15f, 0.1f }; - sprintf(native, "%dx%d native", resVal[0][0], resVal[0][1]); + sprintf(native, "%dx%d", resVal[0][0], resVal[0][1]); + sprintf(native78, "%dx%d", resVal[1][0], resVal[1][1]); + sprintf(native68, "%dx%d", resVal[2][0], resVal[2][1]); + sprintf(native58, "%dx%d", resVal[3][0], resVal[3][1]); + sprintf(native48, "%dx%d", resVal[4][0], resVal[4][1]); int savedRes = 0; int savedDpi = 8; @@ -286,14 +296,16 @@ void XSDL_showConfigMenu(int * resolutionW, int * displayW, int * resolutionH, i //__android_log_print(ANDROID_LOG_INFO, "XSDL", "Screen coords %d %d\n", x, y, res); SDL_FillRect(SDL_GetVideoSurface(), NULL, 0); - renderString("Select display resolution", VID_X/2, VID_Y/2); - for(i = 0; i < 2; i++) + renderString("Select display resolution", VID_X/2, VID_Y/3); + for(i = 0; i < 3; i++) for(ii = 0; ii < 4; ii++) { if( vertical ) - renderString(resStr[i*4+ii], VID_Y/4 + (i*VID_Y/2), VID_X/8 + (ii*VID_X/4)); + renderString(resStr[i*4+ii], VID_Y/6 + (i*VID_Y/3), VID_X/8 + (ii*VID_X/4)); else - renderString(resStr[i*4+ii], VID_X/8 + (ii*VID_X/4), VID_Y/4 + (i*VID_Y/2)); + renderString(resStr[i*4+ii], VID_X/8 + (ii*VID_X/4), VID_Y/6 + (i*VID_Y/3)); + if( i == 0 && ii == 0 && !vertical ) + renderString("native", VID_X/8, VID_Y/6 + VID_Y/12); } //SDL_GetMouseState(&x, &y); //renderString("X", x, y);