Commit graph

84 commits

Author SHA1 Message Date
Dmitry Grigoryev fbd05a1592 optimize include files (include what you use) 2021-02-06 21:38:50 +01:00
Kp 5c7fc7d143 Remove unused UI_DIALOG d_callback
Every user now uses inheritance and a virtual function override.  Make
callback_handler pure virtual, delete its body, and then delete the
member variables that existed only for use in that body.  Remove the
constructor parameters that initialized those variables, and update all
derived classes accordingly.
2020-12-19 16:13:26 +00:00
Kp 2709676f8d Rename ui_create_dialog to window_create
The requirement to call send_creation_events from outside the
constructor makes the presence of a helper function convenient.  Rename
ui_create_dialog to window_create, and move it to window.h.
2020-12-19 16:13:26 +00:00
Kp 2869566866 Remove unused ui_create_dialog parameter createdata
It is always nullptr.  Remove the parameter and pass nullptr where the
parameter was used.
2020-10-22 02:26:16 +00:00
Kp 261acf0ebc Simplify object_dialog callback_handler
The window is a C++ object; it does not need to access a global to get a
pointer to its own data.
2020-10-22 02:26:16 +00:00
Kp d61f3014b9 Remove sole use of non-nullptr createdata
object_dialog needs one parameter.  Move that handling to the
constructor.
2020-10-22 02:26:16 +00:00
Kp 4f572bbe23 Pass UI_DIALOG& to ui_add_gadget_userbox 2020-10-12 03:28:26 +00:00
Kp 95598a34e3 Pass UI_DIALOG& to ui_add_gadget_inputbox 2020-10-12 03:28:26 +00:00
Kp 506f24ed04 Pass UI_GADGET_RADIO& to ui_radio_set_value 2020-10-12 03:28:26 +00:00
Kp f531c7d43e Pass UI_DIALOG& to ui_add_gadget_radio 2020-10-12 03:28:26 +00:00
Kp a563b5edf7 Pass UI_DIALOG& to ui_add_gadget_button 2020-10-12 03:28:26 +00:00
Kp 6dce3f90c2 Pass UI_DIALOG& to ui_close_dialog 2020-10-12 03:28:26 +00:00
Kp b6a7f63e5d Pass UI_DIALOG& to ui_gadget_calc_keys 2020-10-12 03:28:26 +00:00
Kp c1ce3a2938 Pass explicit nullptr for ui_create_dialog createdata 2020-10-12 03:28:25 +00:00
Kp 147078615a Make object_dialog inherit from UI_DIALOG 2020-10-12 03:28:25 +00:00
Kp c73e310928 Make robot_dialog inherit from UI_DIALOG 2020-09-21 03:18:12 +00:00
Kp b97f581d56 Make hostage_dialog inherit from UI_DIALOG 2020-09-21 03:18:12 +00:00
Kp 038c6aef4d Move d_level_unique_object_state to a separate header
This is required to untangle the cross-inclusion of object.h and
morph.h.
2020-08-10 03:45:14 +00:00
Kp 7ad8d8c28b Rename object::movement_type to movement_source
gcc and clang disagree about how to disambiguate when an identifier is
both a typename and a member.  Avoid the disagreement by renaming the
member.
2020-08-10 03:45:13 +00:00
Kp 38cddb0289 Use enum class for object movement_type 2020-08-10 03:45:13 +00:00
Kp a4f2edfaa9 Move LevelSharedVertexState into d_level_shared_segment_state 2020-05-17 23:35:25 +00:00
Kp db7b4b3f88 Refer to <memory> directly, not through "compiler-make_unique.h" 2020-05-02 21:18:43 +00:00
Kp cc38cdf4b8 Qualify uses of std::make_unique 2020-05-02 21:18:42 +00:00
Kp 53761500f1 Qualify uses of std::array 2020-05-02 21:18:42 +00:00
Kp 063bf29225 Enable -Wimplicit-fallthrough=5; fix resulting breaks
This enables using -Wimplicit-fallthrough with ccache+distcc, which
strip the fallthrough comments, but do not strip the attribute
annotationns.
2019-04-04 04:29:03 +00:00
Kp 1008ab397e Move Objects to d_level_unique_object_state 2019-03-03 00:31:08 +00:00
Kp 12c06e59aa Move N_robot_types into LevelSharedRobotInfoState 2018-12-30 00:43:59 +00:00
Kp e84a65edc6 Move Robot_info into LevelSharedRobotInfoState 2018-12-30 00:43:59 +00:00
Kp 1a5844e218 Move Vertices out of global scope 2018-12-30 00:43:57 +00:00
Kp c56223ced4 Eliminate more uses of valptridx::operator-> 2018-09-19 02:13:29 +00:00
Kp 96bc6f2047 Use enumerate for medrobot AI mode boxes 2017-10-14 17:10:31 +00:00
Kp 599ac9dee0 Always qualify valptridx type/factory
Previously, valptridx used PREFIX for allow-invalid+mutable, c#PREFIX
for allow-invalid+const, v#PREFIX for require-valid+mutable, vc#PREFIX
for require-valid+const.  Convert the types, factories, and all usage
sites to specify a qualifier for all four combinations:

	im#PREFIX -> allow-invalid+mutable
	ic#PREFIX -> allow-invalid+const
	vm#PREFIX -> require-valid+mutable
	vc#PREFIX -> require-valid+const

