@@ -13,6 +13,10 @@ public import "ecere"
1313
1414#ifdef __EMSCRIPTEN__
1515
16+ #ifdef _DEBUG
17+ // #define EMSCRIPTEN_DEBUG
18+ #endif
19+
1620#include < stdio.h>
1721
1822// source file line number printf (sflnprintf)
@@ -236,7 +240,7 @@ static EM_BOOL touch_callback(int eventType, const EmscriptenTouchEvent *e, void
236240
237241static EM_BOOL wheel_callback (int eventType, const EmscriptenWheelEvent *e, void *userData)
238242{
239- #ifdef _DEBUG
243+ #ifdef EMSCRIPTEN_DEBUG
240244 printf (" wheel_callback\n " );
241245#endif
242246 Window window = guiApp.desktop ;
@@ -268,7 +272,7 @@ EM_BOOL key_callback(int eventType, const EmscriptenKeyboardEvent *e, void *user
268272 Window window = guiApp.desktop ;
269273 Key key = 0 ;
270274 bool result = 0 ;
271- #ifdef _DEBUG
275+ #ifdef EMSCRIPTEN_DEBUG
272276 printf (" key_callback\n " );
273277#endif
274278 switch (e->keyCode )
@@ -402,7 +406,7 @@ EM_BOOL key_callback(int eventType, const EmscriptenKeyboardEvent *e, void *user
402406 case 11 : key = keyPadSlash; break ;
403407
404408 default :
405- #ifdef _DEBUG
409+ #ifdef EMSCRIPTEN_DEBUG
406410 printf (" %s , key: \" %s \" , code: \" %s \" , location: %lu ,%s%s%s%s repeat: %d , locale: \" %s \" , char: \" %s \" , charCode: %lu , keyCode: %lu , which: %lu \n " ,
407411 emscripten_event_type_to_string (eventType), e->key , e->code , e->location ,
408412 e->ctrlKey ? " CTRL" : " " , e->shiftKey ? " SHIFT" : " " , e->altKey ? " ALT" : " " , e->metaKey ? " META" : " " ,
@@ -492,7 +496,7 @@ EM_BOOL key_callback(int eventType, const EmscriptenKeyboardEvent *e, void *user
492496
493497EM_BOOL pointerlockchange_callback (int eventType, const EmscriptenPointerlockChangeEvent *e, void *userData)
494498{
495- #ifdef _DEBUG
499+ #ifdef EMSCRIPTEN_DEBUG
496500 printf (" pointerlockchange_callback\n " );
497501#endif
498502 if (!e->isActive )
@@ -510,7 +514,7 @@ EM_BOOL pointerlockchange_callback(int eventType, const EmscriptenPointerlockCha
510514 guiApp.acquiredWindow = w;
511515 guiApp.acquiredWindow .acquiredInput = true ;
512516 }
513- #ifdef _DEBUG
517+ #ifdef EMSCRIPTEN_DEBUG
514518 printf (" %s , isActive: %d , pointerlock element nodeName: \" %s \" , id: \" %s \"\n " ,
515519 emscripten_event_type_to_string (eventType), e->isActive , e->nodeName , e->id );
516520#endif
@@ -536,7 +540,7 @@ EM_BOOL fullscreenchange_callback(int eventType, const EmscriptenFullscreenChang
536540
537541 int w = 0 , h = 0 ;
538542 double dw = 0 , dh = 0 ;
539- #ifdef _DEBUG
543+ #ifdef EMSCRIPTEN_DEBUG
540544 printf (" fullscreenchange_callback\n " );
541545#endif
542546 isFullScreen = (bool )e->isFullscreen ;
@@ -565,7 +569,7 @@ EM_BOOL deviceorientation_callback(int eventType, const EmscriptenDeviceOrientat
565569 double gamma;
566570 EM_BOOL absolute;
567571*/
568- #ifdef _DEBUG
572+ #ifdef EMSCRIPTEN_DEBUG
569573 printf (" %s , (%g , %g , %g )\n " , emscripten_event_type_to_string (eventType), e->alpha , e->beta , e->gamma );
570574#endif
571575 return 0 ;
@@ -585,7 +589,7 @@ EM_BOOL devicemotion_callback(int eventType, const EmscriptenDeviceMotionEvent *
585589 double rotationRateGamma;
586590 int supportedFields;
587591*/
588- #ifdef _DEBUG
592+ #ifdef EMSCRIPTEN_DEBUG
589593 printf (" %s , accel: (%g , %g , %g ), accelInclGravity: (%g , %g , %g ), rotationRate: (%g , %g , %g ), supportedFields: %s %s %s \n " ,
590594 emscripten_event_type_to_string (eventType),
591595 e->accelerationX , e->accelerationY , e->accelerationZ ,
@@ -604,7 +608,7 @@ EM_BOOL orientationchange_callback(int eventType, const EmscriptenOrientationCha
604608 int orientationIndex;
605609 int orientationAngle;
606610*/
607- #ifdef _DEBUG
611+ #ifdef EMSCRIPTEN_DEBUG
608612 printf (" %s , orientationAngle: %d , orientationIndex: %d \n " , emscripten_event_type_to_string (eventType), e->orientationAngle , e->orientationIndex );
609613#endif
610614 return 0 ;
@@ -616,15 +620,15 @@ EM_BOOL visibilitychange_callback(int eventType, const EmscriptenVisibilityChang
616620 EM_BOOL hidden;
617621 int visibilityState;
618622*/
619- #ifdef _DEBUG
623+ #ifdef EMSCRIPTEN_DEBUG
620624 printf (" %s , hidden: %d , visibilityState: %d \n " , emscripten_event_type_to_string (eventType), e->hidden , e->visibilityState );
621625#endif
622626 return 0 ;
623627}
624628
625629EM_BOOL webglcontext_callback (int eventType, const void *reserved, void *userData)
626630{
627- #ifdef _DEBUG
631+ #ifdef EMSCRIPTEN_DEBUG
628632 printf (" %s .\n " , emscripten_event_type_to_string (eventType));
629633#endif
630634 return 0 ;
@@ -693,15 +697,15 @@ static EM_BOOL uievent_callback(int eventType, const EmscriptenUiEvent *e, void
693697 {
694698 int w = 0 , h = 0 ;
695699 double dw = 0 , dh = 0 ;
696- #ifdef _DEBUG
700+ #ifdef EMSCRIPTEN_DEBUG
697701 printf (" uievent/resize\n " );
698702 printf (" documentBodyClient %4d x%-4d \n " , e->documentBodyClientWidth , e->documentBodyClientHeight );
699703 printf (" windowInner %4d x%-4d \n " , e->windowInnerWidth , e->windowInnerHeight );
700704 printf (" windowOuter %4d x%-4d \n " , e->windowOuterWidth , e->windowOuterHeight );
701705#endif
702706 emscripten_get_element_css_size (target, &dw, &dh);
703707 // w = (int)dw, h = (int)dh;
704- #ifdef _DEBUG
708+ #ifdef EMSCRIPTEN_DEBUG
705709 printf (" getElementCssSize --interface-- %4d x%-4d \n " , w, h);
706710#endif
707711 w = e->windowInnerWidth , h = e->windowInnerHeight ;
@@ -713,13 +717,13 @@ static EM_BOOL uievent_callback(int eventType, const EmscriptenUiEvent *e, void
713717 guiApp.desktop .display .Resize (w, h);
714718 }
715719 // PrintLn("EMSCRIPTEN_EVENT_RESIZE: ", w, " x ", h);
716- #ifdef _DEBUG
720+ #ifdef EMSCRIPTEN_DEBUG
717721 printf (" scroll %4d x%-4d \n " , e->scrollTop , e->scrollLeft );
718722#endif
719723 break ;
720724 }
721725 default :
722- #ifdef _DEBUG
726+ #ifdef EMSCRIPTEN_DEBUG
723727 printf (" %s , detail: %ld , document.body.client size: (%d ,%d ), window.inner size: (%d ,%d ), scrollPos: (%d , %d )\n " ,
724728 emscripten_event_type_to_string (eventType), e->detail , e->documentBodyClientWidth , e->documentBodyClientHeight ,
725729 e->windowInnerWidth , e->windowInnerHeight , e->scrollTop , e->scrollLeft );
@@ -735,7 +739,7 @@ EM_BOOL focusevent_callback(int eventType, const EmscriptenFocusEvent *e, void *
735739 EM_UTF8 nodeName[EM_HTML5_LONG_STRING_LEN_BYTES];
736740 EM_UTF8 id[EM_HTML5_LONG_STRING_LEN_BYTES];
737741 */
738- #ifdef _DEBUG
742+ #ifdef EMSCRIPTEN_DEBUG
739743 printf (" %s , nodeName: \" %s \" , id: \" %s \"\n " , emscripten_event_type_to_string (eventType), e->nodeName , e->id [0 ] == ' \0 ' ? " (empty string)" : e->id );
740744#endif
741745 return 0 ;
@@ -806,7 +810,7 @@ class EmscriptenInterface : Interface
806810
807811 // emscripten_log(EM_LOG_CONSOLE, "EmscriptenInterface::Initialize OK\n");
808812
809- #ifdef _DEBUG
813+ #ifdef EMSCRIPTEN_DEBUG
810814 printf (" AAA EmscriptenInterface::Initialize -- %d xOk\n " , okCount);
811815 emscripten_run_script (" Module.setStatus('Actually Running...');" );
812816 printf (" BBB EmscriptenInterface::Initialize -- is it working?\n " );
0 commit comments