You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently events are mainly handled by overriding UmbraModule::keyboard and UmbraModule::mouse. These are using libtcod's event system which has known issues. Mostly input lag or silently dropping events depending on how it's being used.
Several classes capture these events and handle them later in their update function. I think is a poor way of handing events and it makes it very hard to refactor them. Some of these might be replaceable with SDL_GetKeyboardState or SDL_GetMouseState.
The latest revision of Umbra adds UmbraModule::onEvent which handles SDL events, but due to how sensitive libtcod's event handing is combined with how the current code relies on several side effects, the event handing will be broken by updating to this version. Which means updating the code to use SDL for events will be a struggle.
Another thing is that SDL provides pixel coordinates which need to be converted by a libtcod function to tile coords for things like window management.
The plan is to remove all overrides of UmbraModule::keyboard and UmbraModule::mouse, and any other calls to libtcod's event system using whatever means possible.
The text was updated successfully, but these errors were encountered:
I've updated the Umbra submodule so onEvent is now accessible. When adding new event handing always prefer adding to this method instead of update/mouse/keyboard.
I had to revert some Umbra input lag fixes so that the current code doesn't instantly break. Right now the lag can't be removed until all event code is moved over.
The next task is to steadily move pieces of event code into onEvent from other places.
Currently events are mainly handled by overriding
UmbraModule::keyboard
andUmbraModule::mouse
. These are using libtcod's event system which has known issues. Mostly input lag or silently dropping events depending on how it's being used.Several classes capture these events and handle them later in their update function. I think is a poor way of handing events and it makes it very hard to refactor them. Some of these might be replaceable with
SDL_GetKeyboardState
orSDL_GetMouseState
.The latest revision of Umbra adds
UmbraModule::onEvent
which handles SDL events, but due to how sensitive libtcod's event handing is combined with how the current code relies on several side effects, the event handing will be broken by updating to this version. Which means updating the code to use SDL for events will be a struggle.Another thing is that SDL provides pixel coordinates which need to be converted by a libtcod function to tile coords for things like window management.
The plan is to remove all overrides of
UmbraModule::keyboard
andUmbraModule::mouse
, and any other calls to libtcod's event system using whatever means possible.The text was updated successfully, but these errors were encountered: