OpenTyrian: Volume Up/Down keys navigate menu, mouse click will exit Enter High Score screen

This commit is contained in:
pelya
2010-09-20 15:53:04 +03:00
parent c8cdb9455e
commit f99fd72f38
22 changed files with 65 additions and 36 deletions

View File

@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" <manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.sourceforge.sc2" package="com.googlecode.opentyrian"
android:versionCode="1008" android:versionCode="2110"
android:versionName="1.0.08 - added 3DO voice pack, speed optimizations, UQM music remix packs do not work yet" android:versionName="2.1.10 - minor fixes here and there"
android:installLocation="preferExternal" android:installLocation="preferExternal"
> >
<application android:label="@string/app_name" <application android:label="@string/app_name"

View File

@@ -1,6 +1,6 @@
# The namespace in Java file, with dots replaced with underscores # The namespace in Java file, with dots replaced with underscores
SDL_JAVA_PACKAGE_PATH := com_sourceforge_sc2 SDL_JAVA_PACKAGE_PATH := com_googlecode_opentyrian
# Path to shared libraries - Android 1.6 cannot load them properly, thus we have to specify absolute path here # Path to shared libraries - Android 1.6 cannot load them properly, thus we have to specify absolute path here
# SDL_SHARED_LIBRARIES_PATH := /data/data/de.schwardtnet.alienblaster/lib # SDL_SHARED_LIBRARIES_PATH := /data/data/de.schwardtnet.alienblaster/lib
@@ -10,7 +10,7 @@ SDL_JAVA_PACKAGE_PATH := com_sourceforge_sc2
# Typically /sdcard/alienblaster # Typically /sdcard/alienblaster
# Or /data/data/de.schwardtnet.alienblaster/files if you're planning to unpack data in application private folder # Or /data/data/de.schwardtnet.alienblaster/files if you're planning to unpack data in application private folder
# Your application will just set current directory there # Your application will just set current directory there
SDL_CURDIR_PATH := com.sourceforge.sc2 SDL_CURDIR_PATH := com.googlecode.opentyrian
# Android Dev Phone G1 has trackball instead of cursor keys, and # Android Dev Phone G1 has trackball instead of cursor keys, and
# sends trackball movement events as rapid KeyDown/KeyUp events, # sends trackball movement events as rapid KeyDown/KeyUp events,
@@ -23,17 +23,17 @@ SDL_TRACKBALL_KEYUP_DELAY := 1
# resized in HW-accelerated way, however it eats a tiny bit of CPU # resized in HW-accelerated way, however it eats a tiny bit of CPU
SDL_VIDEO_RENDER_RESIZE := 1 SDL_VIDEO_RENDER_RESIZE := 1
COMPILED_LIBRARIES := sdl_image COMPILED_LIBRARIES := sdl_net
APPLICATION_ADDITIONAL_CFLAGS := -O2 -finline-functions -DTHREADLIB_SDL=1 -DTIMELIB=SDL -DOVCODEC_TREMOR=1 -DNETPLAY=1 -DHAVE_REGEX=1 -DHAVE_GETOPT_LONG=1 -DHAVE_ZIP=1 APPLICATION_ADDITIONAL_CFLAGS := -finline-functions -O2
APPLICATION_ADDITIONAL_LDFLAGS := -Lobj/local/armeabi -ltremor APPLICATION_ADDITIONAL_LDFLAGS :=
APPLICATION_SUBDIRS_BUILD := APPLICATION_SUBDIRS_BUILD :=
APPLICATION_CUSTOM_BUILD_SCRIPT := APPLICATION_CUSTOM_BUILD_SCRIPT :=
SDL_ADDITIONAL_CFLAGS := -DSDL_ANDROID_KEYCODE_MOUSE=UNKNOWN -DSDL_ANDROID_KEYCODE_0=RETURN -DSDL_ANDROID_KEYCODE_1=RSHIFT -DSDL_ANDROID_KEYCODE_2=KP_PLUS -DSDL_ANDROID_KEYCODE_3=KP_MINUS -DSDL_ANDROID_KEYCODE_4=ESCAPE -DSDL_ANDROID_KEYCODE_5=F10 SDL_ADDITIONAL_CFLAGS := -DSDL_ANDROID_KEYCODE_MOUSE=UNKNOWN -DSDL_ANDROID_KEYCODE_0=SPACE -DSDL_ANDROID_KEYCODE_1=RETURN -DSDL_ANDROID_KEYCODE_2=LCTRL -DSDL_ANDROID_KEYCODE_3=LALT -DSDL_ANDROID_KEYCODE_4=SPACE
# If SDL_Mixer should link to libMAD # If SDL_Mixer should link to libMAD
SDL_MIXER_USE_LIBMAD := SDL_MIXER_USE_LIBMAD :=

