diff --git a/project/java/Globals.java b/project/java/Globals.java
index 14ff608c1..b0c85eae8 100644
--- a/project/java/Globals.java
+++ b/project/java/Globals.java
@@ -63,10 +63,11 @@ class Globals {
public static final int RIGHT_CLICK_WITH_MENU_BUTTON = 1;
public static final int RIGHT_CLICK_WITH_MULTITOUCH = 2;
public static final int RIGHT_CLICK_WITH_PRESSURE = 3;
- public static int RightClickMethod = RIGHT_CLICK_WITH_MENU_BUTTON;
+ public static int RightClickMethod = RIGHT_CLICK_NONE;
public static boolean LeftClickUsesPressure = false;
public static boolean LeftClickUsesMultitouch = false;
public static boolean ShowScreenUnderFinger = false;
+ public static boolean KeepAspectRatio = false;
public static int ClickScreenPressure = 0;
public static int ClickScreenTouchspotSize = 0;
}
diff --git a/project/java/Settings.java b/project/java/Settings.java
index 38f014b15..221cd69f9 100644
--- a/project/java/Settings.java
+++ b/project/java/Settings.java
@@ -55,6 +55,7 @@ class Settings
out.writeBoolean(Globals.LeftClickUsesMultitouch);
out.writeInt(Globals.ClickScreenPressure);
out.writeInt(Globals.ClickScreenTouchspotSize);
+ out.writeBoolean(Globals.KeepAspectRatio);
out.close();
settingsLoaded = true;
@@ -93,6 +94,7 @@ class Settings
Globals.LeftClickUsesMultitouch = settingsFile.readBoolean();
Globals.ClickScreenPressure = settingsFile.readInt();
Globals.ClickScreenTouchspotSize = settingsFile.readInt();
+ Globals.KeepAspectRatio = settingsFile.readBoolean();
settingsLoaded = true;
@@ -497,26 +499,36 @@ class Settings
Globals.LeftClickUsesPressure = false;
Globals.LeftClickUsesMultitouch = false;
+ /*
if( ! Globals.AppNeedsTwoButtonMouse )
{
showTouchPressureMeasurementTool(p);
return;
}
- CharSequence[] items = { p.getResources().getString(R.string.pointandclick_showcreenunderfinger),
+ */
+ CharSequence[] items = { p.getResources().getString(R.string.pointandclick_keepaspectratio),
+ p.getResources().getString(R.string.pointandclick_showcreenunderfinger),
p.getResources().getString(R.string.pointandclick_usepressure),
p.getResources().getString(R.string.pointandclick_multitouch) };
if( Globals.RightClickMethod == Globals.RIGHT_CLICK_WITH_PRESSURE )
{
- CharSequence[] items2 = { p.getResources().getString(R.string.pointandclick_showcreenunderfinger),
+ CharSequence[] items2 = { p.getResources().getString(R.string.pointandclick_keepaspectratio),
+ p.getResources().getString(R.string.pointandclick_showcreenunderfinger),
p.getResources().getString(R.string.pointandclick_multitouch) };
items = items2;
}
if( Globals.RightClickMethod == Globals.RIGHT_CLICK_WITH_MULTITOUCH )
{
- CharSequence[] items2 = { p.getResources().getString(R.string.pointandclick_showcreenunderfinger),
+ CharSequence[] items2 = { p.getResources().getString(R.string.pointandclick_keepaspectratio),
+ p.getResources().getString(R.string.pointandclick_showcreenunderfinger),
p.getResources().getString(R.string.pointandclick_usepressure) };
items = items2;
}
+ if( ! Globals.AppNeedsTwoButtonMouse )
+ {
+ CharSequence[] items2 = { p.getResources().getString(R.string.pointandclick_keepaspectratio) };
+ items = items2;
+ }
AlertDialog.Builder builder = new AlertDialog.Builder(p);
builder.setTitle(p.getResources().getString(R.string.pointandclick_question));
@@ -525,15 +537,17 @@ class Settings
public void onClick(DialogInterface dialog, int item, boolean isChecked)
{
if( item == 0 )
- Globals.ShowScreenUnderFinger = isChecked;
+ Globals.KeepAspectRatio = isChecked;
if( item == 1 )
+ Globals.ShowScreenUnderFinger = isChecked;
+ if( item == 2 )
{
if( Globals.RightClickMethod == Globals.RIGHT_CLICK_WITH_PRESSURE )
Globals.LeftClickUsesMultitouch = isChecked;
else
Globals.LeftClickUsesPressure = isChecked;
}
- if( item == 2 )
+ if( item == 3 )
Globals.LeftClickUsesMultitouch = isChecked;
}
});
diff --git a/project/java/Video.java b/project/java/Video.java
index 872f9d99b..923caaae8 100644
--- a/project/java/Video.java
+++ b/project/java/Video.java
@@ -186,7 +186,7 @@ class DemoRenderer extends GLSurfaceView_SDL.Renderer {
}
public void onSurfaceChanged(GL10 gl, int w, int h) {
- nativeResize(w, h);
+ nativeResize(w, h, Globals.KeepAspectRatio ? 1 : 0);
}
public void onSurfaceDestroyed() {
@@ -250,7 +250,7 @@ class DemoRenderer extends GLSurfaceView_SDL.Renderer {
private native void nativeInitJavaCallbacks();
private native void nativeInit(String CommandLine);
- private native void nativeResize(int w, int h);
+ private native void nativeResize(int w, int h, int keepAspectRatio);
private native void nativeDone();
private native void nativeGlContextLost();
public native void nativeGlContextRecreated();
diff --git a/project/java/translations/values/strings.xml b/project/java/translations/values/strings.xml
index 7cc2764c0..2b11b8b6f 100644
--- a/project/java/translations/values/strings.xml
+++ b/project/java/translations/values/strings.xml
@@ -64,7 +64,8 @@
Touch screen with second finger
Touch screen with force
- Advanced point-and-click features
+ Advanced features
+ Keep 4:3 acreen aspect ratio
Show screen under finger in separate window
Left click triggered by touch force
Left click triggered by touch with second finger
diff --git a/project/jni/application/sc2/AndroidAppSettings.cfg b/project/jni/application/sc2/AndroidAppSettings.cfg
index dc6a65c0e..f3b778c6b 100644
--- a/project/jni/application/sc2/AndroidAppSettings.cfg
+++ b/project/jni/application/sc2/AndroidAppSettings.cfg
@@ -5,7 +5,7 @@ AppName="Ur-Quan Masters"
AppFullName=com.sourceforge.sc2
ScreenOrientation=h
InhibitSuspend=n
-AppDataDownloadUrl="Game data is 14 Mb|https://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/sc2-data.zip/download|https://sites.google.com/site/xpelyax/Home/sc2-data.zip?attredirects=0&d=1|http:// sitesproxy.goapk.com/site/xpelyax/Home/sc2-data.zip^3DO remixed music (19 Mb) - enable it in Setup->Sound Options->3DO Remixes|:addons/3domusic/3domusic.zip:https://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/3domusic.zip/download|:addons/3domusic/3domusic.zip:https://sites. google.com/site/xpelyax/Home/3domusic.zip?attredirects=0&d=1|:addons/3domusic/3domusic.zip:http://sitesproxy.goapk.com/site/xpelyax/Home/3domusic.zip^UQM music remix pack (150 Mb) - enable it in Setup->Sound Options->UQM Remixes|:addons/remix/remix.zip:https://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/remix.zip/download^3DO voice (115 Mb) - go to Setup->Sound Options and increase Voice volume from zero|:addons/3dovoice/3dovoice.zip:https://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/3dovoice.zip/download^Russian translation|:addons/lang/shadow-content/lang.zip:http://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/translations/2/russian.zip/download^Deutsch translation|:addons/lang/shadow-content/lang.zip:http://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/translations/2/deutsch.zip/download^Spanish translation|:addons/lang/shadow-content/lang.zip:http://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/translations/2/spanish.zip/download^Slovak translation|:addons/lang/shadow-content/lang.zip:http://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/translations/2/slovak.zip/download^Finnish translation|:addons/lang/shadow-content/lang.zip:http://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/translations/2/finnish.zip/download^3DO video support - after installing this pack copy all files from|https://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/3dovideo.zip/download^your 3DO Star Control II game CD from 'duckart' dir to the SD card to dir|https://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/3dovideo.zip/download^'app-data/com.sourceforge.sc2/addons/3dovideo', to extract files from 3DO disk use|https://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/3dovideo.zip/download^'3DO Commander' or 'uncd-rom' apps from http://madroms.free.fr/3do/|https://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/3dovideo.zip/download^Then from the game change 'Setup->PC/3DO compat->Cutscenes' to Movies, and restart game|https://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/3dovideo.zip/download"
+AppDataDownloadUrl="Game data is 14 Mb|https://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/sc2-data-3.zip/download^3DO remixed music (19 Mb) - enable it in Setup->Sound Options->3DO Remixes|:addons/3domusic/3domusic.zip:https://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/3domusic.zip/download^UQM music remix pack (150 Mb) - enable it in Setup->Sound Options->UQM Remixes|:addons/remix/remix.zip:https://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/remix.zip/download^3DO voice (115 Mb) - go to Setup->Sound Options and increase Voice volume from zero|:addons/3dovoice/3dovoice.zip:https://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/3dovoice.zip/download^Russian translation|:addons/lang/shadow-content/lang.zip:http://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/translations/2/russian.zip/download^Deutsch translation|:addons/lang/shadow-content/lang.zip:http://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/translations/2/deutsch.zip/download^Spanish translation|:addons/lang/shadow-content/lang.zip:http://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/translations/2/spanish.zip/download^Slovak translation|:addons/lang/shadow-content/lang.zip:http://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/translations/2/slovak.zip/download^Finnish translation|:addons/lang/shadow-content/lang.zip:http://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/translations/2/finnish.zip/download^3DO video support - after installing this pack copy all files from|https://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/3dovideo.zip/download^your 3DO Star Control II game CD from 'duckart' dir to the SD card to dir|https://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/3dovideo.zip/download^'app-data/com.sourceforge.sc2/addons/3dovideo', to extract files from 3DO disk use|https://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/3dovideo.zip/download^'3DO Commander' or 'uncd-rom' apps from http://madroms.free.fr/3do/|https://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/3dovideo.zip/download^Then from the game change 'Setup->PC/3DO compat->Cutscenes' to Movies, and restart game|https://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/3dovideo.zip/download"
SdlVideoResize=y
SdlVideoResizeKeepAspect=n
NeedDepthBuffer=n
@@ -21,11 +21,11 @@ RedefinedKeys="RETURN RSHIFT KP_PLUS KP_MINUS RCTRL F10"
AppTouchscreenKeyboardKeysAmount=2
AppTouchscreenKeyboardKeysAmountAutoFire=0
MultiABI=n
-AppVersionCode=06918
-AppVersionName="0.6.9.18 - translation packages work for real now"
+AppVersionCode=06919
+AppVersionName="0.6.9.19"
CompiledLibraries="sdl_image tremor ogg"
CustomBuildScript=n
-AppCflags='-O3 -DTHREADLIB_SDL=1 -DTIMELIB=SDL -DOVCODEC_TREMOR=1 -DNETPLAY=1 -DHAVE_REGEX=1 -DHAVE_GETOPT_LONG=1 -DHAVE_ZIP=1 -DHAVE_JOYSTICK=1 -DDIRECTIONAL_JOYSTICK_MELEE=1'
+AppCflags='-O3 -DTHREADLIB_SDL=1 -DTIMELIB=SDL -DOVCODEC_TREMOR=1 -DNETPLAY=1 -DHAVE_REGEX=1 -DHAVE_GETOPT_LONG=1 -DHAVE_ZIP=1 -DHAVE_JOYSTICK=1'
AppLdflags=''
AppSubdirsBuild=''
AppUseCrystaXToolchain=n
diff --git a/project/jni/application/sc2/src/options.c b/project/jni/application/sc2/src/options.c
index e8ff50131..d7fec70df 100644
--- a/project/jni/application/sc2/src/options.c
+++ b/project/jni/application/sc2/src/options.c
@@ -50,6 +50,7 @@ int optWhichIntro;
int optWhichShield;
int optSmoothScroll;
int optMeleeScale;
+int optDirectionalJoystick;
const char **optAddons;
BOOLEAN opt3doMusic;
diff --git a/project/jni/application/sc2/src/options.h b/project/jni/application/sc2/src/options.h
index c675aec02..065376ef9 100644
--- a/project/jni/application/sc2/src/options.h
+++ b/project/jni/application/sc2/src/options.h
@@ -37,6 +37,7 @@ extern int optWhichIntro;
extern int optWhichShield;
extern int optSmoothScroll;
extern int optMeleeScale;
+extern int optDirectionalJoystick;
extern BOOLEAN opt3doMusic;
extern BOOLEAN optRemixMusic;
diff --git a/project/jni/application/sc2/src/uqm.c b/project/jni/application/sc2/src/uqm.c
index 25e9912c1..f47c491ff 100644
--- a/project/jni/application/sc2/src/uqm.c
+++ b/project/jni/application/sc2/src/uqm.c
@@ -127,6 +127,7 @@ struct options_struct
DECL_CONFIG_OPTION(float, sfxVolumeScale);
DECL_CONFIG_OPTION(float, speechVolumeScale);
DECL_CONFIG_OPTION(bool, safeMode);
+ DECL_CONFIG_OPTION(bool, directionalJoystick);
#define INIT_CONFIG_OPTION(name, val) \
{ val, false }
@@ -260,6 +261,7 @@ main (int argc, char *argv[])
INIT_CONFIG_OPTION( sfxVolumeScale, 1.0f ),
INIT_CONFIG_OPTION( speechVolumeScale, 1.0f ),
INIT_CONFIG_OPTION( safeMode, false ),
+ INIT_CONFIG_OPTION( directionalJoystick, true ),
};
struct options_struct defaults = options;
int optionsResult;
@@ -396,6 +398,7 @@ main (int argc, char *argv[])
sfxVolumeScale = options.sfxVolumeScale.value;
speechVolumeScale = options.speechVolumeScale.value;
optAddons = options.addons;
+ optDirectionalJoystick = options.directionalJoystick.value;
prepareContentDir (options.contentDir, options.addonDir, argv[0]);
prepareMeleeDir ();
@@ -617,6 +620,7 @@ getUserConfigOptions (struct options_struct *options)
getBoolConfigValue (&options->fullscreen, "config.fullscreen");
getBoolConfigValue (&options->scanlines, "config.scanlines");
getBoolConfigValue (&options->showFps, "config.showfps");
+ getBoolConfigValue (&options->directionalJoystick, "config.directionaljoystick");
getBoolConfigValue (&options->keepAspectRatio, "config.keepaspectratio");
getBoolConfigValue (&options->subtitles, "config.subtitles");
diff --git a/project/jni/application/sc2/src/uqm/gameinp.c b/project/jni/application/sc2/src/uqm/gameinp.c
index 2dd022dd4..fe3ce51c9 100644
--- a/project/jni/application/sc2/src/uqm/gameinp.c
+++ b/project/jni/application/sc2/src/uqm/gameinp.c
@@ -544,9 +544,7 @@ static inline int atan2i(int y, int x)
BATTLE_INPUT_STATE GetDirectionalJoystickInput(int direction)
{
BATTLE_INPUT_STATE InputState = 0;
-#ifdef DIRECTIONAL_JOYSTICK_MELEE
- if(VControl_GetJoysticksAmount() <= 0)
-#endif
+ if(VControl_GetJoysticksAmount() <= 0 || !optDirectionalJoystick)
{
if(CurrentInputState.key[PlayerControls[0]][KEY_UP])
InputState |= BATTLE_THRUST;
@@ -555,7 +553,6 @@ BATTLE_INPUT_STATE GetDirectionalJoystickInput(int direction)
if (CurrentInputState.key[PlayerControls[0]][KEY_RIGHT])
InputState |= BATTLE_RIGHT;
}
-#ifdef DIRECTIONAL_JOYSTICK_MELEE
else
{
/* TODO: only joystick #0 supported currently */
@@ -571,7 +568,7 @@ BATTLE_INPUT_STATE GetDirectionalJoystickInput(int direction)
angle -= atan2i_PI * 2;
angle = angle * SHIP_DIRECTIONS / atan2i_PI / 2;
- diff = angle - direction + SHIP_DIRECTIONS / 4;
+ diff = angle - direction - SHIP_DIRECTIONS / 4;
while( diff >= SHIP_DIRECTIONS )
diff -= SHIP_DIRECTIONS;
while( diff < 0 )
@@ -586,6 +583,5 @@ BATTLE_INPUT_STATE GetDirectionalJoystickInput(int direction)
InputState |= BATTLE_THRUST;
}
}
-#endif
return InputState;
}
diff --git a/project/jni/application/sc2/src/uqm/setupmenu.c b/project/jni/application/sc2/src/uqm/setupmenu.c
index 3ea8c0225..45489b6a8 100644
--- a/project/jni/application/sc2/src/uqm/setupmenu.c
+++ b/project/jni/application/sc2/src/uqm/setupmenu.c
@@ -73,7 +73,7 @@ static void clear_control (WIDGET_CONTROLENTRY *widget);
#endif
#define MENU_COUNT 8
-#define CHOICE_COUNT 22
+#define CHOICE_COUNT 23
#define SLIDER_COUNT 3
#define BUTTON_COUNT 10
#define LABEL_COUNT 4
@@ -96,7 +96,7 @@ typedef int (*HANDLER)(WIDGET *, int);
static int choice_widths[CHOICE_COUNT] = {
3, 2, 3, 3, 2, 2, 2, 2, 2, 2,
2, 2, 3, 2, 2, 3, 3, 2, 3, 3,
- 3, 2 };
+ 3, 2, 2 };
static HANDLER button_handlers[BUTTON_COUNT] = {
quit_main_menu, quit_sub_menu, do_graphics, do_engine,
@@ -106,9 +106,9 @@ static HANDLER button_handlers[BUTTON_COUNT] = {
static int menu_sizes[MENU_COUNT] = {
7, 5, 7, 9, 2, 5,
#ifdef HAVE_OPENGL
- 5,
+ 6,
#else
- 4,
+ 5,
#endif
11
};
@@ -160,6 +160,7 @@ static WIDGET *advanced_widgets[] = {
(WIDGET *)(&choices[12]),
(WIDGET *)(&choices[15]),
(WIDGET *)(&choices[16]),
+ (WIDGET *)(&choices[22]),
(WIDGET *)(&buttons[1]) };
static WIDGET *keyconfig_widgets[] = {
@@ -387,6 +388,7 @@ SetDefaults (void)
choices[19].selected = opts.player2;
choices[20].selected = 0;
choices[21].selected = opts.musicremix;
+ choices[22].selected = opts.directionaljoystick;
sliders[0].value = opts.musicvol;
sliders[1].value = opts.sfxvol;
@@ -418,6 +420,7 @@ PropagateResults (void)
opts.player1 = choices[18].selected;
opts.player2 = choices[19].selected;
opts.musicremix = choices[21].selected;
+ opts.directionaljoystick = choices[22].selected;
opts.musicvol = sliders[0].value;
opts.sfxvol = sliders[1].value;
@@ -1093,6 +1096,7 @@ GetGlobalOptions (GLOBALOPTS *opts)
/* These values are read in, but won't change during a run. */
opts->music3do = opt3doMusic ? OPTVAL_ENABLED : OPTVAL_DISABLED;
opts->musicremix = optRemixMusic ? OPTVAL_ENABLED : OPTVAL_DISABLED;
+ opts->directionaljoystick = optDirectionalJoystick ? OPTVAL_ENABLED : OPTVAL_DISABLED;
switch (snddriver) {
case audio_DRIVER_OPENAL:
opts->adriver = OPTVAL_OPENAL;
@@ -1313,6 +1317,7 @@ SetGlobalOptions (GLOBALOPTS *opts)
optWhichShield = (opts->shield == OPTVAL_3DO) ? OPT_3DO : OPT_PC;
optMeleeScale = (opts->meleezoom == OPTVAL_3DO) ? TFB_SCALE_TRILINEAR : TFB_SCALE_STEP;
optWhichIntro = (opts->intro == OPTVAL_3DO) ? OPT_3DO : OPT_PC;
+ optDirectionalJoystick = (opts->directionaljoystick == OPTVAL_ENABLED) ? TRUE : FALSE;
PlayerControls[0] = opts->player1;
PlayerControls[1] = opts->player2;
@@ -1326,6 +1331,7 @@ SetGlobalOptions (GLOBALOPTS *opts)
res_PutBoolean ("config.remixmusic", opts->musicremix == OPTVAL_ENABLED);
res_PutBoolean ("config.3domovies", opts->intro == OPTVAL_3DO);
res_PutBoolean ("config.showfps", opts->fps == OPTVAL_ENABLED);
+ res_PutBoolean ("config.directionaljoystick", opts->directionaljoystick == OPTVAL_ENABLED);
res_PutBoolean ("config.smoothmelee", opts->meleezoom == OPTVAL_3DO);
res_PutBoolean ("config.positionalsfx", opts->stereo == OPTVAL_ENABLED);
res_PutBoolean ("config.pulseshield", opts->shield == OPTVAL_3DO);
diff --git a/project/jni/application/sc2/src/uqm/setupmenu.h b/project/jni/application/sc2/src/uqm/setupmenu.h
index 257b74508..e75bf78ac 100644
--- a/project/jni/application/sc2/src/uqm/setupmenu.h
+++ b/project/jni/application/sc2/src/uqm/setupmenu.h
@@ -74,7 +74,7 @@ typedef struct globalopts_struct {
OPT_DRIVERTYPE driver;
OPT_ADRIVERTYPE adriver;
OPT_AQUALITYTYPE aquality;
- OPT_ENABLABLE fullscreen, subtitles, scanlines, fps, stereo, music3do, musicremix;
+ OPT_ENABLABLE fullscreen, subtitles, scanlines, fps, stereo, music3do, musicremix, directionaljoystick;
OPT_CONSOLETYPE menu, text, cscan, scroll, intro, meleezoom, shield;
CONTROL_TEMPLATE player1, player2;
int speechvol, musicvol, sfxvol;
diff --git a/project/jni/application/scummvm/AndroidAppSettings.cfg b/project/jni/application/scummvm/AndroidAppSettings.cfg
index 578cba086..e9d73742e 100644
--- a/project/jni/application/scummvm/AndroidAppSettings.cfg
+++ b/project/jni/application/scummvm/AndroidAppSettings.cfg
@@ -5,7 +5,7 @@ AppName="ScummVM"
AppFullName=org.scummvm.sdl
ScreenOrientation=h
InhibitSuspend=n
-AppDataDownloadUrl="Data files size is 3.5 Mb|http://sourceforge.net/projects/libsdl-android/files/ScummVM/scummvm-1.2.0-data.zip/download^Lure of the Temptress (English, 10 Mb)|http://sourceforge.net/projects/scummvm/files/extras/Lure%20of%20the%20Temptress/lure-1.1.zip/download^Lure of the Temptress (German, 10 Mb)|http://sourceforge.net/projects/scummvm/files/extras/Lure%20of%20the%20Temptress/lure-de-1.1.zip/download^Lure of the Temptress (French, 10 Mb)|http://sourceforge.net/projects/scummvm/files/extras/Lure%20of%20the%20Temptress/lure-fr-1.1.zip/download^Lure of the Temptress (Italian, 10 Mb)|http://sourceforge.net/projects/scummvm/files/extras/Lure%20of%20the%20Temptress/lure-it-1.1.zip/download^Lure of the Temptress (Spanish, 10 Mb)|http://sourceforge.net/projects/scummvm/files/extras/Lure%20of%20the%20Temptress/lure-es-1.1.zip/download^Beneath a Steel Sky (CD version, 70 Mb)|http://sourceforge.net/projects/scummvm/files/extras/Beneath%20a%20Steel%20Sky/bass-cd-1.2.zip/download^Beneath a Steel Sky (floppy version, 10 Mb)|http://sourceforge.net/projects/scummvm/files/extras/Beneath%20a%20Steel%20Sky/BASS-Floppy-1.3.zip/download^Flight of the Amazon Queen (23 Mb)|http://sourceforge.net/projects/scummvm/files/extras/Flight%20of%20the%20Amazon%20Queen/FOTAQ_Floppy.zip/download^Flight of the Amazon Queen - voice addon (English, 35 Mb)|http://sourceforge.net/projects/scummvm/files/extras/Flight%20of%20the%20Amazon%20Queen/FOTAQ_Talkie-1.1.zip/download^Flight of the Amazon Queen - voice addon (German, 80 Mb)|http://sourceforge.net/projects/scummvm/files/extras/Flight%20of%20the%20Amazon%20Queen/FOTAQ_Ger_talkie-1.0.zip/download^Flight of the Amazon Queen - voice addon (Hebrew, 70 Mb)|http://sourceforge.net/projects/scummvm/files/extras/Flight%20of%20the%20Amazon%20Queen/FOTAQ_Heb_talkie.zip/download^Drascula: The Vampire Strikes Back (35 Mb)|http://sourceforge.net/projects/scummvm/files/extras/Drascula_%20The%20Vampire%20Strikes%20Back/drascula-1.0.zip/download^Drascula: The Vampire Strikes Back - translations addon (35 Mb)|http://sourceforge.net/projects/scummvm/files/extras/Drascula_%20The%20Vampire%20Strikes%20Back/drascula-int-1.1.zip/download^Drascula: The Vampire Strikes Back - audio addon (40 Mb)|http://sourceforge.net/projects/scummvm/files/extras/Drascula_%20The%20Vampire%20Strikes%20Back/drascula-audio-2.0.zip/download"
+AppDataDownloadUrl="Data files size is 3.5 Mb|http://sourceforge.net/projects/libsdl-android/files/ScummVM/scummvm-1.2.0-data.zip/download^MIDI music support (30 Mb) - add soundfont in Options->MIDI|http://sourceforge.net/projects/libsdl-android/files/GeneralUser-GS-FluidSynth-v1.43.sf2.zip/download^Lure of the Temptress (English, 10 Mb)|http://sourceforge.net/projects/scummvm/files/extras/Lure%20of%20the%20Temptress/lure-1.1.zip/download^Lure of the Temptress (German, 10 Mb)|http://sourceforge.net/projects/scummvm/files/extras/Lure%20of%20the%20Temptress/lure-de-1.1.zip/download^Lure of the Temptress (French, 10 Mb)|http://sourceforge.net/projects/scummvm/files/extras/Lure%20of%20the%20Temptress/lure-fr-1.1.zip/download^Lure of the Temptress (Italian, 10 Mb)|http://sourceforge.net/projects/scummvm/files/extras/Lure%20of%20the%20Temptress/lure-it-1.1.zip/download^Lure of the Temptress (Spanish, 10 Mb)|http://sourceforge.net/projects/scummvm/files/extras/Lure%20of%20the%20Temptress/lure-es-1.1.zip/download^Beneath a Steel Sky (CD version, 70 Mb)|http://sourceforge.net/projects/scummvm/files/extras/Beneath%20a%20Steel%20Sky/bass-cd-1.2.zip/download^Beneath a Steel Sky (floppy version, 10 Mb)|http://sourceforge.net/projects/scummvm/files/extras/Beneath%20a%20Steel%20Sky/BASS-Floppy-1.3.zip/download^Flight of the Amazon Queen (23 Mb)|http://sourceforge.net/projects/scummvm/files/extras/Flight%20of%20the%20Amazon%20Queen/FOTAQ_Floppy.zip/download^Flight of the Amazon Queen - voice addon (English, 35 Mb)|http://sourceforge.net/projects/scummvm/files/extras/Flight%20of%20the%20Amazon%20Queen/FOTAQ_Talkie-1.1.zip/download^Flight of the Amazon Queen - voice addon (German, 80 Mb)|http://sourceforge.net/projects/scummvm/files/extras/Flight%20of%20the%20Amazon%20Queen/FOTAQ_Ger_talkie-1.0.zip/download^Flight of the Amazon Queen - voice addon (Hebrew, 70 Mb)|http://sourceforge.net/projects/scummvm/files/extras/Flight%20of%20the%20Amazon%20Queen/FOTAQ_Heb_talkie.zip/download^Drascula: The Vampire Strikes Back (35 Mb)|http://sourceforge.net/projects/scummvm/files/extras/Drascula_%20The%20Vampire%20Strikes%20Back/drascula-1.0.zip/download^Drascula: The Vampire Strikes Back - translations addon (35 Mb)|http://sourceforge.net/projects/scummvm/files/extras/Drascula_%20The%20Vampire%20Strikes%20Back/drascula-int-1.1.zip/download^Drascula: The Vampire Strikes Back - audio addon (40 Mb)|http://sourceforge.net/projects/scummvm/files/extras/Drascula_%20The%20Vampire%20Strikes%20Back/drascula-audio-2.0.zip/download"
SdlVideoResize=y
SdlVideoResizeKeepAspect=n
NeedDepthBuffer=n
@@ -23,7 +23,7 @@ AppTouchscreenKeyboardKeysAmountAutoFire=0
MultiABI=n
AppVersionCode=12001
AppVersionName="1.2.0.01"
-CompiledLibraries="mad tremor flac ogg jpeg png"
+CompiledLibraries="mad tremor flac ogg jpeg png fluidsynth"
CustomBuildScript=y
AppCflags=''
AppLdflags=''
diff --git a/project/jni/application/scummvm/AndroidBuild.sh b/project/jni/application/scummvm/AndroidBuild.sh
index 5ee45985f..1d635f432 100755
--- a/project/jni/application/scummvm/AndroidBuild.sh
+++ b/project/jni/application/scummvm/AndroidBuild.sh
@@ -21,6 +21,6 @@ ln -sf libtremor.a $LOCAL_PATH/../../../obj/local/armeabi/libvorbisidec.a
ln -sf libflac.a $LOCAL_PATH/../../../obj/local/armeabi/libFLAC.a
if [ \! -f scummvm/config.mk ] ; then
- ../setEnvironment.sh sh -c "cd scummvm && env LIBS='-lflac -ltremor -logg -lmad -lz -lgcc' ./configure --host=androidsdl --enable-zlib --enable-tremor --enable-mad --enable-flac --enable-vkeybd --enable-verbose-build --disable-hq-scalers --disable-readline --disable-nasm --datadir=."
+ ../setEnvironment.sh sh -c "cd scummvm && env LIBS='-lflac -ltremor -logg -lmad -lz -lgcc -lfluidsynth' ./configure --host=androidsdl --enable-zlib --enable-tremor --enable-mad --enable-flac --enable-vkeybd --enable-verbose-build --disable-hq-scalers --disable-readline --disable-nasm --disable-mt32emu --datadir=. --with-fluidsynth-prefix=$LOCAL_PATH/../../fluidsynth"
fi
../setEnvironment.sh make -C scummvm -j2 && cp -f scummvm/scummvm libapplication.so
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 e55825a45..121cad11b 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
@@ -313,6 +313,8 @@ SDL_Surface *ANDROID_SetVideoMode(_THIS, SDL_Surface *current,
HwSurfaceList[HwSurfaceCount-1] = current;
DEBUGOUT("ANDROID_SetVideoMode() HwSurfaceCount %d HwSurfaceList %p", HwSurfaceCount, HwSurfaceList);
}
+ glViewport(0, 0, SDL_ANDROID_sRealWindowWidth, SDL_ANDROID_sRealWindowHeight);
+ glOrthof(0.0, (GLfloat) SDL_ANDROID_sWindowWidth, (GLfloat) SDL_ANDROID_sWindowHeight, 0.0, 0.0, 1.0);
}
/* Allocate the new pixel format for the screen */
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 4f048ea25..7ed09ac76 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
@@ -50,6 +50,11 @@
int SDL_ANDROID_sWindowWidth = 0;
int SDL_ANDROID_sWindowHeight = 0;
+int SDL_ANDROID_sRealWindowWidth = 0;
+int SDL_ANDROID_sRealWindowHeight = 0;
+
+SDL_Rect SDL_ANDROID_ForceClearScreenRect = { 0, 0, 0, 0 };
+
// Extremely wicked JNI environment to call Java functions from C code
static JNIEnv* JavaEnv = NULL;
static jclass JavaRendererClass = NULL;
@@ -78,6 +83,27 @@ int SDL_ANDROID_CallJavaSwapBuffers()
SDL_ANDROID_drawTouchscreenKeyboard();
SDL_ANDROID_processAndroidTrackballDampening();
}
+
+ // Clear part of screen not used by SDL - on Android the screen contains garbage after each frame
+ if( SDL_ANDROID_ForceClearScreenRect.w != 0 && SDL_ANDROID_ForceClearScreenRect.h != 0 )
+ {
+ glPushMatrix();
+ glLoadIdentity();
+ glOrthox( 0, (SDL_ANDROID_sRealWindowWidth) * 0x10000, SDL_ANDROID_sRealWindowHeight * 0x10000, 0, 0, 1 * 0x10000 );
+ glColor4x(0, 0, 0, 0x10000);
+ glEnableClientState(GL_VERTEX_ARRAY);
+
+ GLshort vertices[] = { SDL_ANDROID_ForceClearScreenRect.x, SDL_ANDROID_ForceClearScreenRect.y,
+ SDL_ANDROID_ForceClearScreenRect.x + SDL_ANDROID_ForceClearScreenRect.w, SDL_ANDROID_ForceClearScreenRect.y,
+ SDL_ANDROID_ForceClearScreenRect.x + SDL_ANDROID_ForceClearScreenRect.w, SDL_ANDROID_ForceClearScreenRect.y + SDL_ANDROID_ForceClearScreenRect.h,
+ SDL_ANDROID_ForceClearScreenRect.x, SDL_ANDROID_ForceClearScreenRect.y + SDL_ANDROID_ForceClearScreenRect.h };
+ glVertexPointer(2, GL_SHORT, 0, vertices);
+ glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
+
+ glDisableClientState(GL_VERTEX_ARRAY);
+ glPopMatrix();
+ }
+
if( ! (*JavaEnv)->CallIntMethod( JavaEnv, JavaRenderer, JavaSwapBuffers ) )
return 0;
if( glContextLost )
@@ -97,24 +123,42 @@ int SDL_ANDROID_CallJavaSwapBuffers()
JNIEXPORT void JNICALL
-JAVA_EXPORT_NAME(DemoRenderer_nativeResize) ( JNIEnv* env, jobject thiz, jint w, jint h )
+JAVA_EXPORT_NAME(DemoRenderer_nativeResize) ( JNIEnv* env, jobject thiz, jint w, jint h, jint keepRatio )
{
if( SDL_ANDROID_sWindowWidth == 0 )
{
- #if SDL_VIDEO_RENDER_RESIZE_KEEP_ASPECT
- // TODO: tweak that parameters when app calls SetVideoMode(), not here - app may request something else than 640x480, it's okay for most apps though
- // Also this should be user-configurable setting, not compiler option
- SDL_ANDROID_sWindowWidth = (SDL_ANDROID_sFakeWindowWidth*h)/SDL_ANDROID_sFakeWindowHeight;
- SDL_ANDROID_sWindowHeight = h;
- if(SDL_ANDROID_sWindowWidth > w) {
- SDL_ANDROID_sWindowWidth = w;
- SDL_ANDROID_sWindowHeight = (SDL_ANDROID_sFakeWindowHeight*w)/SDL_ANDROID_sFakeWindowWidth;
+ SDL_ANDROID_sRealWindowWidth = w;
+ SDL_ANDROID_sRealWindowHeight = h;
+ if( keepRatio )
+ {
+ // TODO: tweak that parameters when app calls SetVideoMode(), not here - app may request something else than 640x480, it's okay for most apps though
+ SDL_ANDROID_sWindowWidth = (SDL_ANDROID_sFakeWindowWidth*h)/SDL_ANDROID_sFakeWindowHeight;
+ SDL_ANDROID_sWindowHeight = h;
+ SDL_ANDROID_ForceClearScreenRect.x = SDL_ANDROID_sWindowWidth;
+ SDL_ANDROID_ForceClearScreenRect.y = 0;
+ SDL_ANDROID_ForceClearScreenRect.w = w - SDL_ANDROID_sWindowWidth;
+ SDL_ANDROID_ForceClearScreenRect.h = h;
+
+ if(SDL_ANDROID_sWindowWidth >= w)
+ {
+ SDL_ANDROID_sWindowWidth = w;
+ SDL_ANDROID_sWindowHeight = (SDL_ANDROID_sFakeWindowHeight*w)/SDL_ANDROID_sFakeWindowWidth;
+ SDL_ANDROID_ForceClearScreenRect.x = 0;
+ SDL_ANDROID_ForceClearScreenRect.y = SDL_ANDROID_sWindowHeight;
+ SDL_ANDROID_ForceClearScreenRect.w = w;
+ SDL_ANDROID_ForceClearScreenRect.h = SDL_ANDROID_sWindowHeight - h; // OpenGL vertical coord is inverted
+ }
}
- #else
- SDL_ANDROID_sWindowWidth = w;
- SDL_ANDROID_sWindowHeight = h;
- #endif
- __android_log_print(ANDROID_LOG_INFO, "libSDL", "Physical screen resolution is %dx%d", w, h);
+ else
+ {
+ SDL_ANDROID_ForceClearScreenRect.w = 0;
+ SDL_ANDROID_ForceClearScreenRect.h = 0;
+ SDL_ANDROID_ForceClearScreenRect.x = 0;
+ SDL_ANDROID_ForceClearScreenRect.y = 0;
+ SDL_ANDROID_sWindowWidth = w;
+ SDL_ANDROID_sWindowHeight = h;
+ }
+ __android_log_print(ANDROID_LOG_INFO, "libSDL", "Physical screen resolution is %dx%d, virtual screen %dx%d", w, h, SDL_ANDROID_sWindowWidth, SDL_ANDROID_sWindowHeight );
}
}
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 63b9d9e08..8818740c7 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
@@ -29,8 +29,11 @@
extern int SDL_ANDROID_sWindowWidth;
extern int SDL_ANDROID_sWindowHeight;
+extern int SDL_ANDROID_sRealWindowWidth;
+extern int SDL_ANDROID_sRealWindowHeight;
extern int SDL_ANDROID_sFakeWindowWidth; // SDL 1.2 only
extern int SDL_ANDROID_sFakeWindowHeight; // SDL 1.2 only
+extern SDL_Rect SDL_ANDROID_ForceClearScreenRect;
extern int SDL_ANDROID_ShowScreenUnderFinger;
extern SDL_Rect SDL_ANDROID_ShowScreenUnderFingerRect, SDL_ANDROID_ShowScreenUnderFingerRectSrc;
extern int SDL_ANDROID_CallJavaSwapBuffers();