2828#if !XSTOOLS
2929 #include "mc.defines.h"
3030#endif
31- #if MODDEF_ECMA419_ENABLED
31+ #if MODDEF_ECMA419_DISPLAY
3232 #include "display419.h"
3333#endif
3434
3535#include "commodettoPoco.h"
3636#include "commodettoPixelsOut.h"
3737#include "commodettoFontEngine.h"
3838
39+ #undef MODDEF_ECMA419_DISPLAY
40+
3941#include "stddef.h" // for offsetof macro
4042#include "stdint.h"
4143#include "stdlib.h"
@@ -134,7 +136,7 @@ void xs_poco_build(xsMachine *the)
134136 if (xsmcTest (xsArg (7 )))
135137 poco -> flags |= kPocoFlagAdaptInvalid ;
136138
137- #if MODDEF_ECMA419_ENABLED
139+ #if MODDEF_ECMA419_DISPLAY
138140 poco -> displayHooks = C_NULL ;
139141 poco -> the = the ;
140142
@@ -165,7 +167,7 @@ void xs_poco_build(xsMachine *the)
165167 else
166168 poco -> outputRefcon = NULL ;
167169
168- #if MODDEF_ECMA419_ENABLED && kPocoFrameBuffer
170+ #if MODDEF_ECMA419_DISPLAY && kPocoFrameBuffer
169171 if (poco -> displayHooks ) {
170172 uint8_t frameBuffer ;
171173 if ((0 == ((xsDisplayHostHooks )poco -> displayHooks )-> doGet (poco -> outputRefcon , 1 , & frameBuffer ) && frameBuffer ))
@@ -256,7 +258,7 @@ void xs_poco_begin(xsMachine *the)
256258 PocoPixel * pixels ;
257259 int16_t rowBytes ;
258260 PixelsOutDispatch pixelsOutDispatch = poco -> outputRefcon ? * (PixelsOutDispatch * )poco -> outputRefcon : NULL ;
259- #if MODDEF_ECMA419_ENABLED
261+ #if MODDEF_ECMA419_DISPLAY
260262 if (poco -> displayHooks ) {
261263 int rowBytesInt ;
262264 (((xsDisplayHostHooks )poco -> displayHooks )-> doBegin )(poco -> outputRefcon , poco -> x , poco -> y , poco -> w , poco -> h , (void * * )& pixels , & rowBytesInt , 0 );
@@ -269,7 +271,7 @@ void xs_poco_begin(xsMachine *the)
269271 else {
270272 xsUnsignedValue dataSize ;
271273
272- #if MODDEF_ECMA419_ENABLED
274+ #if MODDEF_ECMA419_DISPLAY
273275 xsmcVars (3 );
274276 xsmcGet (xsVar (0 ), xsThis , xsID_pixelsOut );
275277 xsmcSetNewObject (xsVar (1 ));
@@ -320,7 +322,7 @@ static void pixelReceiver(PocoPixel *pixels, int byteLength, void *refCon)
320322 xsCall3 (xsVar (0 ), xsID_send , xsVar (3 ), xsVar (1 ), xsVar (2 ));
321323}
322324
323- #if MODDEF_ECMA419_ENABLED
325+ #if MODDEF_ECMA419_DISPLAY
324326static void displayPixelReceiver (PocoPixel * pixels , int byteLength , void * refCon )
325327{
326328 Poco poco = refCon ;
@@ -342,7 +344,7 @@ void xs_poco_end(xsMachine *the)
342344{
343345 Poco poco = xsmcGetHostDataPoco (xsThis );
344346 PixelsOutDispatch pixelsOutDispatch =
345- #if MODDEF_ECMA419_ENABLED
347+ #if MODDEF_ECMA419_DISPLAY
346348 (!poco -> displayHooks && poco -> outputRefcon ) ? * (PixelsOutDispatch * )poco -> outputRefcon : NULL ;
347349#else
348350 poco -> outputRefcon ? * (PixelsOutDispatch * )poco -> outputRefcon : NULL ;
@@ -355,7 +357,7 @@ void xs_poco_end(xsMachine *the)
355357 if (!(poco -> flags & kPocoFlagFrameBuffer )) {
356358 xsmcVars (5 );
357359
358- #if MODDEF_ECMA419_ENABLED
360+ #if MODDEF_ECMA419_DISPLAY
359361 if (poco -> displayHooks ) {
360362 (((xsDisplayHostHooks )poco -> displayHooks )-> doBegin (poco -> outputRefcon , poco -> x , poco -> y , poco -> w , poco -> h , C_NULL , C_NULL , (poco -> flags & kPocoFlagContinue ) ? 1 : 0 ));
361363 }
@@ -366,7 +368,7 @@ void xs_poco_end(xsMachine *the)
366368 }
367369 else {
368370 xsmcGet (xsVar (0 ), xsThis , xsID_pixelsOut );
369- #if MODDEF_ECMA419_ENABLED
371+ #if MODDEF_ECMA419_DISPLAY
370372 xsmcSetNewObject (xsVar (1 ));
371373 xsmcSetInteger (xsVar (2 ), poco -> x );
372374 xsmcSet (xsVar (1 ), xsID_x , xsVar (2 ));
@@ -389,7 +391,7 @@ void xs_poco_end(xsMachine *the)
389391 xsCall4 (xsVar (0 ), xsID_begin , xsVar (1 ), xsVar (2 ), xsVar (3 ), xsVar (4 ));
390392#endif
391393 }
392- #if MODDEF_ECMA419_ENABLED
394+ #if MODDEF_ECMA419_DISPLAY
393395 if (poco -> displayHooks ) {
394396 result = PocoDrawingEnd (poco , poco -> pixels , poco -> pixelsLength , displayPixelReceiver , poco );
395397 }
@@ -433,7 +435,7 @@ void xs_poco_end(xsMachine *the)
433435 poco -> flags &= ~kPocoFlagGCDisabled ;
434436 }
435437
436- #if MODDEF_ECMA419_ENABLED
438+ #if MODDEF_ECMA419_DISPLAY
437439 if (poco -> displayHooks ) {
438440 (((xsDisplayHostHooks )poco -> displayHooks )-> doEnd )(poco -> outputRefcon );
439441
@@ -442,7 +444,7 @@ void xs_poco_end(xsMachine *the)
442444 else
443445#endif
444446 if ((xsmcArgc > 0 ) && xsmcTest (xsArg (0 ))) {
445- #if MODDEF_ECMA419_ENABLED
447+ #if MODDEF_ECMA419_DISPLAY
446448 poco -> flags |= kPocoFlagContinue ;
447449#else
448450 if (pixelsOutDispatch )
@@ -452,7 +454,7 @@ void xs_poco_end(xsMachine *the)
452454#endif
453455 }
454456 else {
455- #if MODDEF_ECMA419_ENABLED
457+ #if MODDEF_ECMA419_DISPLAY
456458 poco -> flags &= ~kPocoFlagContinue ;
457459
458460 if (poco -> displayHooks ) {
@@ -1079,7 +1081,7 @@ void xs_poco_adaptInvalid(xsMachine *the)
10791081 if (!(kPocoFlagAdaptInvalid & poco -> flags ))
10801082 return ;
10811083
1082- #if MODDEF_ECMA419_ENABLED
1084+ #if MODDEF_ECMA419_DISPLAY
10831085 if (poco -> displayHooks ) {
10841086 CommodettoRectangle cr = xsmcGetHostChunk (xsArg (0 ));
10851087#if 0 != kPocoRotation
0 commit comments