mirror of
https://github.com/EmulatorJS/EmulatorJS.git
synced 2026-02-06 11:17:36 +00:00
Fix SharedArrayBuffer check & video rotation without reload (#923)
* video_roation without reload * fix SharedArrayBuffer check * remove notCoreOption check
This commit is contained in:
parent
39c9ec9e6c
commit
35639bb896
@ -29,7 +29,8 @@ class EJS_GameManager {
|
||||
toggleSlowMotion: this.Module.cwrap('toggle_slow_motion', 'null', ['number']),
|
||||
setSlowMotionRatio: this.Module.cwrap('set_sm_ratio', 'null', ['number']),
|
||||
getFrameNum: this.Module.cwrap('get_current_frame_count', 'number', ['']),
|
||||
setVSync: this.Module.cwrap('set_vsync', 'null', ['number'])
|
||||
setVSync: this.Module.cwrap('set_vsync', 'null', ['number']),
|
||||
setVideoRoation: this.Module.cwrap('set_video_rotation', 'null', ['number'])
|
||||
}
|
||||
|
||||
this.writeFile("/home/web_user/retroarch/userdata/retroarch.cfg", this.getRetroArchCfg());
|
||||
@ -421,6 +422,13 @@ class EJS_GameManager {
|
||||
getFrameNum() {
|
||||
return this.functions.getFrameNum();
|
||||
}
|
||||
setVideoRotation(rotation) {
|
||||
try {
|
||||
this.functions.setVideoRoation(rotation);
|
||||
} catch(e) {
|
||||
console.warn(e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
window.EJS_GameManager = EJS_GameManager;
|
||||
|
||||
@ -557,7 +557,7 @@ class EmulatorJS {
|
||||
this.webgl2Enabled = true;
|
||||
}
|
||||
let threads = false;
|
||||
if (SharedArrayBuffer instanceof Function) {
|
||||
if (typeof window.SharedArrayBuffer === "function") {
|
||||
const opt = this.preGetSetting("ejs_threads");
|
||||
if (opt) {
|
||||
threads = (opt === "enabled");
|
||||
@ -3986,6 +3986,8 @@ class EmulatorJS {
|
||||
}
|
||||
} else if (option === "vsync") {
|
||||
this.gameManager.setVSync(value === "enabled");
|
||||
} else if (option === "videoRotation") {
|
||||
this.gameManager.setVideoRotation(value);
|
||||
}
|
||||
}
|
||||
menuOptionChanged(option, value) {
|
||||
@ -4392,7 +4394,7 @@ class EmulatorJS {
|
||||
if (core && core.length > 1) {
|
||||
addToMenu(this.localization("Core" + " (" + this.localization('Requires restart') + ")"), 'retroarch_core', core, this.getCore(), home);
|
||||
}
|
||||
if (SharedArrayBuffer instanceof Function && !this.requiresThreads(this.getCore())) {
|
||||
if (typeof window.SharedArrayBuffer === "function" && !this.requiresThreads(this.getCore())) {
|
||||
addToMenu(this.localization("Threads"), "ejs_threads", {
|
||||
'enabled': this.localization("Enabled"),
|
||||
'disabled': this.localization("Disabled")
|
||||
@ -4448,7 +4450,7 @@ class EmulatorJS {
|
||||
'disabled': this.localization("Disabled")
|
||||
}, "enabled", graphicsOptions, true);
|
||||
|
||||
addToMenu(this.localization("Video Rotation" + " (" + this.localization('Requires restart') + ")"), 'videoRotation', {
|
||||
addToMenu(this.localization('Video Rotation'), 'videoRotation', {
|
||||
'0': "0 deg",
|
||||
'1': "90 deg",
|
||||
'2': "180 deg",
|
||||
@ -4530,6 +4532,7 @@ class EmulatorJS {
|
||||
true);
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
this.retroarchOpts = [
|
||||
|
||||
Loading…
Reference in New Issue
Block a user