[Android] Some minor cleanup.

This commit is contained in:
Ryan Houdek
2013-07-27 15:09:18 -05:00
parent 9b20280bcf
commit 5d38a9c91e
5 changed files with 35 additions and 29 deletions

View File

@ -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;
}

View File

@ -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;
}
}

View File

@ -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)
{