File tree Expand file tree Collapse file tree 6 files changed +17
-20
lines changed Expand file tree Collapse file tree 6 files changed +17
-20
lines changed Original file line number Diff line number Diff line change 11{
22 "name" : " emulators-ui" ,
3- "version" : " 0.73.7 " ,
3+ "version" : " 0.73.8 " ,
44 "description" : " Emulators UI" ,
55 "main" : " dist/emulators-ui.js" ,
66 "types" : " dist/types/emulators-ui.d.ts" ,
6666 "typescript" : " ^4.7.4" ,
6767 "vinyl-buffer" : " ^1.0.1" ,
6868 "vinyl-source-stream" : " ^2.0.0"
69- }
69+ },
70+ "dependencies" : {}
7071}
Original file line number Diff line number Diff line change 44// gulpfile.ts/wasm.ts --> generateBuildInfo
55
66export const Build = {
7- short : "0.73.6 " ,
8- version : "0.73.6 (56358274d9c94c50e01e40c6e3b92c6e )" ,
9- buildSeed : 1658134329704 ,
7+ short : "0.73.8 " ,
8+ version : "0.73.8 (3f45c09550da147bae83e339cc00d649 )" ,
9+ buildSeed : 1673509074063 ,
1010} ;
Original file line number Diff line number Diff line change 11import { Layers } from "../dom/layers" ;
22import { CommandInterface } from "emulators" ;
33
4- export function _2d ( layers : Layers , ci : CommandInterface ) {
4+ export function _2d ( layers : Layers , ci : CommandInterface , forceAspect ?: number ) {
55 const canvas = layers . canvas ;
66 const context = canvas . getContext ( "2d" ) ;
77 if ( context === null ) {
@@ -14,7 +14,7 @@ export function _2d(layers: Layers, ci: CommandInterface) {
1414 let frameHeight = 0 ;
1515
1616 const onResize = ( ) => {
17- const aspect = frameWidth / frameHeight ;
17+ const aspect = forceAspect ?? frameWidth / frameHeight ;
1818
1919 let width = containerWidth ;
2020 let height = containerWidth / aspect ;
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ void main(void) {
2424}
2525` ;
2626
27- export function webGl ( layers : Layers , ci : CommandInterface ) {
27+ export function webGl ( layers : Layers , ci : CommandInterface , forceAspect ?: number ) {
2828 const canvas = layers . canvas ;
2929 const gl = canvas . getContext ( "webgl" ) ;
3030 if ( gl === null ) {
@@ -60,7 +60,7 @@ export function webGl(layers: Layers, ci: CommandInterface) {
6060 let frameHeight = 0 ;
6161
6262 const onResize = ( ) => {
63- const aspect = frameWidth / frameHeight ;
63+ const aspect = forceAspect ?? ( frameWidth / frameHeight ) ;
6464
6565 let width = containerWidth ;
6666 let height = containerWidth / aspect ;
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ declare const emulators: Emulators;
1616export type EmulatorFunction = "dosboxWorker" | "dosboxDirect" | "dosboxNode" | "janus" | "backend" ;
1717
1818export interface DosOptions {
19+ aspect ?: number ;
1920 noWebGL ?: boolean ;
2021 emulatorFunction ?: EmulatorFunction ;
2122 clickToStart ?: boolean ;
@@ -113,11 +114,11 @@ export class DosInstance {
113114 if ( this . options . noWebGL === true ) {
114115 throw new Error ( "WebGL is disabled by options" ) ;
115116 }
116- emulatorsUi . graphics . webGl ( this . layers , ci ) ;
117+ emulatorsUi . graphics . webGl ( this . layers , ci , this . options . aspect ) ;
117118 } catch ( e ) {
118119 // eslint-disable-next-line
119120 console . error ( "Unable to create webgl canvas, fallback to 2d rendering" ) ;
120- emulatorsUi . graphics . _2d ( this . layers , ci ) ;
121+ emulatorsUi . graphics . _2d ( this . layers , ci , this . options . aspect ) ;
121122 }
122123 this . setVolumeImplFn = emulatorsUi . sound . audioNode ( ci ) ;
123124 this . setVolumeImplFn ( this . volume ) ;
Original file line number Diff line number Diff line change @@ -2085,15 +2085,10 @@ camelcase@^3.0.0:
20852085 resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-3.0.0.tgz#32fc4b9fcdaf845fcdf7e73bb97cac2261f0ab0a"
20862086 integrity sha1-MvxLn82vhF/N9+c7uXysImHwqwo=
20872087
2088- caniuse-lite@^1.0.30001317 :
2089- version "1.0.30001332"
2090- resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001332.tgz#39476d3aa8d83ea76359c70302eafdd4a1d727dd"
2091- integrity sha512-10T30NYOEQtN6C11YGg411yebhvpnC6Z102+B95eAsN0oB6KUs01ivE8u+G6FMIRtIrVlYXhL+LUwQ3/hXwDWw==
2092-
2093- caniuse-lite@^1.0.30001332 :
2094- version "1.0.30001346"
2095- resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001346.tgz#e895551b46b9cc9cc9de852facd42f04839a8fbe"
2096- integrity sha512-q6ibZUO2t88QCIPayP/euuDREq+aMAxFE5S70PkrLh0iTDj/zEhgvJRKC2+CvXY6EWc6oQwUR48lL5vCW6jiXQ==
2088+ caniuse-lite@^1.0.30001317, caniuse-lite@^1.0.30001332 :
2089+ version "1.0.30001443"
2090+ resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001443.tgz"
2091+ integrity sha512-jUo8svymO8+Mkj3qbUbVjR8zv8LUGpGkUM/jKvc9SO2BvjCI980dp9fQbf/dyLs6RascPzgR4nhAKFA4OHeSaA==
20972092
20982093chalk@^2.0.0 :
20992094 version "2.4.2"
You can’t perform that action at this time.
0 commit comments