mirror of
https://github.com/libretro/RetroArch
synced 2025-03-01 07:13:35 +00:00
[Android] Clean up RetroActivity.
This commit is contained in:
parent
21bc30a44c
commit
85a1a21c77
@ -16,31 +16,29 @@ public final class RetroActivity extends NativeActivity
|
|||||||
private Camera mCamera;
|
private Camera mCamera;
|
||||||
private long lastTimestamp = 0;
|
private long lastTimestamp = 0;
|
||||||
private SurfaceTexture texture;
|
private SurfaceTexture texture;
|
||||||
|
|
||||||
static {
|
// Static constructor
|
||||||
|
static
|
||||||
|
{
|
||||||
|
Log.i("RetroActivity", "Creating RetroActivity");
|
||||||
System.loadLibrary("retroarch-activity");
|
System.loadLibrary("retroarch-activity");
|
||||||
}
|
}
|
||||||
|
|
||||||
public RetroActivity() {
|
|
||||||
super();
|
|
||||||
Log.i("RetroActivity", "Creating MyNativeActivity");
|
|
||||||
}
|
|
||||||
|
|
||||||
public void onCameraStart()
|
public void onCameraStart()
|
||||||
{
|
{
|
||||||
mCamera.startPreview();
|
mCamera.startPreview();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onCameraStop()
|
public void onCameraStop()
|
||||||
{
|
{
|
||||||
mCamera.stopPreview();
|
mCamera.stopPreview();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onCameraInit()
|
public void onCameraInit()
|
||||||
{
|
{
|
||||||
mCamera = Camera.open();
|
mCamera = Camera.open();
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressLint("NewApi")
|
@SuppressLint("NewApi")
|
||||||
public boolean onCameraPoll()
|
public boolean onCameraPoll()
|
||||||
{
|
{
|
||||||
@ -59,17 +57,18 @@ public final class RetroActivity extends NativeActivity
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
ret = true;
|
ret = true;
|
||||||
|
}
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onCameraFree()
|
public void onCameraFree()
|
||||||
{
|
{
|
||||||
mCamera.release();
|
mCamera.release();
|
||||||
mCamera = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@SuppressLint("NewApi")
|
@SuppressLint("NewApi")
|
||||||
public void onCameraSetTexture(int gl_texid) throws IOException
|
public void onCameraSetTexture(int gl_texid) throws IOException
|
||||||
{
|
{
|
||||||
@ -79,22 +78,14 @@ public final class RetroActivity extends NativeActivity
|
|||||||
mCamera.setPreviewTexture(texture);
|
mCamera.setPreviewTexture(texture);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
{
|
||||||
mCamera.setPreviewDisplay(null);
|
mCamera.setPreviewDisplay(null);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void onDestroy()
|
public void onDestroy()
|
||||||
{
|
{
|
||||||
UserPreferences.readbackConfigFile(this);
|
UserPreferences.readbackConfigFile(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onLowMemory()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void onTrimMemory(int level)
|
|
||||||
{
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user