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 1
1
{
2
2
"name" : " emulators-ui" ,
3
- "version" : " 0.73.7 " ,
3
+ "version" : " 0.73.8 " ,
4
4
"description" : " Emulators UI" ,
5
5
"main" : " dist/emulators-ui.js" ,
6
6
"types" : " dist/types/emulators-ui.d.ts" ,
66
66
"typescript" : " ^4.7.4" ,
67
67
"vinyl-buffer" : " ^1.0.1" ,
68
68
"vinyl-source-stream" : " ^2.0.0"
69
- }
69
+ },
70
+ "dependencies" : {}
70
71
}
Original file line number Diff line number Diff line change 4
4
// gulpfile.ts/wasm.ts --> generateBuildInfo
5
5
6
6
export 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 ,
10
10
} ;
Original file line number Diff line number Diff line change 1
1
import { Layers } from "../dom/layers" ;
2
2
import { CommandInterface } from "emulators" ;
3
3
4
- export function _2d ( layers : Layers , ci : CommandInterface ) {
4
+ export function _2d ( layers : Layers , ci : CommandInterface , forceAspect ?: number ) {
5
5
const canvas = layers . canvas ;
6
6
const context = canvas . getContext ( "2d" ) ;
7
7
if ( context === null ) {
@@ -14,7 +14,7 @@ export function _2d(layers: Layers, ci: CommandInterface) {
14
14
let frameHeight = 0 ;
15
15
16
16
const onResize = ( ) => {
17
- const aspect = frameWidth / frameHeight ;
17
+ const aspect = forceAspect ?? frameWidth / frameHeight ;
18
18
19
19
let width = containerWidth ;
20
20
let height = containerWidth / aspect ;
Original file line number Diff line number Diff line change @@ -24,7 +24,7 @@ void main(void) {
24
24
}
25
25
` ;
26
26
27
- export function webGl ( layers : Layers , ci : CommandInterface ) {
27
+ export function webGl ( layers : Layers , ci : CommandInterface , forceAspect ?: number ) {
28
28
const canvas = layers . canvas ;
29
29
const gl = canvas . getContext ( "webgl" ) ;
30
30
if ( gl === null ) {
@@ -60,7 +60,7 @@ export function webGl(layers: Layers, ci: CommandInterface) {
60
60
let frameHeight = 0 ;
61
61
62
62
const onResize = ( ) => {
63
- const aspect = frameWidth / frameHeight ;
63
+ const aspect = forceAspect ?? ( frameWidth / frameHeight ) ;
64
64
65
65
let width = containerWidth ;
66
66
let height = containerWidth / aspect ;
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ declare const emulators: Emulators;
16
16
export type EmulatorFunction = "dosboxWorker" | "dosboxDirect" | "dosboxNode" | "janus" | "backend" ;
17
17
18
18
export interface DosOptions {
19
+ aspect ?: number ;
19
20
noWebGL ?: boolean ;
20
21
emulatorFunction ?: EmulatorFunction ;
21
22
clickToStart ?: boolean ;
@@ -113,11 +114,11 @@ export class DosInstance {
113
114
if ( this . options . noWebGL === true ) {
114
115
throw new Error ( "WebGL is disabled by options" ) ;
115
116
}
116
- emulatorsUi . graphics . webGl ( this . layers , ci ) ;
117
+ emulatorsUi . graphics . webGl ( this . layers , ci , this . options . aspect ) ;
117
118
} catch ( e ) {
118
119
// eslint-disable-next-line
119
120
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 ) ;
121
122
}
122
123
this . setVolumeImplFn = emulatorsUi . sound . audioNode ( ci ) ;
123
124
this . setVolumeImplFn ( this . volume ) ;
Original file line number Diff line number Diff line change @@ -2085,15 +2085,10 @@ camelcase@^3.0.0:
2085
2085
resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-3.0.0.tgz#32fc4b9fcdaf845fcdf7e73bb97cac2261f0ab0a"
2086
2086
integrity sha1-MvxLn82vhF/N9+c7uXysImHwqwo=
2087
2087
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==
2097
2092
2098
2093
chalk@^2.0.0 :
2099
2094
version "2.4.2"
You can’t perform that action at this time.
0 commit comments