This was needed to get the build working with vcpkg's version of SDL, where all the SDL files are
in their own SDL folder. However, our cmake config also has a note saying it was a deliberate choice
to move our SDL files *out* of their SDL2 folder due to certain distros (FreeBSD is mentioned) not
putting the files in said folder in the first place.
The above commit moved context menu handling from right_click to right_mouse_up. However, that removed
the early-exit if right_click_show_menu returned false. It seems some areas of the code (in this case,
the editor in editor_controller::right_click - don't ask me exactly how this leads to editor_controller::mouse_motion
where the codepath that caused the exception in the above bug is actually called, I didn't bother to trace it)
relied on that early exit to control behavior.
Making right_click return the value of right_click_show_menu by default fixes things.
Turns out I mistook @celticminstrel's opinion that we should use include guards over pragma (737916e).
Since all major compilers support `#pragma once`, there's no reason not to use it.
For future mergability reasons, this excludes src/spirit_po and src/xBRZ. It also excludes src/boost-patched.
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.
If we decided it was worth it to inline map_location ==, then
surely this is also worth it to inline null_location, as the
compiler may be able to reduce tests for == null location to
"x == ... && y == ...", without having to move to a different
compilation unit.
...with fast switching between them. Can be disabled in the editor
settings. Also changed:
* the display class now holds a pointer to the map instead of a
reference, a pointer can be changed which permits the entire MDI
behavior. Related bits were also changed in terrain_builder.
* mouse_handler_base no longer holds a reference to the map
* the map labels class does not hold a gamemap reference, as it can
use the display object to access the map. Also clearing all labels
was exposed as a public member function.
* used scoped_ptrs and forward declarations to avoid having to include
map_label.hpp and terrain_builder.hpp in display.hpp, this reduces
build dependencies quite a bit.
* made get_action_state use the menu index to allow a dynamic menu to
have checkboxes. This entire chunk of code needs a rewrite.
...move into separate cpp/hpp pair. The code under src/ was modified
mainly using a global search-and-replace. This change allows reducing
code dependencies and gets rid of inner-class confusion (parts of the
code had to use "location" when referring to gamemap::location, it is
now consistent across the codebase.)