@@ -436,13 +436,10 @@ EIOS* SimbaPluginTarget_RequestWithDebugImage(const char* initargs, void** image
436
436
std::int32_t width = 0 ;
437
437
std::int32_t height = 0 ;
438
438
eios->control_center ->get_target_dimensions (&width, &height);
439
-
439
+ eios->control_center ->set_image_format (ImageFormat::BGRA);
440
+ eios->control_center ->set_debug_graphics (true );
440
441
*image = PLUGIN_SIMBA_METHODS.ExternalImage_Create (true );
441
- PLUGIN_SIMBA_METHODS.ExternalImage_SetMemory (*image, EIOS_GetImageBuffer (eios), width, height);
442
-
443
- PLUGIN_SIMBA_METHODS.ExternalImage_AddCallbackOnUnlock (*image, []{
444
-
445
- });
442
+ PLUGIN_SIMBA_METHODS.ExternalImage_SetMemory (*image, eios->control_center ->get_debug_image (), width, height);
446
443
}
447
444
448
445
return eios;
@@ -458,28 +455,32 @@ void SimbaPluginTarget_GetDimensions(EIOS* eios, std::int32_t* width, std::int32
458
455
EIOS_GetTargetDimensions (eios, width, height);
459
456
}
460
457
461
- void SimbaPluginTarget_GetImageData (EIOS* eios, std::int32_t x, std::int32_t y, std::int32_t width, std::int32_t height, void ** pColorBGRA , std::int32_t * data_width) noexcept
458
+ bool SimbaPluginTarget_GetImageData (EIOS* eios, std::int32_t x, std::int32_t y, std::int32_t width, std::int32_t height, void ** bgra , std::int32_t * data_width) noexcept
462
459
{
463
- std::uint8_t * image_buffer = EIOS_GetImageBuffer (eios);
464
- *pColorBGRA = &image_buffer[y * width + x];
465
- *data_width = width;
460
+ if (eios)
461
+ {
462
+ *data_width = eios->control_center ->get_target_width ();
463
+ *bgra = &eios->control_center ->get_image ()[(y * (*data_width) + x) * 4 ];
464
+
465
+ return true ;
466
+ } else {
467
+ return false ;
468
+ }
466
469
}
467
470
468
471
bool SimbaPluginTarget_MousePressed (EIOS* eios, int mouse_button) noexcept
469
472
{
470
473
return EIOS_IsMouseButtonHeld (eios, mouse_button);
471
474
}
472
475
473
- TPoint SimbaPluginTarget_MousePosition (EIOS* eios) noexcept
476
+ void SimbaPluginTarget_MousePosition (EIOS* eios, std:: int32_t * x, std:: int32_t * y ) noexcept
474
477
{
475
- std::int32_t x, y;
476
- EIOS_GetMousePosition (eios, &x, &y);
477
- return {x, y};
478
+ EIOS_GetMousePosition (eios, x, y);
478
479
}
479
480
480
- void SimbaPluginTarget_Teleport (EIOS* eios, const TPoint &p ) noexcept
481
+ void SimbaPluginTarget_MouseTeleport (EIOS* eios, std:: int32_t x, std:: int32_t y ) noexcept
481
482
{
482
- EIOS_MoveMouse (eios, p. x , p. y );
483
+ EIOS_MoveMouse (eios, x, y);
483
484
}
484
485
485
486
void SimbaPluginTarget_MouseUp (EIOS* eios, int mouse_button) noexcept
@@ -507,11 +508,11 @@ void SimbaPluginTarget_KeyUp(EIOS* eios, std::int32_t key) noexcept
507
508
EIOS_ReleaseKey (eios, key);
508
509
}
509
510
510
- void SimbaPluginTarget_KeySend (EIOS* eios, char key , std::int32_t key_down_time , std::int32_t key_up_time, std:: int32_t modifier_down_time, std:: int32_t modifier_up_time ) noexcept
511
+ void SimbaPluginTarget_KeySend (EIOS* eios, char * text , std::int32_t len , std::int32_t * sleeptimes ) noexcept
511
512
{
512
513
if (eios)
513
514
{
514
- eios->control_center ->send_key (key, key_down_time, key_up_time, modifier_down_time, modifier_up_time );
515
+ eios->control_center ->key_send (text, len, sleeptimes );
515
516
}
516
517
}
517
518
0 commit comments