View File

@@ -5,6 +5,6 @@ APP_PROJECT_PATH := $(call my-dir)/..
# sdl_image depends on png and jpeg # sdl_image depends on png and jpeg
# sdl_ttf depends on freetype # sdl_ttf depends on freetype
APP_MODULES := application sdl sdl_main stlport tremor png jpeg freetype sdl_image APP_MODULES := application sdl sdl_main stlport tremor png jpeg freetype sdl_net
APP_ABI := armeabi APP_ABI := armeabi

View File

@@ -1,4 +1,5 @@
AppSettingVersion=6 # The application settings for Android libSDL port
AppSettingVersion=8
LibSdlVersion=1.2 LibSdlVersion=1.2
AppName="OpenTyrian" AppName="OpenTyrian"
AppFullName=com.googlecode.opentyrian AppFullName=com.googlecode.opentyrian
@@ -14,9 +15,11 @@ RedefinedKeys="SPACE RETURN LCTRL LALT SPACE"
AppTouchscreenKeyboardKeysAmount=4 AppTouchscreenKeyboardKeysAmount=4
AppTouchscreenKeyboardKeysAmountAutoFire=1 AppTouchscreenKeyboardKeysAmountAutoFire=1
MultiABI=n MultiABI=n
AppVersionCode=2109 AppVersionCode=2110
AppVersionName="2.1.09" AppVersionName="2.1.10 - minor fixes here and there, menu navigation with Volume Up/Down keys, use Menu button to select"
CompiledLibraries="sdl_net" CompiledLibraries="sdl_net"
CustomBuildScript=n
AppCflags='-finline-functions -O2' AppCflags='-finline-functions -O2'
AppLdflags='' AppLdflags=''
AppSubdirsBuild=''
ReadmeText='^You may press "Home" now - the data will be downloaded in background' ReadmeText='^You may press "Home" now - the data will be downloaded in background'

View File

