Debian: fixed Lollipop issues, fixed videomode selection screen

This commit is contained in:
Sergii Pylypenko
2014-11-20 21:51:24 +02:00
parent 9780653711
commit 1e20d3e235
7 changed files with 31 additions and 13 deletions

View File

@@ -7,10 +7,10 @@ AppName="Debian"
AppFullName=com.cuntubuntu
# Application version code (integer)
AppVersionCode=141008
AppVersionCode=141120
# Application user-visible version name (string)
AppVersionName="14.10.08"
AppVersionName="14.11.20"
# 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
@@ -18,7 +18,7 @@ AppVersionName="14.10.08"
# If the URL does not contain 'http://' it is treated as file from 'project/jni/application/src/AndroidData' dir -
# these files are put inside .apk package by build system
# Also please avoid 'https://' URLs, many Android devices do not have trust certificates and will fail to connect to SF.net over HTTPS
AppDataDownloadUrl="!!System image|:data.tar.gz:http://sourceforge.net/projects/libsdl-android/files/ubuntu/14.05.01/dist-debug-wheezy-proot-<ARCH>.tar.gz/download^!!XSDL data files|:data-1.tar.gz:data-1.tgz^!!XSDL fonts|:DroidSansMono.ttf:DroidSansMono.ttf^!!Postinstall script|:postinstall.sh:postinstall2.sh^!!Update|:update1.tar.gz:update1.tgz^!!Update|:update2.tar.gz:update2-<ARCH>.tgz^!!Update|:update3.tar.gz:update3.tgz^!!Update|:update4.tar.gz:update4.tgz"
AppDataDownloadUrl="!!System image|:data.tar.gz:http://sourceforge.net/projects/libsdl-android/files/ubuntu/14.05.01/dist-debug-wheezy-proot-<ARCH>.tar.gz/download^!!XSDL data files|:data-1.tar.gz:data-1.tgz^!!XSDL fonts|:DroidSansMono.ttf:DroidSansMono.ttf^!!Postinstall script|:postinstall.sh:postinstall2.sh^!!Update|:update1.tar.gz:update1.tgz^!!Update|:update2.tar.gz:update2-<ARCH>.tgz^!!Update|:update3.tar.gz:update3.tgz^!!Update|:update4.tar.gz:update4.tgz^!!Update|:update5.tar.gz:update5-<ARCH>.tgz"
# Reset SDL config when updating application to the new version (y) / (n)
ResetSdlConfigForThisVersion=n

View File

@@ -12,6 +12,7 @@
#include <pthread.h>
#include <SDL/SDL.h>
#include <SDL/SDL_ttf.h>
#include <SDL/SDL_screenkeyboard.h>
#include <android/log.h>
#include "gfx.h"
@@ -298,7 +299,10 @@ void XSDL_showConfigMenu(int * resolutionW, int * displayW, int * resolutionH, i
int x = 0, y = 0, i, ii;
SDL_Event event;
int res = -1, dpi = -1;
int customX = 1000, customY = 1000;
enum { MODE_CUSTOM = 11 };
char native[32] = "0x0", native56[32], native46[32], native36[32], native26[32];
char custom[32] = "1000x1000";
int vertical = SDL_ListModes(NULL, 0)[0]->w < SDL_ListModes(NULL, 0)[0]->h;
char cfgpath[PATH_MAX];
FILE * cfgfile;
@@ -317,7 +321,7 @@ void XSDL_showConfigMenu(int * resolutionW, int * displayW, int * resolutionH, i
{
native, native56, native46, native36,
native26, "1280x1024", "1280x960", "1280x720",
"1024x768", "800x600", "800x480", "640x480"
"1024x768", "800x600", "800x480", custom
};
const int resVal[][2] = {
{*resolutionW, *resolutionH},
@@ -326,7 +330,7 @@ void XSDL_showConfigMenu(int * resolutionW, int * displayW, int * resolutionH, i
{(*resolutionW * 3 / 6) & ~0x3, (*resolutionH * 3 / 6) & ~0x3},
{(*resolutionW * 2 / 6) & ~0x3, (*resolutionH * 2 / 6) & ~0x3},
{1280,1024}, {1280,960}, {1280,720},
{1024,768}, {800,600}, {800,480}, {640,480}
{1024,768}, {800,600}, {800,480}, {customX,customY}
};
const char * fontsStr[] = {
@@ -355,9 +359,10 @@ void XSDL_showConfigMenu(int * resolutionW, int * displayW, int * resolutionH, i
cfgfile = fopen(cfgpath, "r");
if( cfgfile )
{
fscanf(cfgfile, "%d %d", &savedRes, &savedDpi);
fscanf(cfgfile, "%d %d %d %d", &savedRes, &savedDpi, &customX, &customY);
fclose(cfgfile);
}
sprintf(custom, "%dx%d", customX, customY);
int counter = 3000, config = 0;
Uint32 curtime = SDL_GetTicks();
@@ -424,7 +429,7 @@ void XSDL_showConfigMenu(int * resolutionW, int * displayW, int * resolutionH, i
x = y;
y = z;
}
i = (y / (VID_Y/2));
i = (y / (VID_Y/3));
ii = (x / (VID_X/4));
res = i * 4 + ii;
__android_log_print(ANDROID_LOG_INFO, "XSDL", "Screen coords %d %d res %d\n", x, y, res);
@@ -449,14 +454,27 @@ void XSDL_showConfigMenu(int * resolutionW, int * displayW, int * resolutionH, i
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);
if( i == 2 && ii == 3 && !vertical )
renderString("custom", VID_X/8 + (ii*VID_X/4), VID_Y/6 + VID_Y/12 + (i*VID_Y/3));
}
//SDL_GetMouseState(&x, &y);
//renderString("X", x, y);
SDL_Delay(100);
SDL_Flip(SDL_GetVideoSurface());
if (res == MODE_CUSTOM)
{
SDL_ANDROID_SetScreenKeyboardHintMesage("WIDTHxHEIGHT");
SDL_ANDROID_GetScreenKeyboardTextInput(custom, sizeof(custom) - 1);
sscanf(custom, "%dx%d", &customX, &customY);
}
}
*resolutionW = resVal[res][0];
*resolutionH = resVal[res][1];
if (res == MODE_CUSTOM)
{
*resolutionW = customX;
*resolutionH = customY;
}
while ( dpi < 0 )
{
while (SDL_PollEvent(&event))
@@ -514,7 +532,7 @@ void XSDL_showConfigMenu(int * resolutionW, int * displayW, int * resolutionH, i
cfgfile = fopen(cfgpath, "w");
if( cfgfile )
{
fprintf(cfgfile, "%d %d\n", res, dpi);
fprintf(cfgfile, "%d %d %d %d\n", res, dpi, customX, customY);
fclose(cfgfile);
}
}
@@ -598,10 +616,10 @@ void XSDL_generateBackground(const char * port, int showHelp, int resolutionW, i
void XSDL_showServerLaunchErrorMessage()
{
showErrorMessage( "Error: X server failed to launch,\n"
"because of stale Unix socket with non-existing path.\n\n"
"Power off your device and power it on,\n"
"and everything will work again.");
showErrorMessage( "Error: X server failed to launch.\n\n"
"this may happen because of SELinux,\n"
"or because installation was corrupted.\n"
"Either way, this app will not work, which is sad.");
}
void showErrorMessage(const char *msg)