@@ -370,7 +370,6 @@ var LibraryGLFW = {
370
370
#if USE_GLFW == 2
371
371
{ { { makeDynCall ( 'vii' , 'GLFW.active.charFunc' ) } } } ( charCode , 1 ) ;
372
372
#endif
373
-
374
373
#if USE_GLFW == 3
375
374
{ { { makeDynCall ( 'vii' , 'GLFW.active.charFunc' ) } } } ( GLFW . active . id , charCode ) ;
376
375
#endif
@@ -387,16 +386,16 @@ var LibraryGLFW = {
387
386
#endif
388
387
GLFW . active . keys [ key ] = status ;
389
388
GLFW . active . domKeys [ keyCode ] = status ;
390
- if ( ! GLFW . active . keyFunc ) return ;
391
389
390
+ if ( GLFW . active . keyFunc ) {
392
391
#if USE_GLFW == 2
393
- { { { makeDynCall ( 'vii' , 'GLFW.active.keyFunc' ) } } } ( key , status ) ;
392
+ { { { makeDynCall ( 'vii' , 'GLFW.active.keyFunc' ) } } } ( key , status ) ;
394
393
#endif
395
-
396
394
#if USE_GLFW == 3
397
- if ( repeat ) status = 2 ; // GLFW_REPEAT
398
- { { { makeDynCall ( 'viiiii' , 'GLFW.active.keyFunc' ) } } } ( GLFW . active . id , key , keyCode , status , GLFW . getModBits ( GLFW . active ) ) ;
395
+ if ( repeat ) status = 2 ; // GLFW_REPEAT
396
+ { { { makeDynCall ( 'viiiii' , 'GLFW.active.keyFunc' ) } } } ( GLFW . active . id , key , keyCode , status , GLFW . getModBits ( GLFW . active ) ) ;
399
397
#endif
398
+ }
400
399
} ,
401
400
402
401
onGamepadConnected : function ( event ) {
@@ -439,13 +438,14 @@ var LibraryGLFW = {
439
438
440
439
if ( event . target != Module [ "canvas" ] || ! GLFW . active . cursorPosFunc ) return ;
441
440
441
+ if ( GLFW . active . cursorPosFunc ) {
442
442
#if USE_GLFW == 2
443
- { { { makeDynCall ( 'vii' , 'GLFW.active.cursorPosFunc' ) } } } ( Browser . mouseX , Browser . mouseY ) ;
443
+ { { { makeDynCall ( 'vii' , 'GLFW.active.cursorPosFunc' ) } } } ( Browser . mouseX , Browser . mouseY ) ;
444
444
#endif
445
-
446
445
#if USE_GLFW == 3
447
- { { { makeDynCall ( 'vidd' , 'GLFW.active.cursorPosFunc' ) } } } ( GLFW . active . id , Browser . mouseX , Browser . mouseY ) ;
446
+ { { { makeDynCall ( 'vidd' , 'GLFW.active.cursorPosFunc' ) } } } ( GLFW . active . id , Browser . mouseX , Browser . mouseY ) ;
448
447
#endif
448
+ }
449
449
} ,
450
450
451
451
DOMToGLFWMouseButton : function ( event ) {
@@ -465,20 +465,24 @@ var LibraryGLFW = {
465
465
onMouseenter : function ( event ) {
466
466
if ( ! GLFW . active ) return ;
467
467
468
- if ( event . target != Module [ "canvas" ] || ! GLFW . active . cursorEnterFunc ) return ;
468
+ if ( event . target != Module [ "canvas" ] ) return ;
469
469
470
470
#if USE_GLFW == 3
471
- { { { makeDynCall ( 'vii' , 'GLFW.active.cursorEnterFunc' ) } } } ( GLFW . active . id , 1 ) ;
471
+ if ( GLFW . active . cursorEnterFunc ) {
472
+ { { { makeDynCall ( 'vii' , 'GLFW.active.cursorEnterFunc' ) } } } ( GLFW . active . id , 1 ) ;
473
+ }
472
474
#endif
473
475
} ,
474
476
475
477
onMouseleave : function ( event ) {
476
478
if ( ! GLFW . active ) return ;
477
479
478
- if ( event . target != Module [ "canvas" ] || ! GLFW . active . cursorEnterFunc ) return ;
480
+ if ( event . target != Module [ "canvas" ] ) return ;
479
481
480
482
#if USE_GLFW == 3
481
- { { { makeDynCall ( 'vii' , 'GLFW.active.cursorEnterFunc' ) } } } ( GLFW . active . id , 0 ) ;
483
+ if ( GLFW . active . cursorEnterFunc ) {
484
+ { { { makeDynCall ( 'vii' , 'GLFW.active.cursorEnterFunc' ) } } } ( GLFW . active . id , 0 ) ;
485
+ }
482
486
#endif
483
487
} ,
484
488
@@ -500,15 +504,14 @@ var LibraryGLFW = {
500
504
GLFW . active . buttons &= ~ ( 1 << eventButton ) ;
501
505
}
502
506
503
- if ( ! GLFW . active . mouseButtonFunc ) return ;
504
-
507
+ if ( GLFW . active . mouseButtonFunc ) {
505
508
#if USE_GLFW == 2
506
- { { { makeDynCall ( 'vii' , 'GLFW.active.mouseButtonFunc' ) } } } ( eventButton , status ) ;
509
+ { { { makeDynCall ( 'vii' , 'GLFW.active.mouseButtonFunc' ) } } } ( eventButton , status ) ;
507
510
#endif
508
-
509
511
#if USE_GLFW == 3
510
- { { { makeDynCall ( 'viiii' , 'GLFW.active.mouseButtonFunc' ) } } } ( GLFW . active . id , eventButton , status , GLFW . getModBits ( GLFW . active ) ) ;
512
+ { { { makeDynCall ( 'viiii' , 'GLFW.active.mouseButtonFunc' ) } } } ( GLFW . active . id , eventButton , status , GLFW . getModBits ( GLFW . active ) ) ;
511
513
#endif
514
+ }
512
515
} ,
513
516
514
517
onMouseButtonDown : function ( event ) {
@@ -528,11 +531,9 @@ var LibraryGLFW = {
528
531
GLFW . wheelPos += delta ;
529
532
530
533
if ( ! GLFW . active || ! GLFW . active . scrollFunc || event . target != Module [ 'canvas' ] ) return ;
531
-
532
534
#if USE_GLFW == 2
533
535
{ { { makeDynCall ( 'vi' , 'GLFW.active.scrollFunc' ) } } } ( GLFW . wheelPos ) ;
534
536
#endif
535
-
536
537
#if USE_GLFW == 3
537
538
var sx = 0 ;
538
539
var sy = delta ;
@@ -594,24 +595,23 @@ var LibraryGLFW = {
594
595
onWindowSizeChanged : function ( ) {
595
596
if ( ! GLFW . active ) return ;
596
597
597
- if ( ! GLFW . active . windowSizeFunc ) return ;
598
-
598
+ if ( GLFW . active . windowSizeFunc ) {
599
599
#if USE_GLFW == 2
600
- { { { makeDynCall ( 'vii' , 'GLFW.active.windowSizeFunc' ) } } } ( GLFW . active . width , GLFW . active . height ) ;
600
+ { { { makeDynCall ( 'vii' , 'GLFW.active.windowSizeFunc' ) } } } ( GLFW . active . width , GLFW . active . height ) ;
601
601
#endif
602
-
603
602
#if USE_GLFW == 3
604
- { { { makeDynCall ( 'viii' , 'GLFW.active.windowSizeFunc' ) } } } ( GLFW . active . id , GLFW . active . width , GLFW . active . height ) ;
603
+ { { { makeDynCall ( 'viii' , 'GLFW.active.windowSizeFunc' ) } } } ( GLFW . active . id , GLFW . active . width , GLFW . active . height ) ;
605
604
#endif
605
+ }
606
606
} ,
607
607
608
608
onFramebufferSizeChanged : function ( ) {
609
609
if ( ! GLFW . active ) return ;
610
610
611
- if ( ! GLFW . active . framebufferSizeFunc ) return ;
612
-
613
611
#if USE_GLFW == 3
614
- { { { makeDynCall ( 'viii' , 'GLFW.active.framebufferSizeFunc' ) } } } ( GLFW . active . id , GLFW . active . width , GLFW . active . height ) ;
612
+ if ( GLFW . active . framebufferSizeFunc ) {
613
+ { { { makeDynCall ( 'viii' , 'GLFW.active.framebufferSizeFunc' ) } } } ( GLFW . active . id , GLFW . active . width , GLFW . active . height ) ;
614
+ }
615
615
#endif
616
616
} ,
617
617
@@ -620,7 +620,9 @@ var LibraryGLFW = {
620
620
if ( ! GLFW . active ) return ;
621
621
622
622
#if USE_GLFW == 3
623
- { { { makeDynCall ( 'viff' , 'GLFW.active.windowContentScaleFunc' ) } } } ( GLFW . active . id , GLFW . scale , GLFW . scale ) ;
623
+ if ( GLFW . active . windowContentScaleFunc ) {
624
+ { { { makeDynCall ( 'viff' , 'GLFW.active.windowContentScaleFunc' ) } } } ( GLFW . active . id , GLFW . scale , GLFW . scale ) ;
625
+ }
624
626
#endif
625
627
} ,
626
628
@@ -988,15 +990,14 @@ var LibraryGLFW = {
988
990
}
989
991
}
990
992
991
- if ( ! win . windowSizeFunc ) return ;
992
-
993
+ if ( win . windowSizeFunc ) {
993
994
#if USE_GLFW == 2
994
- { { { makeDynCall ( 'vii' , 'win.windowSizeFunc' ) } } } ( width , height ) ;
995
+ { { { makeDynCall ( 'vii' , 'win.windowSizeFunc' ) } } } ( width , height ) ;
995
996
#endif
996
-
997
997
#if USE_GLFW == 3
998
- { { { makeDynCall ( 'viii' , 'win.windowSizeFunc' ) } } } ( win . id , width , height ) ;
998
+ { { { makeDynCall ( 'viii' , 'win.windowSizeFunc' ) } } } ( win . id , width , height ) ;
999
999
#endif
1000
+ }
1000
1001
} ,
1001
1002
1002
1003
createWindow : function ( width , height , title , monitor , share ) {
@@ -1063,8 +1064,9 @@ var LibraryGLFW = {
1063
1064
if ( ! win ) return ;
1064
1065
1065
1066
#if USE_GLFW == 3
1066
- if ( win . windowCloseFunc )
1067
+ if ( win . windowCloseFunc ) {
1067
1068
{ { { makeDynCall ( 'vi' , 'win.windowCloseFunc' ) } } } ( win . id ) ;
1069
+ }
1068
1070
#endif
1069
1071
1070
1072
GLFW . windows [ win . id - 1 ] = null ;
0 commit comments