@@ -840,7 +840,7 @@ enum de_mode_t JE_modeSelect( void )
{ {
break; /* User has selected, return choice */ break; /* User has selected, return choice */
} }
if (keysactive[SDLK_UP]) if (keysactive[SDLK_UP] || keysactive[SDLK_LCTRL])
{ {
if(mode == MODE_FIRST) if(mode == MODE_FIRST)
{ {
@@ -854,7 +854,7 @@ enum de_mode_t JE_modeSelect( void )
mode--; mode--;
} }
} }
if (keysactive[SDLK_DOWN]) if (keysactive[SDLK_DOWN] || keysactive[SDLK_LALT])
{ {
if(mode >= MODE_LAST-1) if(mode >= MODE_LAST-1)
{ {

View File

@@ -1030,13 +1030,13 @@ void JE_itemScreen( void )
joystick_down |= joystick[j].direction[2]; joystick_down |= joystick[j].direction[2];
} }
if (keysactive[SDLK_UP] || joystick_up) if (keysactive[SDLK_UP] || keysactive[SDLK_LCTRL] || joystick_up)
{ {
yChg = -1; yChg = -1;
inputDetected = false; inputDetected = false;
} }
if (keysactive[SDLK_DOWN] || joystick_down) if (keysactive[SDLK_DOWN] || keysactive[SDLK_LALT] || joystick_down)
{ {
yChg = 1; yChg = 1;
inputDetected = false; inputDetected = false;
@@ -1310,6 +1310,7 @@ void JE_itemScreen( void )
break; break;
case SDLK_UP: case SDLK_UP:
case SDLK_LCTRL:
keyboardUsed = true; keyboardUsed = true;
lastDirection = -1; lastDirection = -1;
@@ -1335,6 +1336,7 @@ void JE_itemScreen( void )
break; break;
case SDLK_DOWN: case SDLK_DOWN:
case SDLK_LALT:
keyboardUsed = true; keyboardUsed = true;
lastDirection = 1; lastDirection = 1;

View File

@@ -156,12 +156,14 @@ void jukebox( void )
case SDLK_LEFT: case SDLK_LEFT:
case SDLK_UP: case SDLK_UP:
case SDLK_LCTRL:
play_song((song_playing > 0 ? song_playing : MUSIC_NUM) - 1); play_song((song_playing > 0 ? song_playing : MUSIC_NUM) - 1);
stopped = false; stopped = false;
break; break;
case SDLK_RETURN: case SDLK_RETURN:
case SDLK_RIGHT: case SDLK_RIGHT:
case SDLK_DOWN: case SDLK_DOWN:
case SDLK_LALT:
play_song((song_playing + 1) % MUSIC_NUM); play_song((song_playing + 1) % MUSIC_NUM);
stopped = false; stopped = false;
break; break;

View File

@@ -269,6 +269,7 @@ void JE_helpSystem( JE_byte startTopic )
switch (lastkey_sym) switch (lastkey_sym)
{ {
case SDLK_UP: case SDLK_UP:
case SDLK_LCTRL:
menu--; menu--;
if (menu < 2) if (menu < 2)
{ {
@@ -277,6 +278,7 @@ void JE_helpSystem( JE_byte startTopic )
JE_playSampleNum(S_CURSOR); JE_playSampleNum(S_CURSOR);
break; break;
case SDLK_DOWN: case SDLK_DOWN:
case SDLK_LALT:
menu++; menu++;
if (menu > TOPICS) if (menu > TOPICS)
{ {
@@ -395,6 +397,7 @@ void JE_helpSystem( JE_byte startTopic )
case SDLK_LEFT: case SDLK_LEFT:
case SDLK_UP: case SDLK_UP:
case SDLK_PAGEUP: case SDLK_PAGEUP:
case SDLK_LCTRL:
page--; page--;
JE_playSampleNum(S_CURSOR); JE_playSampleNum(S_CURSOR);
break; break;
@@ -403,6 +406,7 @@ void JE_helpSystem( JE_byte startTopic )
case SDLK_PAGEDOWN: case SDLK_PAGEDOWN:
case SDLK_RETURN: case SDLK_RETURN:
case SDLK_SPACE: case SDLK_SPACE:
case SDLK_LALT:
if (page == MAX_PAGE) if (page == MAX_PAGE)
{ {
page = 0; page = 0;
@@ -628,6 +632,7 @@ void JE_loadScreen( void )
switch (lastkey_sym) switch (lastkey_sym)
{ {
case SDLK_UP: case SDLK_UP:
case SDLK_LCTRL:
sel--; sel--;
if (sel < min) if (sel < min)
{ {
@@ -636,6 +641,7 @@ void JE_loadScreen( void )
JE_playSampleNum(S_CURSOR); JE_playSampleNum(S_CURSOR);
break; break;
case SDLK_DOWN: case SDLK_DOWN:
case SDLK_LALT:
sel++; sel++;
if (sel > max) if (sel > max)
{ {
@@ -1251,6 +1257,7 @@ JE_boolean JE_inGameSetup( void )
JE_playSampleNum(S_SPRING); JE_playSampleNum(S_SPRING);
break; break;
case SDLK_UP: case SDLK_UP:
case SDLK_LCTRL:
if (--sel < 1) if (--sel < 1)
{ {
sel = 6; sel = 6;
@@ -1258,6 +1265,7 @@ JE_boolean JE_inGameSetup( void )
JE_playSampleNum(S_CURSOR); JE_playSampleNum(S_CURSOR);
break; break;
case SDLK_DOWN: case SDLK_DOWN:
case SDLK_LALT:
if (++sel > 6) if (++sel > 6)
{ {
sel = 1; sel = 1;
@@ -1581,7 +1589,7 @@ void JE_highScoreCheck( void )
if (!playing) if (!playing)
play_song(31); play_song(31);
/*
if (mouseButton > 0) if (mouseButton > 0)
{ {
if (mouseX > 56 && mouseX < 142 && mouseY > 123 && mouseY < 149) if (mouseX > 56 && mouseX < 142 && mouseY > 123 && mouseY < 149)
@@ -1594,10 +1602,14 @@ void JE_highScoreCheck( void )
cancel = true; cancel = true;
} }
} }
else if (newkey) else
*/
if (newkey || newmouse)
{ {
bool validkey = false; bool validkey = false;
lastkey_char = toupper(lastkey_char); lastkey_char = toupper(lastkey_char);
if(mouse_pressed[0])
lastkey_char = SDLK_SPACE;
switch(lastkey_char) switch(lastkey_char)
{ {
//case ' ': //case ' ':

View File

@@ -62,6 +62,7 @@ bool select_gameplay( void )
switch (lastkey_sym) switch (lastkey_sym)
{ {
case SDLK_UP: case SDLK_UP:
case SDLK_LCTRL:
gameplay--; gameplay--;
if (gameplay < 1) if (gameplay < 1)
{ {
@@ -70,6 +71,7 @@ bool select_gameplay( void )
JE_playSampleNum(S_CURSOR); JE_playSampleNum(S_CURSOR);
break; break;
case SDLK_DOWN: case SDLK_DOWN:
case SDLK_LALT:
gameplay++; gameplay++;
if (gameplay > gameplay_max) if (gameplay > gameplay_max)
{ {
@@ -139,6 +141,7 @@ bool select_episode( void )
switch (lastkey_sym) switch (lastkey_sym)
{ {
case SDLK_UP: case SDLK_UP:
case SDLK_LCTRL:
episode--; episode--;
if (episode < 1) if (episode < 1)
{ {
@@ -147,6 +150,7 @@ bool select_episode( void )
JE_playSampleNum(S_CURSOR); JE_playSampleNum(S_CURSOR);
break; break;
case SDLK_DOWN: case SDLK_DOWN:
case SDLK_LALT:
episode++; episode++;
if (episode > episode_max) if (episode > episode_max)
{ {
@@ -225,6 +229,7 @@ bool select_difficulty( void )
switch (lastkey_sym) switch (lastkey_sym)
{ {
case SDLK_UP: case SDLK_UP:
case SDLK_LCTRL:
difficultyLevel--; difficultyLevel--;
if (difficultyLevel < 1) if (difficultyLevel < 1)
{ {
@@ -233,6 +238,7 @@ bool select_difficulty( void )
JE_playSampleNum(S_CURSOR); JE_playSampleNum(S_CURSOR);
break; break;
case SDLK_DOWN: case SDLK_DOWN:
case SDLK_LALT:
difficultyLevel++; difficultyLevel++;
if (difficultyLevel > difficulty_max) if (difficultyLevel > difficulty_max)
{ {

View File

@@ -126,6 +126,7 @@ void opentyrian_menu( void )
switch (lastkey_sym) switch (lastkey_sym)
{ {
case SDLK_UP: case SDLK_UP:
case SDLK_LCTRL:
sel--; sel--;
if (sel < 0) if (sel < 0)
{ {
@@ -134,6 +135,7 @@ void opentyrian_menu( void )
JE_playSampleNum(S_CURSOR); JE_playSampleNum(S_CURSOR);
break; break;
case SDLK_DOWN: case SDLK_DOWN:
case SDLK_LALT:
sel++; sel++;
if (sel > maxSel) if (sel > maxSel)
{ {

View File

@@ -3547,6 +3547,7 @@ bool JE_titleScreen( JE_boolean animate )
switch (lastkey_sym) switch (lastkey_sym)
{ {
case SDLK_UP: case SDLK_UP:
case SDLK_LCTRL:
if (menu == 0) if (menu == 0)
menu = menunum-1; menu = menunum-1;
else else
@@ -3554,6 +3555,7 @@ bool JE_titleScreen( JE_boolean animate )
JE_playSampleNum(S_CURSOR); JE_playSampleNum(S_CURSOR);
break; break;
case SDLK_DOWN: case SDLK_DOWN:
case SDLK_LALT:
if (menu == menunum-1) if (menu == menunum-1)
menu = 0; menu = 0;
else else

View File

@@ -1 +1 @@
sc2 opentyrian

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<resources> <resources>
<string name="app_name">Ur-Quan Masters</string> <string name="app_name">OpenTyrian</string>
</resources> </resources>

View File

@@ -1,5 +1,5 @@
// This string is autogenerated by ChangeAppSettings.sh, do not change spaces amount // This string is autogenerated by ChangeAppSettings.sh, do not change spaces amount
package com.sourceforge.sc2; package com.googlecode.opentyrian;
import android.app.Activity; import android.app.Activity;
import android.content.Context; import android.content.Context;

View File

@@ -1,6 +1,6 @@
// This string is autogenerated by ChangeAppSettings.sh, do not change // This string is autogenerated by ChangeAppSettings.sh, do not change
// spaces amount // spaces amount
package com.sourceforge.sc2; package com.googlecode.opentyrian;
import java.util.zip.*; import java.util.zip.*;
import java.io.*; import java.io.*;

View File

@@ -1,5 +1,5 @@
// This string is autogenerated by ChangeAppSettings.sh, do not change spaces amount // This string is autogenerated by ChangeAppSettings.sh, do not change spaces amount
package com.sourceforge.sc2; package com.googlecode.opentyrian;
import android.app.Activity; import android.app.Activity;

View File

@@ -1,5 +1,5 @@
// This string is autogenerated by ChangeAppSettings.sh, do not change spaces amount // This string is autogenerated by ChangeAppSettings.sh, do not change spaces amount
package com.sourceforge.sc2; package com.googlecode.opentyrian;
import android.app.Activity; import android.app.Activity;
import android.content.Context; import android.content.Context;

View File

@@ -18,7 +18,7 @@
fixed with a hammer and rasp to work with libSDL port */ fixed with a hammer and rasp to work with libSDL port */
// This string is autogenerated by ChangeAppSettings.sh, do not change spaces amount // This string is autogenerated by ChangeAppSettings.sh, do not change spaces amount
package com.sourceforge.sc2; package com.googlecode.opentyrian;
import java.io.Writer; import java.io.Writer;
import java.util.ArrayList; import java.util.ArrayList;

View File

@@ -1,14 +1,14 @@
// This string is autogenerated by ChangeAppSettings.sh, do not change spaces amount anywhere // This string is autogenerated by ChangeAppSettings.sh, do not change spaces amount anywhere
package com.sourceforge.sc2; package com.googlecode.opentyrian;
import android.app.Activity; import android.app.Activity;
import android.content.Context; import android.content.Context;
class Globals { class Globals {
public static String ApplicationName = "Ur-QuanMasters"; public static String ApplicationName = "OpenTyrian";
// Should be zip file // Should be zip file
public static String DataDownloadUrl = "Game data is 14 Mb|https://sites.google.com/site/xpelyax/Home/sc2-data.zip?attredirects=0%26d=1|https://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/sc2-data.zip/download|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://sites.google.com/site/xpelyax/Home/3domusic.zip?attredirects=0%26d=1|:addons/3domusic/3domusic.zip:https://sourceforge.net/projects/libsdl-android/files/Ur-Quan%20Masters/3domusic.zip/download|:addons/3domusic/3domusic.zip:http://sitesproxy.goapk.com/site/xpelyax/Home/3domusic.zip^UQM music remix pack 1 (50 Mb) - enable it in Setup->Sound Options->UQM Remixes|:addons/remix/uqm-remix-pack1.zip:http://sourceforge.net/projects/sc2/files/UQM%20Remix%20Packs/UQM%20Remix%20Pack%201/uqm-remix-pack1.zip/download^UQM music remix pack 2 (60 Mb)|:addons/remix/uqm-remix-pack2.zip:http://sourceforge.net/projects/sc2/files/UQM%20Remix%20Packs/UQM%20Remix%20Pack%202/uqm-remix-pack2.zip/download^UQM music remix pack 3 (40 Mb)|:addons/remix/uqm-remix-pack3.zip:http://sourceforge.net/projects/sc2/files/UQM%20Remix%20Packs/UQM%20Remix%20Pack%203/uqm-remix-pack3.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"; public static String DataDownloadUrl = "Data files size is 11 Mb|http://sites.google.com/site/xpelyax/Home/tyrian21-data.zip?attredirects=0%26d=1|http://sitesproxy.goapk.com/site/xpelyax/Home/tyrian21-data.zip";
// Set this value to true if you're planning to render 3D using OpenGL - it eats some GFX resources, so disabled for 2D // Set this value to true if you're planning to render 3D using OpenGL - it eats some GFX resources, so disabled for 2D
public static boolean NeedDepthBuffer = false; public static boolean NeedDepthBuffer = false;
@@ -19,7 +19,7 @@ class Globals {
// Readme text to be shown on download page // Readme text to be shown on download page
public static String ReadmeText = "^You may press \"Home\" now - the data will be downloaded in background".replace("^","\n"); public static String ReadmeText = "^You may press \"Home\" now - the data will be downloaded in background".replace("^","\n");
public static boolean AppUsesMouse = false; public static boolean AppUsesMouse = true;
public static boolean AppNeedsArrowKeys = true; public static boolean AppNeedsArrowKeys = true;
@@ -27,9 +27,9 @@ class Globals {
public static boolean AppUsesMultitouch = false; public static boolean AppUsesMultitouch = false;
public static int AppTouchscreenKeyboardKeysAmount = 2; public static int AppTouchscreenKeyboardKeysAmount = 4;
public static int AppTouchscreenKeyboardKeysAmountAutoFire = 2; public static int AppTouchscreenKeyboardKeysAmountAutoFire = 1;
// Phone-specific config // Phone-specific config
// It will download app data to /sdcard/alienblaster if set to true, // It will download app data to /sdcard/alienblaster if set to true,
@@ -48,5 +48,5 @@ class Globals {
} }
class LoadLibrary { class LoadLibrary {
public LoadLibrary() { System.loadLibrary("sdl"); System.loadLibrary("sdl_image"); }; public LoadLibrary() { System.loadLibrary("sdl"); System.loadLibrary("sdl_net"); };
} }

View File

@@ -1,5 +1,5 @@
// This string is autogenerated by ChangeAppSettings.sh, do not change spaces amount // This string is autogenerated by ChangeAppSettings.sh, do not change spaces amount
package com.sourceforge.sc2; package com.googlecode.opentyrian;
import android.app.Activity; import android.app.Activity;
import android.content.Context; import android.content.Context;

View File

@@ -1,5 +1,5 @@
// This string is autogenerated by ChangeAppSettings.sh, do not change spaces amount // This string is autogenerated by ChangeAppSettings.sh, do not change spaces amount
package com.sourceforge.sc2; package com.googlecode.opentyrian;
import android.app.Activity; import android.app.Activity;
import android.content.Context; import android.content.Context;

View File

@@ -1,5 +1,5 @@
// This string is autogenerated by ChangeAppSettings.sh, do not change spaces amount // This string is autogenerated by ChangeAppSettings.sh, do not change spaces amount
package com.sourceforge.sc2; package com.googlecode.opentyrian;
import javax.microedition.khronos.opengles.GL10; import javax.microedition.khronos.opengles.GL10;