Some preliminary Ouya support
This commit is contained in:
@@ -112,4 +112,5 @@ class Globals
|
||||
public static boolean VideoLinearFilter = true;
|
||||
public static boolean MultiThreadedVideo = false;
|
||||
public static boolean BrokenLibCMessageShown = false;
|
||||
public static boolean IsOuya = false; // Ouya game console has no Back key, so we need to map some game controller key to Back key
|
||||
}
|
||||
|
||||
@@ -60,6 +60,7 @@ import java.io.FileInputStream;
|
||||
import java.util.zip.*;
|
||||
import java.util.zip.ZipEntry;
|
||||
import java.util.zip.ZipInputStream;
|
||||
import java.util.Set;
|
||||
import android.text.SpannedString;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.BufferedInputStream;
|
||||
@@ -92,6 +93,18 @@ public class MainActivity extends Activity
|
||||
getWindow().setFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON,
|
||||
WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
|
||||
|
||||
if( getIntent().getCategories() != null )
|
||||
{
|
||||
for( String cat: getIntent().getCategories() )
|
||||
{
|
||||
System.out.println("libSDL: getIntent().getCategories(): " + cat);
|
||||
if( cat.equals("ouya.intent.category.GAME") ) {
|
||||
System.out.println("libSDL: Ouya game console detected");
|
||||
Globals.IsOuya = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
System.out.println("libSDL: Creating startup screen");
|
||||
_layout = new LinearLayout(this);
|
||||
_layout.setOrientation(LinearLayout.VERTICAL);
|
||||
|
||||
@@ -170,7 +170,7 @@ class Settings
|
||||
return;
|
||||
}
|
||||
System.out.println("libSDL: Settings.Load(): enter");
|
||||
nativeInitKeymap();
|
||||
nativeInitKeymap(Globals.IsOuya ? 1 : 0);
|
||||
for( int i = 0; i < SDL_Keys.JAVA_KEYCODE_LAST; i++ )
|
||||
{
|
||||
int sdlKey = nativeGetKeymapKey(i);
|
||||
@@ -2812,7 +2812,7 @@ class Settings
|
||||
private static native void nativeSetVideoForceSoftwareMode();
|
||||
private static native void nativeSetupScreenKeyboard(int size, int drawsize, int theme, int nbuttonsAutoFire, int transparency);
|
||||
private static native void nativeSetupScreenKeyboardButtons(byte[] img);
|
||||
private static native void nativeInitKeymap();
|
||||
private static native void nativeInitKeymap(int isOuya);
|
||||
private static native int nativeGetKeymapKey(int key);
|
||||
private static native void nativeSetKeymapKey(int javakey, int key);
|
||||
private static native int nativeGetKeymapKeyScreenKb(int keynum);
|
||||
|
||||
Reference in New Issue
Block a user