mirror of
https://github.com/db48x/emularity.git
synced 2026-07-28 04:07:11 +00:00
Clean up the code for fullscreen support
This commit is contained in:
@@ -991,6 +991,7 @@ var Module = null;
|
||||
*/
|
||||
function EmscriptenRunner(canvas, game_data) {
|
||||
var self = this;
|
||||
this._canvas = canvas;
|
||||
this._hooks = { start: [], reset: [] };
|
||||
// This is somewhat wrong, because our Emscripten-based emulators
|
||||
// are currently compiled to start immediately when their js file
|
||||
@@ -1061,6 +1062,7 @@ var Module = null;
|
||||
};
|
||||
|
||||
EmscriptenRunner.prototype.requestFullScreen = function () {
|
||||
this._canvas.requestFullscreen();
|
||||
};
|
||||
|
||||
/*
|
||||
@@ -1293,10 +1295,6 @@ var Module = null;
|
||||
e.gamepad.index, e.gamepad.id);
|
||||
});
|
||||
|
||||
if (/archive\.org$/.test(document.location.hostname) && document.getElementById("gofullscreen")) {
|
||||
document.getElementById("gofullscreen").addEventListener("click", this.requestFullScreen);
|
||||
}
|
||||
|
||||
var css_resolution, aspectRatio;
|
||||
// right off the bat we set the canvas's inner dimensions to
|
||||
// whatever it's current css dimensions are; this isn't likely to be
|
||||
@@ -1874,9 +1872,7 @@ var Module = null;
|
||||
};
|
||||
|
||||
this.requestFullScreen = function () {
|
||||
if (typeof Module == "object" && "requestFullScreen" in Module) {
|
||||
Module.requestFullScreen(1, 0);
|
||||
} else if (runner) {
|
||||
if (runner) {
|
||||
runner.requestFullScreen();
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user