mirror of
https://github.com/wheremyfoodat/Panda3DS.git
synced 2025-04-06 06:05:40 +12:00
Merge pull request #619 from GabrielBRDeveloper/accurate-option
Implement accurate shader multiplication option
This commit is contained in:
commit
edb047ec34
10 changed files with 18 additions and 2 deletions
|
@ -44,6 +44,7 @@ extern "C" {
|
|||
AlberFunction(void, functionName) (JNIEnv* env, jobject obj, type value) { emulator->getConfig().settingName = value; }
|
||||
|
||||
MAKE_SETTING(setShaderJitEnabled, jboolean, shaderJitEnabled)
|
||||
MAKE_SETTING(setAccurateShaderMulEnable, jboolean, accurateShaderMul)
|
||||
|
||||
#undef MAKE_SETTING
|
||||
|
||||
|
|
|
@ -33,6 +33,7 @@ public class AlberDriver {
|
|||
public static native byte[] GetSmdh();
|
||||
|
||||
public static native void setShaderJitEnabled(boolean enable);
|
||||
public static native void setAccurateShaderMulEnable(boolean enable);
|
||||
|
||||
public static int openDocument(String path, String mode) {
|
||||
try {
|
||||
|
|
|
@ -109,7 +109,7 @@ public class GameActivity extends BaseActivity implements EmulatorCallback, Sens
|
|||
@Override
|
||||
protected void onResume() {
|
||||
super.onResume();
|
||||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
|
||||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);
|
||||
getWindow().getDecorView().setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN | View.SYSTEM_UI_FLAG_HIDE_NAVIGATION);
|
||||
getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
|
||||
InputHandler.reset();
|
||||
|
|
|
@ -22,6 +22,7 @@ public class AdvancedPreferences extends BasePreferenceFragment {
|
|||
|
||||
setItemClick("performanceMonitor", pref -> GlobalConfig.set(GlobalConfig.KEY_SHOW_PERFORMANCE_OVERLAY, ((SwitchPreferenceCompat) pref).isChecked()));
|
||||
setItemClick("shaderJit", pref -> GlobalConfig.set(GlobalConfig.KEY_SHADER_JIT, ((SwitchPreferenceCompat) pref).isChecked()));
|
||||
setItemClick("accurateShaderMul", pref -> GlobalConfig.set(GlobalConfig.KEY_ACCURATE_SHADER_MULTIPLY, ((SwitchPreferenceCompat) pref).isChecked()));
|
||||
setItemClick("loggerService", pref -> {
|
||||
boolean checked = ((SwitchPreferenceCompat) pref).isChecked();
|
||||
Context ctx = PandroidApplication.getAppContext();
|
||||
|
@ -46,5 +47,6 @@ public class AdvancedPreferences extends BasePreferenceFragment {
|
|||
((SwitchPreferenceCompat) findPreference("performanceMonitor")).setChecked(GlobalConfig.get(GlobalConfig.KEY_SHOW_PERFORMANCE_OVERLAY));
|
||||
((SwitchPreferenceCompat) findPreference("loggerService")).setChecked(GlobalConfig.get(GlobalConfig.KEY_LOGGER_SERVICE));
|
||||
((SwitchPreferenceCompat) findPreference("shaderJit")).setChecked(GlobalConfig.get(GlobalConfig.KEY_SHADER_JIT));
|
||||
((SwitchPreferenceCompat) findPreference("accurateShaderMul")).setChecked(GlobalConfig.get(GlobalConfig.KEY_ACCURATE_SHADER_MULTIPLY));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -23,7 +23,7 @@ public class ScreenEditorPreference extends Fragment {
|
|||
@Override
|
||||
public View onCreateView(@NonNull LayoutInflater inflater, @Nullable ViewGroup container, @Nullable Bundle savedInstanceState) {
|
||||
layout = new LinearLayout(container.getContext());
|
||||
layout.setSystemUiVisibility(View.SYSTEM_UI_FLAG_HIDE_NAVIGATION|View.SYSTEM_UI_FLAG_FULLSCREEN|View.SYSTEM_UI_FLAG_IMMERSIVE);
|
||||
layout.setSystemUiVisibility(View.SYSTEM_UI_FLAG_FULLSCREEN|View.SYSTEM_UI_FLAG_IMMERSIVE);
|
||||
return layout;
|
||||
}
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@ public class GlobalConfig {
|
|||
public static DataModel data;
|
||||
|
||||
public static final Key<Boolean> KEY_SHADER_JIT = new Key<>("emu.shader_jit", true);
|
||||
public static final Key<Boolean> KEY_ACCURATE_SHADER_MULTIPLY = new Key<>("emu.accurate_shader_mul", false);
|
||||
public static final Key<Boolean> KEY_PICTURE_IN_PICTURE = new Key<>("app.behavior.pictureInPicture", false);
|
||||
public static final Key<Boolean> KEY_SHOW_PERFORMANCE_OVERLAY = new Key<>("dev.performanceOverlay", false);
|
||||
public static final Key<Boolean> KEY_LOGGER_SERVICE = new Key<>("dev.loggerService", false);
|
||||
|
|
|
@ -93,6 +93,7 @@ public class PandaGlRenderer implements GLSurfaceView.Renderer, ConsoleRenderer
|
|||
|
||||
AlberDriver.Initialize();
|
||||
AlberDriver.setShaderJitEnabled(GlobalConfig.get(GlobalConfig.KEY_SHADER_JIT));
|
||||
AlberDriver.setAccurateShaderMulEnable(GlobalConfig.get(GlobalConfig.KEY_ACCURATE_SHADER_MULTIPLY));
|
||||
|
||||
// If loading the ROM failed, display an error message and early exit
|
||||
if (!AlberDriver.LoadRom(romPath)) {
|
||||
|
|
|
@ -90,4 +90,6 @@
|
|||
<string name="behavior">Comportamento</string>
|
||||
<string name="invalid_game">Jogo invalido</string>
|
||||
<string name="tools">Ferramentas</string>
|
||||
<string name="pref_accurate_shader_title">Multiplicação precisa de shader</string>
|
||||
<string name="pref_accurate_shader_summary">Usar calculos mais precisos para shaders</string>
|
||||
</resources>
|
||||
|
|
|
@ -96,4 +96,6 @@
|
|||
<string name="region_taiwan">Taiwan</string>
|
||||
<string name="behavior">Behavior</string>
|
||||
<string name="invalid_game">Invalid game</string>
|
||||
<string name="pref_accurate_shader_title">Accurate shader multiplication</string>
|
||||
<string name="pref_accurate_shader_summary">Use better precision on shaders</string>
|
||||
</resources>
|
||||
|
|
|
@ -28,5 +28,11 @@
|
|||
app:summary="@string/pref_shader_jit_summary"
|
||||
app:iconSpaceReserved="false"/>
|
||||
|
||||
<SwitchPreferenceCompat
|
||||
app:key="accurateShaderMul"
|
||||
app:title="@string/pref_accurate_shader_title"
|
||||
app:summary="@string/pref_accurate_shader_summary"
|
||||
app:iconSpaceReserved="false"/>
|
||||
|
||||
</PreferenceCategory>
|
||||
</PreferenceScreen>
|
Loading…
Add table
Reference in a new issue