Changes to common/include/valptridx.h and common/include/fwd-valptridx.h
are manual.  All other changes are generated by:

	git grep -lz -e '\(obj\|seg\|clwall\|wall\|actdoor\|trg\)\(ptridx\|ptr\|idx\)\(_t\)\?\>' | xargs -0 sed -i -e 's/\<\(v\?\)\(\(obj\|seg\|clwall\|wall\|actdoor\|trg\)\(ptridx\|ptr\|idx\)\(_t\)\?\)\>/\1m\2/g'

for the 'm' prefix and:

	git grep -lz -e '\(obj\|seg\|clwall\|wall\|actdoor\|trg\)\(ptridx\|ptr\|idx\)\(_t\)\?\>' | xargs -0 sed -i -e 's/\<\([cm]\(obj\|seg\|clwall\|wall\|actdoor\|trg\)\(ptridx\|ptr\|idx\)\(_t\)\?\)\>/i&/g'

for the 'i' prefix.
2017-06-10 03:31:02 +00:00
Kp b0cb681ae7 Add gcc-7 /*-fallthrough*/ comments for obvious cases
For switch cases where existing comments or code flow logic obviously
intended to fall through, add a gcc-7 /*-fallthrough*/ comment to
silence warnings about this.  Some cases which are less obvious are not
converted, so the code does not yet compile clean with
-Wimplicit-fallthrough.

Reported-by: parkerlreed <https://github.com/dxx-rebirth/dxx-rebirth/issues/338>
2017-06-07 02:44:54 +00:00
Kp af55ba08cc Pass grs_canvas &to draw_object_picture 2017-04-30 16:25:16 +00:00
Chris Taylor 19e4c07bb0 Bosses generated by a robot maker or even released by another robot will now teleport
Fixes issue #328.
2017-02-26 10:21:10 +08:00
Kp 22e364e030 Pass canvas to gr_clear_canvas 2017-01-01 00:45:45 +00:00
Chris Taylor 5f19a3cba9 Remove redundant checks and initialisations recently added for editor 2016-11-13 12:44:53 +08:00
Chris Taylor d41146bcbd Set default object index for object dialog
This prevents the Object Editor from crashing when no object is selected (Cur_object_index == object_none).
2016-11-11 16:09:57 +08:00
Chris Taylor fd3e60be54 Make object_dialog_handler return window_event_result::close instead of closing itself
This ensures the event system will know what's going on.
2016-10-27 17:52:50 +08:00
Chris Taylor acc595ba16 Make robot_dialog_handler return window_event_result::close instead of closing itself
This ensures the event system will know what's going on.
2016-10-27 17:51:00 +08:00
Chris Taylor db665d8c33 Allow dcx::UI_DIALOG struct to be subclassed - step 2
Allow dcx::UI_DIALOG struct to be subclassed step 2. Make all the UI_DIALOG handlers return a window_event_result like everyone else.
2016-10-04 15:58:20 +08:00
Kp 69eec0d71f Save some editor gadget pointers 2016-09-24 18:06:11 +00:00
Kp ee1003f29f Move conditionally compiled code into namespace dsx 2016-08-25 04:05:32 +00:00
Kp 1bd32fedb5 Remove unused STRING_LENGTH 2016-07-09 17:58:35 +00:00
Kp 3779bc25a0 Define Robot_names only if EDITOR 2016-07-09 17:58:34 +00:00
Kp fee76e6ced Define Powerup_names only if EDITOR 2016-07-09 17:58:34 +00:00
Kp 730d61a738 Pass object &to init_ai_object 2016-04-23 17:59:47 +00:00
Kp 858c3e26e0 Remove sprintf from editor/medrobot.cpp 2016-01-09 16:38:17 +00:00
Kp 708dc0a7e1 Use vobjptr/vcobjptr for more Objects[] access 2015-12-03 03:26:49 +00:00
Kp 82d0c2ed96 Make some implicit uses of ptridx construction explicit 2015-11-19 03:23:34 +00:00