@@ -338,7 +338,7 @@ CompilerValue *LooksBlocks::compileNextBackdrop(Compiler *compiler)
338338 return nullptr ;
339339}
340340
341- extern " C " void looks_start_stack_timer (ExecutionContext *ctx, double duration)
341+ BLOCK_EXPORT void looks_start_stack_timer (ExecutionContext *ctx, double duration)
342342{
343343 ctx->stackTimer ()->start (duration);
344344}
@@ -356,7 +356,7 @@ void looks_show_bubble(Thread *thread, TextBubble::Type type, const StringPtr *m
356356 target->bubble ()->setText (u8message);
357357}
358358
359- extern " C " bool looks_update_bubble (ExecutionContext *ctx)
359+ BLOCK_EXPORT bool looks_update_bubble (ExecutionContext *ctx)
360360{
361361 if (ctx->stackTimer ()->elapsed ()) {
362362 Thread *thread = ctx->thread ();
@@ -372,57 +372,57 @@ extern "C" bool looks_update_bubble(ExecutionContext *ctx)
372372 return false ;
373373}
374374
375- extern " C " void looks_say (ExecutionContext *ctx, const StringPtr *message, bool saveThread)
375+ BLOCK_EXPORT void looks_say (ExecutionContext *ctx, const StringPtr *message, bool saveThread)
376376{
377377 looks_show_bubble (ctx->thread (), TextBubble::Type::Say, message, saveThread);
378378}
379379
380- extern " C " void looks_think (ExecutionContext *ctx, const StringPtr *message, bool saveThread)
380+ BLOCK_EXPORT void looks_think (ExecutionContext *ctx, const StringPtr *message, bool saveThread)
381381{
382382 looks_show_bubble (ctx->thread (), TextBubble::Type::Think, message, saveThread);
383383}
384384
385- extern " C " void looks_show (Sprite *sprite)
385+ BLOCK_EXPORT void looks_show (Sprite *sprite)
386386{
387387 sprite->setVisible (true );
388388}
389389
390- extern " C " void looks_hide (Sprite *sprite)
390+ BLOCK_EXPORT void looks_hide (Sprite *sprite)
391391{
392392 sprite->setVisible (false );
393393}
394394
395- extern " C " void looks_changeeffectby (Target *target, IGraphicsEffect *effect, double change)
395+ BLOCK_EXPORT void looks_changeeffectby (Target *target, IGraphicsEffect *effect, double change)
396396{
397397 target->setGraphicsEffectValue (effect, target->graphicsEffectValue (effect) + change);
398398}
399399
400- extern " C " void looks_seteffectto (Target *target, IGraphicsEffect *effect, double value)
400+ BLOCK_EXPORT void looks_seteffectto (Target *target, IGraphicsEffect *effect, double value)
401401{
402402 target->setGraphicsEffectValue (effect, value);
403403}
404404
405- extern " C " void looks_cleargraphiceffects (Target *target)
405+ BLOCK_EXPORT void looks_cleargraphiceffects (Target *target)
406406{
407407 target->clearGraphicsEffects ();
408408}
409409
410- extern " C " void looks_changesizeby (Sprite *sprite, double change)
410+ BLOCK_EXPORT void looks_changesizeby (Sprite *sprite, double change)
411411{
412412 sprite->setSize (sprite->size () + change);
413413}
414414
415- extern " C " void looks_setsizeto (Sprite *sprite, double size)
415+ BLOCK_EXPORT void looks_setsizeto (Sprite *sprite, double size)
416416{
417417 sprite->setSize (size);
418418}
419419
420- extern " C " double looks_size (Sprite *sprite)
420+ BLOCK_EXPORT double looks_size (Sprite *sprite)
421421{
422422 return sprite->size ();
423423}
424424
425- extern " C " void looks_set_costume_by_index (Target *target, long index)
425+ BLOCK_EXPORT void looks_set_costume_by_index (Target *target, long index)
426426{
427427 const int costumeCount = target->costumes ().size ();
428428
@@ -434,12 +434,12 @@ extern "C" void looks_set_costume_by_index(Target *target, long index)
434434 target->setCostumeIndex (index);
435435}
436436
437- extern " C " void looks_nextcostume (Target *target)
437+ BLOCK_EXPORT void looks_nextcostume (Target *target)
438438{
439439 looks_set_costume_by_index (target, target->costumeIndex () + 1 );
440440}
441441
442- extern " C " void looks_previouscostume (Target *target)
442+ BLOCK_EXPORT void looks_previouscostume (Target *target)
443443{
444444 looks_set_costume_by_index (target, target->costumeIndex () - 1 );
445445}
@@ -452,7 +452,7 @@ void looks_randomcostume(Target *target, IRandomGenerator *rng)
452452 looks_set_costume_by_index (target, rng->randintExcept (0 , count - 1 , target->costumeIndex ())); // exclude current costume
453453}
454454
455- extern " C " void looks_switchcostumeto (Target *target, const ValueData *costume)
455+ BLOCK_EXPORT void looks_switchcostumeto (Target *target, const ValueData *costume)
456456{
457457 // https://github.com/scratchfoundation/scratch-vm/blob/8dbcc1fc8f8d8c4f1e40629fe8a388149d6dfd1c/src/blocks/scratch3_looks.js#L389-L413
458458 if (!value_isString (costume)) {
@@ -485,7 +485,7 @@ extern "C" void looks_switchcostumeto(Target *target, const ValueData *costume)
485485 }
486486}
487487
488- extern " C " void looks_start_backdrop_scripts (ExecutionContext *ctx, bool wait)
488+ BLOCK_EXPORT void looks_start_backdrop_scripts (ExecutionContext *ctx, bool wait)
489489{
490490 IEngine *engine = ctx->engine ();
491491 Stage *stage = engine->stage ();
@@ -495,7 +495,7 @@ extern "C" void looks_start_backdrop_scripts(ExecutionContext *ctx, bool wait)
495495 engine->startBackdropScripts (backdrop->broadcast (), ctx->thread (), wait);
496496}
497497
498- extern " C " void looks_switchbackdropto (ExecutionContext *ctx, const ValueData *backdrop)
498+ BLOCK_EXPORT void looks_switchbackdropto (ExecutionContext *ctx, const ValueData *backdrop)
499499{
500500 Stage *stage = ctx->engine ()->stage ();
501501
@@ -532,53 +532,53 @@ extern "C" void looks_switchbackdropto(ExecutionContext *ctx, const ValueData *b
532532 }
533533}
534534
535- extern " C " void looks_move_to_front (ExecutionContext *ctx)
535+ BLOCK_EXPORT void looks_move_to_front (ExecutionContext *ctx)
536536{
537537 Target *target = ctx->thread ()->target ();
538538 ctx->engine ()->moveDrawableToFront (target);
539539}
540540
541- extern " C " void looks_move_to_back (ExecutionContext *ctx)
541+ BLOCK_EXPORT void looks_move_to_back (ExecutionContext *ctx)
542542{
543543 Target *target = ctx->thread ()->target ();
544544 ctx->engine ()->moveDrawableToBack (target);
545545}
546546
547- extern " C " void looks_move_forward_layers (ExecutionContext *ctx, double layers)
547+ BLOCK_EXPORT void looks_move_forward_layers (ExecutionContext *ctx, double layers)
548548{
549549 Target *target = ctx->thread ()->target ();
550550 ctx->engine ()->moveDrawableForwardLayers (target, layers);
551551}
552552
553- extern " C " void looks_move_backward_layers (ExecutionContext *ctx, double layers)
553+ BLOCK_EXPORT void looks_move_backward_layers (ExecutionContext *ctx, double layers)
554554{
555555 Target *target = ctx->thread ()->target ();
556556 ctx->engine ()->moveDrawableBackwardLayers (target, layers);
557557}
558558
559- extern " C " double looks_backdrop_number (ExecutionContext *ctx)
559+ BLOCK_EXPORT double looks_backdrop_number (ExecutionContext *ctx)
560560{
561561 return ctx->engine ()->stage ()->costumeIndex () + 1 ;
562562}
563563
564- extern " C " void looks_backdrop_name (StringPtr *ret, ExecutionContext *ctx)
564+ BLOCK_EXPORT void looks_backdrop_name (StringPtr *ret, ExecutionContext *ctx)
565565{
566566 const std::string &name = ctx->engine ()->stage ()->currentCostume ()->name ();
567567 string_assign_cstring (ret, name.c_str ());
568568}
569569
570- extern " C " double looks_costume_number (Target *target)
570+ BLOCK_EXPORT double looks_costume_number (Target *target)
571571{
572572 return target->costumeIndex () + 1 ;
573573}
574574
575- extern " C " void looks_costume_name (StringPtr *ret, Target *target)
575+ BLOCK_EXPORT void looks_costume_name (StringPtr *ret, Target *target)
576576{
577577 const std::string &name = target->currentCostume ()->name ();
578578 string_assign_cstring (ret, name.c_str ());
579579}
580580
581- extern " C " bool looks_backdrop_promise (ExecutionContext *ctx)
581+ BLOCK_EXPORT bool looks_backdrop_promise (ExecutionContext *ctx)
582582{
583583 if (ctx->engine ()->stage ()->costumes ().size () > 0 ) {
584584 ctx->setPromise (std::make_shared<Promise>());
@@ -588,7 +588,7 @@ extern "C" bool looks_backdrop_promise(ExecutionContext *ctx)
588588 return false ;
589589}
590590
591- extern " C " void looks_nextbackdrop (ExecutionContext *ctx)
591+ BLOCK_EXPORT void looks_nextbackdrop (ExecutionContext *ctx)
592592{
593593 looks_nextcostume (ctx->engine ()->stage ());
594594}
0 commit comments