When File->'Play in 320x200' is chosen, use StartNewGame(Current_level_num). For now use create_new_mission and Current_level_num = 1 every time. Also remove the now redundant hacks GM_EDITOR and editor_reset_stuff_on_level.
The functions med-mark-start and med-mark-end don't exist - that's fine, still read the rest of the menus, so it can actually properly 'hide' the help menu after it's clicked on.
build_segment_list and build_object_lists are now required for _search_mode as well (i.e. required for every frame), as the segment list is no longer a set of global variables.
If a game was playing, continue playing. If it was in the main menu, return to the main menu. (If all files are put in place the editor can load again.)
This prevents newdemo_stop_playback from attempting to close Game_wind, which results in it being freed twice - in particular when switching to the editor (via delete-E) when playing a demo.
When responding to EVENT_WINDOW_CLOSE, set MainWindow to nullptr - fixing multiple issues with these dialogs including the inability to re-open them and a crash on exiting the editor.
As the UI_DIALOG client is now responsible for freeing all gadgets (via unique_ptr's), this function now causes issues where it attempts to access freed gadgets (resulting in std::runtime_error("unknown gadget kind") exception when closing the AI Properties dialog on my Macbook, for example). Removing the offending function fixes the issue.
If loading an pre-v22 save game, or loading any save where the player
died on the secret level, clear Omega_charge instead of retaining
whatever value the prior game used.
menu.cpp always needs SDL.h, but included it only as a side effect of
joy.h including SDL.h. joy.h only includes SDL.h when max_joysticks!=0.
Reported-by: kreatordxx <https://github.com/dxx-rebirth/dxx-rebirth/issues/258>
Split ogl_get_verinfo() into ogl_tune_for_current() and
ogl_extensions_init(), and consolidate all the OpenGL extension handling
into ogl_extensions.cpp. Unify the code paths for texture anisotropy and
GPU synchronization for OpenGL and OpenGL ES.
Currently, our renderer only uses GLES 1.0, so no real world implementation
will support sync objects for such an old context, but the logic is valid,
and this way, the GLES specific code paths are reduced.
This patch also fixes an issue where the old ogl_get_verinfo() did modify
the texture filtering mode if no anisotropic filter was available. This
was some leftover from the time when the anisotropic filter was a just
a specific CGameConfig.TexFilt mode, and not a separate, orthogonal setting
CGameCfg.TexAnisotropy that it is now.
derhass reports that SDL on Raspbian provokes a warning from
-Wuseless-cast. Add a test that will report -Wuseless-cast as unusable
when SDL causes this warning. Developers on Raspbian will not get the
benefit of -Wuseless-cast, but their build will succeed.
Reported-by: derhass <https://github.com/dxx-rebirth/dxx-rebirth/issues/257>
derhass reports that OpenGL ES builds warn for unused parameter
`texanis`. This parameter controls a feature that is not available in
current Rebirth OpenGL ES builds. Cast the parameter to void to silence
the warning. Long term, the code ought to be changed to advise the user
when their platform lacks this feature. In the short term, merge this
fix so that the build will succeed.
https://github.com/dxx-rebirth/dxx-rebirth/pull/256
Extended identifiers are convenient when supported, but derhass reports
that the latest stable gcc on Raspbian stable fails the test for
mandatory extended identifier support. Replace the Cxx11RequiredFeature
test for extended identifiers with an SConf test to selectively enable
-fextended-identifiers.
Reported-by: derhass <https://github.com/dxx-rebirth/dxx-rebirth/issues/254>
Fixes: a8a41aa2ff ("Move git version into Python class")
The segiter code used objptridx because end is signalled by object_none,
and vobjptridx does not allow object_none. However, the compiler
produces better code if segment_object_range_t returns vobjptridx and
future cleanups are easier if iterating objects_in yields vobjptridx
objects. Add a special-case override of the normal checking rules, move
the required checks into segiter, and then let segiter break the rules
normally enforced by valptridx. Add a comment explaining that this
permits unsafe coding and should be done only with a clear understanding
of the responsibilities it brings.