mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
[Android] Some minor cleanup.
This commit is contained in:
@ -159,11 +159,8 @@ public class DolphinEmulator<MainActivity> extends Activity
|
||||
GLview = new NativeGLSurfaceView(this);
|
||||
this.getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
|
||||
String backend = NativeLibrary.GetConfig("Dolphin.ini", "Core", "GFXBackend", "Software Renderer");
|
||||
if (backend.equals("OGL"))
|
||||
GLview.SetDimensions(screenHeight, screenWidth);
|
||||
else
|
||||
GLview.SetDimensions(screenWidth, screenHeight);
|
||||
GLview.SetFileName(FileName);
|
||||
NativeLibrary.SetDimensions((int)screenWidth, (int)screenHeight);
|
||||
NativeLibrary.SetFilename(FileName);
|
||||
setContentView(GLview);
|
||||
Running = true;
|
||||
}
|
||||
|
@ -5,12 +5,9 @@ import android.view.SurfaceHolder;
|
||||
import android.view.SurfaceView;
|
||||
|
||||
public class NativeGLSurfaceView extends SurfaceView {
|
||||
static private String FileName;
|
||||
static private Thread myRun;
|
||||
static private boolean Running = false;
|
||||
static private boolean Created = false;
|
||||
static private float width;
|
||||
static private float height;
|
||||
|
||||
public NativeGLSurfaceView(Context context) {
|
||||
super(context);
|
||||
@ -20,7 +17,7 @@ public class NativeGLSurfaceView extends SurfaceView {
|
||||
{
|
||||
@Override
|
||||
public void run() {
|
||||
NativeLibrary.Run(FileName, getHolder().getSurface(), (int)width, (int)height);
|
||||
NativeLibrary.Run(getHolder().getSurface());
|
||||
}
|
||||
};
|
||||
getHolder().addCallback(new SurfaceHolder.Callback() {
|
||||
@ -47,15 +44,4 @@ public class NativeGLSurfaceView extends SurfaceView {
|
||||
Created = true;
|
||||
}
|
||||
}
|
||||
|
||||
public void SetFileName(String file)
|
||||
{
|
||||
FileName = file;
|
||||
}
|
||||
|
||||
public void SetDimensions(float screenWidth, float screenHeight)
|
||||
{
|
||||
width = screenWidth;
|
||||
height = screenHeight;
|
||||
}
|
||||
}
|
||||
|
@ -14,11 +14,13 @@ public class NativeLibrary {
|
||||
public static native void onGamePadMoveEvent(String Device, int Axis, float Value);
|
||||
public static native String GetConfig(String configFile, String Key, String Value, String Default);
|
||||
public static native void SetConfig(String configFile, String Key, String Value, String Default);
|
||||
public static native void SetFilename(String filename);
|
||||
public static native void SetDimensions(int width, int height);
|
||||
public static native int[] GetBanner(String filename);
|
||||
public static native String GetTitle(String filename);
|
||||
public static native String GetVersionString();
|
||||
|
||||
public static native void Run(String File, Surface surf, int width, int height);
|
||||
public static native void Run(Surface surf);
|
||||
public static native void UnPauseEmulation();
|
||||
public static native void PauseEmulation();
|
||||
public static native void StopEmulation();
|
||||
@ -27,7 +29,7 @@ public class NativeLibrary {
|
||||
{
|
||||
try
|
||||
{
|
||||
System.loadLibrary("dolphin-emu-nogui");
|
||||
System.loadLibrary("main");
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
|
Reference in New Issue
Block a user