OpenMods / OpenPeripheral-Addons

An addon for OpenPeripheral, adding physical blocks and items to the game
MIT License
11 stars 10 forks source link

[Suggestion] Deleting drawables currently very slow #85

Closed blunty666 closed 8 years ago

blunty666 commented 8 years ago

Currently, when deleting a drawable, the "task_complete" event gets fires and the delete function waits for this before returning. This means that when deleting several drawables at once, it is a slow process to delete them all one by one.

A current workaround is to call 'coroutine.resume( coroutine.create( drawable.delete ) )' for each drawable which removes the need to wait for the "task_complete" event for each one. However this stills swamps the computer event queue with many "task_complete" events, causing other events to be missed as well as being very resource intensive to create all those coroutines.

Until the planned drawable container is fully implemented, I suggest the above is changed to remove the firing of the task_complete events.