This commit still doesn't fix all of them. I decided to leave alone
cases where variables with the same name are assigned in multiple
conditions of the same if...else if...else statement, and cases where a
scope logging macro is used multiple times in the same scope. In any
case, this commit greatly reduces the warning count on MSVC2015 and makes
new warnings much easier to spot.
This adds a large number of people gleaned from the logs with:
git log --merges --since=Jan.1.2015
If any of the people added in this commit wish to change how they
are referenced, they are of course free to contact us.
If code attempted to remove an event handler from an event context whose
all handlers were in the staging area (especially if that context was
freshly created and events::pump() hadn't been called since creating it),
the handler wasn't removed. This resulted in the handler remaining in the
context, but believing that it wasn't there. If the handler was later
destroyed, the event system still retained a pointer to it and attempted to
call handle_event() on it. Depending on the compiler, it could cause a
"pure virtual function call" error message.
This reverts the semantical change in commit 61ccf2f that event handlers
registered as a result of an event received that event.
Compared with commit 3d8c29bc, this is a lower-level way to fix the ;
character appearing in the command console. This commit has potential to
fix more code that assumes that an event handler can't receive an event
that caused the handler to be registered in the first place. On the other
hand, it is no longer possible for event handlers to receive such events
even if developers want that.
This fixes a crash that would be caused by memory incorrectly being freed
when removed from a list. Relying on splice stops that from happening.
This also fixes an exit condition when deleting handlers as depth could
sometimes not be decremented.
Finally, checks are made to made sure that an sdl_handler is either
exclusively in the global context or a different context, ensuring
that they cannot be in both.
The destructor of the context class accidentally incremented the iterator
twice per iteration. If the number of event handlers was odd, the
destructor ended up incrementing the end iterator, which is UB.
I rewrote the whole destructor. It's unnecessary to manually remove event
handlers from the list because the list will do it automatically when it's
destroyed.
This fixes a crash that was seen when the context destructor was calling
either leave or leave_global while iterating over the list. The current iterator
handle would be invalidated and further calls to it would return invalid values.
This adds a destructor to the context class to ensure that any joined
event_handlers leave the context before it is deallocated.
It also changes the preferences to explicitly leave the global event
context as it is destroyed instead of when the event handler is
destroyed during _exit().
Also replace std::list.splice with push_back and erase(iterator) in
an attempt to avoid compile errors on older versions of gcc.
This re-creates the main display-gui() buttons on a full redraw to take
into account that the theme expects them to be out of sync. As a
consequence I have also been forced to refactor how said buttons are
managed and introduced a new method to join the same event context
as another component.
This removes all legacy SDL1.2 code. It was done by invoking:
coan source --replace --no-transients -D"SDL_VERSION_ATLEAST(X, Y, Z)"=1 <file>
on each file.
These changes ensure that GUI1 elements are properly respecting the
draw layering and are redrawed on the appropriate window events. It
has been tested with both one and multiple overlapping dialogs.
This makes the display class be aware of the layered rendering events (DRAW_ALL) and make it mark itself as dirty on certain window events. It also makes sure that the layers are redrawn in the correct order. GUI2 is now appearing to handle events properly, but GUI1 is still having issues with dialogs. And there's an assertion failure on program exit.
half of CVideo's member variables were already static members (in anon
namespaces) so it was never possibel to have more than one of this
class. Making this class a singelton allows us to move all these
variables into the CVideo class.
This adds a new function to sdl_handler, handle_window_event that is called for all window events. It is propogated to all event contexts instead of just the current one.
events::raise_draw_all_event (and a volatile variant) are added, that also sends draw events to all event contexts in reverse order so that the draw-stack can be redrawn bottom-up.
This adds a global event scope that an sdl_handler can register to in
order to receive all current events, regardless of the current
scope. Care should be taken to not be registerd in a local event
context and the global context at the same time as it will lead to the
event handler potentially being invoked twice.
This also adds the workaround needed for #24209 in the new event
handler in the video class.