Skip to content
Permalink
Browse files

Merge pull request #444 from fzurita/master

Auto detect android TV and x86 GLideN64 auto exit workaround
  • Loading branch information
littleguy77 committed Jul 14, 2015
2 parents 21f17ee + bee8fe8 commit d557cce2aea7978ef110b0ee1733f3d38f102cdc
@@ -1336,6 +1336,10 @@ void OGLRender::_initData()
for (u32 i = 0; i < VERTBUFF_SIZE; ++i)
triangles.vertices[i].w = 1.0f;
triangles.num = 0;

#ifdef ANDROID
__android_log_write(ANDROID_LOG_DEBUG, "GLideN64", "Finish render initialization.\n");
#endif
}

void OGLRender::_destroyData()
@@ -25,6 +25,8 @@

import paulscode.android.mupen64plusae.util.DeviceUtil;
import tv.ouya.console.api.OuyaFacade;
import android.app.UiModeManager;
import android.content.res.Configuration;
import android.annotation.TargetApi;
import android.content.Context;
import android.content.SharedPreferences;
@@ -178,6 +180,9 @@
/** Whether the installation is valid. */
public final boolean isValidInstallation;

/** True if this is android TV hardware */
public final boolean isAndroidTv;

/** The object used to persist the settings. */
private final SharedPreferences mPreferences;

@@ -197,7 +202,7 @@
*
* @param context The application context.
*/
@TargetApi( 9 )
@TargetApi( 13 )
public AppData( Context context )
{
hardwareInfo = new HardwareInfo();
@@ -278,6 +283,16 @@ public AppData( Context context )
// Preference object for persisting app data
String appDataFilename = packageName + "_appdata";
mPreferences = context.getSharedPreferences( appDataFilename, Context.MODE_PRIVATE );

if (AppData.IS_ICE_CREAM_SANDWICH)
{
UiModeManager uiModeManager = (UiModeManager) context.getSystemService(Context.UI_MODE_SERVICE);
isAndroidTv = uiModeManager.getCurrentModeType() == Configuration.UI_MODE_TYPE_TELEVISION;
}
else
{
isAndroidTv = false;
}
}

/**
@@ -394,7 +394,7 @@ public GlobalPrefs( Context context )
else if( navMode.equals( "standard" ) )
isBigScreenMode = false;
else
isBigScreenMode = AppData.IS_OUYA_HARDWARE; // TODO: Add other systems as they enter market
isBigScreenMode = AppData.IS_OUYA_HARDWARE || appData.isAndroidTv; // TODO: Add other systems as they enter market
isActionBarAvailable = AppData.IS_HONEYCOMB && !isBigScreenMode;

// Peripheral share mode

0 comments on commit d557cce

Please sign in to comment.
You can’t perform that action at this time.