Android: UI configuration for QueueRender setting

This commit is contained in:
Ender's Games 2018-08-22 14:42:10 -04:00
parent eebf3fc57c
commit e81f43ff20
10 changed files with 143 additions and 0 deletions

View File

@ -27,6 +27,7 @@ public class Emulator extends Application {
public static final String pref_frameskip = "frame_skip";
public static final String pref_pvrrender = "pvr_render";
public static final String pref_syncedrender = "synced_render";
public static final String pref_queuerender = "queue_render";
public static final String pref_modvols = "modifier_volumes";
public static final String pref_bootdisk = "boot_disk";
public static final String pref_usereios = "use_reios";
@ -48,6 +49,7 @@ public class Emulator extends Application {
public static int frameskip = 0;
public static boolean pvrrender = false;
public static boolean syncedrender = false;
public static boolean queuerender = false;
public static boolean modvols = true;
public static String bootdisk = "null";
public static boolean usereios = false;
@ -72,6 +74,7 @@ public class Emulator extends Application {
Emulator.frameskip = mPrefs.getInt(pref_frameskip, frameskip);
Emulator.pvrrender = mPrefs.getBoolean(pref_pvrrender, pvrrender);
Emulator.syncedrender = mPrefs.getBoolean(pref_syncedrender, syncedrender);
Emulator.queuerender = mPrefs.getBoolean(pref_queuerender, queuerender);
Emulator.modvols = mPrefs.getBoolean(pref_modvols, modvols);
Emulator.bootdisk = mPrefs.getString(pref_bootdisk, bootdisk);
Emulator.usereios = mPrefs.getBoolean(pref_usereios, usereios);
@ -100,6 +103,7 @@ public class Emulator extends Application {
JNIdc.frameskip(Emulator.frameskip);
JNIdc.pvrrender(Emulator.pvrrender ? 1 : 0);
JNIdc.syncedrender(Emulator.syncedrender ? 1 : 0);
JNIdc.queuerender(Emulator.queuerender ? 1 : 0);
JNIdc.modvols(Emulator.modvols ? 1 : 0);
JNIdc.usereios(Emulator.usereios ? 1 : 0);
JNIdc.bootdisk(Emulator.bootdisk);
@ -114,15 +118,18 @@ public class Emulator extends Application {
Emulator.frameskip = mPrefs.getInt(pref_frameskip, frameskip);
Emulator.pvrrender = mPrefs.getBoolean(pref_pvrrender, pvrrender);
Emulator.syncedrender = mPrefs.getBoolean(pref_syncedrender, syncedrender);
Emulator.queuerender = mPrefs.getBoolean(pref_queuerender, queuerender);
Emulator.modvols = mPrefs.getBoolean(pref_modvols, modvols);
}
public void loadGameConfiguration() {
JNIdc.unstable(Emulator.unstableopt ? 1 : 0);
JNIdc.safemode(Emulator.dynsafemode ? 1 : 0);
JNIdc.interrupthack(Emulator.interrupt ? 1 : 0);
JNIdc.frameskip(Emulator.frameskip);
JNIdc.pvrrender(Emulator.pvrrender ? 1 : 0);
JNIdc.syncedrender(Emulator.syncedrender ? 1 : 0);
JNIdc.queuerender(Emulator.queuerender ? 1 : 0);
JNIdc.modvols(Emulator.modvols ? 1 : 0);
}

View File

@ -454,6 +454,15 @@ public class OptionsFragment extends Fragment {
synced_render.setChecked(mPrefs.getBoolean(Emulator.pref_syncedrender, Emulator.syncedrender));
synced_render.setOnCheckedChangeListener(synchronous);
OnCheckedChangeListener queued = new OnCheckedChangeListener() {
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {
mPrefs.edit().putBoolean(Emulator.pref_queuerender, isChecked).apply();
}
};
CompoundButton queue_render = (CompoundButton) getView().findViewById(R.id.queuerender_option);
queue_render.setChecked(mPrefs.getBoolean(Emulator.pref_queuerender, Emulator.queuerender));
queue_render.setOnCheckedChangeListener(queued);
OnCheckedChangeListener mod_volumes = new OnCheckedChangeListener() {
public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) {

View File

@ -53,6 +53,7 @@ public class PGConfigFragment extends Fragment {
private SeekBar frameSeek;
private CompoundButton pvr_render;
private CompoundButton synced_render;
private CompoundButton queue_render;
private CompoundButton modifier_volumes;
private CompoundButton interrupt_opt;
@ -89,6 +90,7 @@ public class PGConfigFragment extends Fragment {
frameSeek = (SeekBar) getView().findViewById(R.id.frame_seekbar);
pvr_render = (CompoundButton) getView().findViewById(R.id.render_option);
synced_render = (CompoundButton) getView().findViewById(R.id.syncrender_option);
queue_render = (CompoundButton) getView().findViewById(R.id.queuerender_option);
modifier_volumes = (CompoundButton) getView().findViewById(R.id.modvols_option);
interrupt_opt = (CompoundButton) getView().findViewById(R.id.interrupt_option);
}
@ -99,6 +101,7 @@ public class PGConfigFragment extends Fragment {
.putInt(Emulator.pref_frameskip, frameSeek.getProgress())
.putBoolean(Emulator.pref_pvrrender, pvr_render.isChecked())
.putBoolean(Emulator.pref_syncedrender, synced_render.isChecked())
.putBoolean(Emulator.pref_queuerender, queue_render.isChecked())
.putBoolean(Emulator.pref_modvols, modifier_volumes.isChecked())
.putBoolean(Emulator.pref_interrupt, interrupt_opt.isChecked()).apply();
}
@ -145,6 +148,7 @@ public class PGConfigFragment extends Fragment {
pvr_render.setChecked(mPrefs.getBoolean(Emulator.pref_pvrrender, Emulator.pvrrender));
synced_render.setChecked(mPrefs.getBoolean(Emulator.pref_syncedrender, Emulator.syncedrender));
queue_render.setChecked(mPrefs.getBoolean(Emulator.pref_queuerender, Emulator.queuerender));
modifier_volumes.setChecked(mPrefs.getBoolean(Emulator.pref_modvols, Emulator.modvols));
interrupt_opt.setChecked(mPrefs.getBoolean(Emulator.pref_interrupt, Emulator.interrupt));

View File

@ -45,6 +45,7 @@ public final class JNIdc
public static native void frameskip(int frames);
public static native void pvrrender(int render);
public static native void syncedrender(int sync);
public static native void queuerender(int queue);
public static native void modvols(int volumes);
public static native void bootdisk(String disk);
public static native void usereios(int reios);

View File

@ -8,6 +8,7 @@
#include <EGL/egl.h>
#include <GLES2/gl2.h>
#include <types.h>
#include "types.h"
#include "hw/maple/maple_cfg.h"
@ -60,6 +61,7 @@ JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_subdivide(JNIEnv *env
JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_frameskip(JNIEnv *env,jobject obj, jint frames) __attribute__((visibility("default")));
JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_pvrrender(JNIEnv *env,jobject obj, jint render) __attribute__((visibility("default")));
JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_syncedrender(JNIEnv *env,jobject obj, jint sync) __attribute__((visibility("default")));
JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_queuerender(JNIEnv *env,jobject obj, jint queue) __attribute__((visibility("default")));
JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_modvols(JNIEnv *env,jobject obj, jint volumes) __attribute__((visibility("default")));
JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_bootdisk(JNIEnv *env,jobject obj, jstring disk) __attribute__((visibility("default")));
JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_usereios(JNIEnv *env,jobject obj, jint reios) __attribute__((visibility("default")));
@ -151,6 +153,12 @@ JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_syncedrender(JNIEnv *
settings.pvr.SynchronousRender = sync;
}
JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_queuerender(JNIEnv *env,jobject obj, jint queue)
{
settings.pvr.QueueRender = queue;
}
JNIEXPORT void JNICALL Java_com_reicast_emulator_emu_JNIdc_modvols(JNIEnv *env,jobject obj, jint volumes)
{
settings.rend.ModifierVolumes = volumes;

View File

@ -747,6 +747,34 @@
</LinearLayout>
</TableRow>
<TableRow
android:layout_marginTop="10dp"
android:gravity="center_vertical" >
<TextView
android:id="@+id/queuerender_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:ems="10"
android:gravity="center_vertical|left"
android:text="@string/select_queuerender" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:orientation="vertical" >
<Switch
android:id="@+id/queuerender_option"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:focusable="true" />
</LinearLayout>
</TableRow>
<TableRow
android:layout_marginTop="10dp"
android:gravity="center_vertical" >

View File

@ -226,6 +226,34 @@
</LinearLayout>
</TableRow>
<TableRow
android:layout_marginTop="10dp"
android:gravity="center_vertical" >
<TextView
android:id="@+id/queuerender_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:ems="10"
android:gravity="center_vertical|left"
android:text="@string/select_queuerender" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:orientation="vertical" >
<Switch
android:id="@+id/queuerender_option"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:focusable="true" />
</LinearLayout>
</TableRow>
<TableRow
android:layout_marginTop="10dp"
android:gravity="center_vertical" >

View File

@ -747,6 +747,34 @@
</LinearLayout>
</TableRow>
<TableRow
android:layout_marginTop="10dp"
android:gravity="center_vertical" >
<TextView
android:id="@+id/queuerender_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:ems="10"
android:gravity="center_vertical|left"
android:text="@string/select_queuerender" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:orientation="vertical" >
<Checkbox
android:id="@+id/queuerender_option"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:focusable="true" />
</LinearLayout>
</TableRow>
<TableRow
android:layout_marginTop="10dp"
android:gravity="center_vertical" >

View File

@ -226,6 +226,34 @@
</LinearLayout>
</TableRow>
<TableRow
android:layout_marginTop="10dp"
android:gravity="center_vertical" >
<TextView
android:id="@+id/queuerender_text"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="0.5"
android:ems="10"
android:gravity="center_vertical|left"
android:text="@string/select_queuerender" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:orientation="vertical" >
<Checkbox
android:id="@+id/queuerender_option"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:focusable="true" />
</LinearLayout>
</TableRow>
<TableRow
android:layout_marginTop="10dp"
android:gravity="center_vertical" >
@ -281,6 +309,7 @@
android:focusable="true" />
</LinearLayout>
</TableRow>
<TableRow
android:layout_marginTop="10dp"
android:gravity="center_vertical" >

View File

@ -48,6 +48,7 @@
<string name="set_frameskip">Frameskip Value</string>
<string name="select_render">PVR Rendering (does nothing for now)</string>
<string name="select_syncrender">Synchronous Rendering</string>
<string name="select_queuerender">Queue Rendering</string>
<string name="select_modvols">Enable Modifier Volumes</string>
<string name="select_interrupt">Enable Interrupt Hack</string>
<string name="select_fps">Show On-Screen FPS</string>