@@ -1125,13 +1125,13 @@ var LibrarySDL = {
1125
1125
audio . paused = false ;
1126
1126
if ( ! webAudio . decodedBuffer ) {
1127
1127
if ( webAudio . onDecodeComplete === undefined ) abort ( "Cannot play back audio object that was not loaded" ) ;
1128
- webAudio . onDecodeComplete . push ( function ( ) { if ( ! audio . paused ) SDL . playWebAudio ( audio ) ; } ) ;
1128
+ webAudio . onDecodeComplete . push ( ( ) => { if ( ! audio . paused ) SDL . playWebAudio ( audio ) ; } ) ;
1129
1129
return ;
1130
1130
}
1131
1131
audio . webAudioNode = SDL . audioContext [ 'createBufferSource' ] ( ) ;
1132
1132
audio . webAudioNode [ 'buffer' ] = webAudio . decodedBuffer ;
1133
1133
audio . webAudioNode [ 'loop' ] = audio . loop ;
1134
- audio . webAudioNode [ 'onended' ] = function ( ) { audio [ 'onended' ] ( ) ; } // For <media> element compatibility, route the onended signal to the instance.
1134
+ audio . webAudioNode [ 'onended' ] = audio [ 'onended' ] ; // For <media> element compatibility, route the onended signal to the instance.
1135
1135
1136
1136
audio . webAudioPannerNode = SDL . audioContext [ 'createPanner' ] ( ) ;
1137
1137
// avoid Chrome bug
@@ -1457,9 +1457,11 @@ var LibrarySDL = {
1457
1457
SDL_SetVideoMode__deps : [ '$GL' ] ,
1458
1458
SDL_SetVideoMode__proxy : 'sync' ,
1459
1459
SDL_SetVideoMode : function ( width , height , depth , flags ) {
1460
- [ 'touchstart' , 'touchend' , 'touchmove' , 'mousedown' , 'mouseup' , 'mousemove' , 'DOMMouseScroll' , 'mousewheel' , 'wheel' , 'mouseout' ] . forEach ( function ( event ) {
1461
- Module [ 'canvas' ] . addEventListener ( event , SDL . receiveEvent , true ) ;
1462
- } ) ;
1460
+ [ 'touchstart' , 'touchend' , 'touchmove' ,
1461
+ 'mousedown' , 'mouseup' , 'mousemove' ,
1462
+ 'mousewheel' , 'wheel' , 'mouseout' ,
1463
+ 'DOMMouseScroll' ,
1464
+ ] . forEach ( ( e ) => Module [ 'canvas' ] . addEventListener ( e , SDL . receiveEvent , true ) ) ;
1463
1465
1464
1466
var canvas = Module [ 'canvas' ] ;
1465
1467
@@ -1471,7 +1473,7 @@ var LibrarySDL = {
1471
1473
1472
1474
if ( ! SDL . addedResizeListener ) {
1473
1475
SDL . addedResizeListener = true ;
1474
- Browser . resizeListeners . push ( function ( w , h ) {
1476
+ Browser . resizeListeners . push ( ( w , h ) => {
1475
1477
if ( ! SDL . settingVideoMode ) {
1476
1478
SDL . receiveEvent ( {
1477
1479
type : 'resize' ,
@@ -2056,10 +2058,8 @@ var LibrarySDL = {
2056
2058
} ,
2057
2059
2058
2060
SDL_PumpEvents__proxy : 'sync' ,
2059
- SDL_PumpEvents : function ( ) {
2060
- SDL . events . forEach ( function ( event ) {
2061
- SDL . handleEvent ( event ) ;
2062
- } ) ;
2061
+ SDL_PumpEvents : function ( ) {
2062
+ SDL . events . forEach ( SDL . handleEvent ) ;
2063
2063
} ,
2064
2064
2065
2065
// An Emscripten-specific extension to SDL: Some browser APIs require that they are called from within an event handler function.
@@ -2205,7 +2205,7 @@ var LibrarySDL = {
2205
2205
var x = _malloc ( { { { getNativeTypeSize ( 'i32' ) } } } ) ;
2206
2206
var y = _malloc ( { { { getNativeTypeSize ( 'i32' ) } } } ) ;
2207
2207
var comp = _malloc ( { { { getNativeTypeSize ( 'i32' ) } } } ) ;
2208
- addCleanup ( function ( ) {
2208
+ addCleanup ( ( ) => {
2209
2209
_free ( x ) ;
2210
2210
_free ( y ) ;
2211
2211
_free ( comp ) ;
@@ -2247,7 +2247,7 @@ var LibrarySDL = {
2247
2247
if ( raw === null ) err ( 'Trying to reuse preloaded image, but freePreloadedMediaOnUse is set!' ) ;
2248
2248
#if STB_IMAGE
2249
2249
var name = stringToNewUTF8 ( filename ) ;
2250
- addCleanup ( function ( ) {
2250
+ addCleanup ( ( ) => {
2251
2251
_free ( name ) ;
2252
2252
} ) ;
2253
2253
raw = callStbImage ( 'stbi_load' , [ name ] ) ;
@@ -2448,9 +2448,7 @@ var LibrarySDL = {
2448
2448
} ;
2449
2449
Asyncify . sleepCallbacks . push ( sleepCallback ) ;
2450
2450
SDL . audio . callbackRemover = ( ) => {
2451
- Asyncify . sleepCallbacks = Asyncify . sleepCallbacks . filter ( function ( callback ) {
2452
- return callback !== sleepCallback ;
2453
- } ) ;
2451
+ Asyncify . sleepCallbacks = Asyncify . sleepCallbacks . filter ( ( callback ) => callback !== sleepCallback ) ;
2454
2452
}
2455
2453
#endif
2456
2454
@@ -2771,7 +2769,7 @@ var LibrarySDL = {
2771
2769
var onDecodeComplete = ( data ) => {
2772
2770
webAudio . decodedBuffer = data ;
2773
2771
// Call all handlers that were waiting for this decode to finish, and clear the handler list.
2774
- webAudio . onDecodeComplete . forEach ( function ( e ) { e ( ) ; } ) ;
2772
+ webAudio . onDecodeComplete . forEach ( ( e ) => e ( ) ) ;
2775
2773
webAudio . onDecodeComplete = undefined ; // Don't allow more callback handlers since audio has finished decoding.
2776
2774
} ;
2777
2775
SDL . audioContext [ 'decodeAudioData' ] ( arrayBuffer , onDecodeComplete ) ;
@@ -2887,7 +2885,7 @@ var LibrarySDL = {
2887
2885
audio . numChannels = info . audio . numChannels ;
2888
2886
audio . frequency = info . audio . frequency ;
2889
2887
}
2890
- audio [ 'onended' ] = function SDL_audio_onended ( ) { // TODO: cache these
2888
+ audio [ 'onended' ] = function ( ) { // TODO: cache these
2891
2889
if ( channelInfo . audio == this ) { channelInfo . audio . paused = true ; channelInfo . audio = null ; }
2892
2890
if ( SDL . channelFinished ) { { { makeDynCall ( 'vi' , 'SDL.channelFinished' ) } } } ( channel ) ;
2893
2891
}
0 commit comments