Commit graph

790 commits

Author SHA1 Message Date
Kp 318ed5b684 Simplify info_display_default
Commit 8a437a759c made show_all always
true.
2020-12-27 22:03:09 +00:00
Kp c3e2d1841c Simplify info_display_segsize
Commit 8a437a759c made show_all always
true.
2020-12-27 22:03:09 +00:00
Kp 7fde0a00a0 Simplify info_display_object_placement
Commit 8a437a759c changed the logic to
always set show_all to 1.  This renders the short-circuit logic in
info_display_object_placement irrelevant, as show_all will always force
the information to draw.  Remove the variables that were used to decide
whether a redraw was required.
2020-12-27 22:03:09 +00:00
Kp c1d6150015 Pass grs_font& to gr_set_curfont 2020-12-27 22:03:09 +00:00
Kp 834f009dd7 Use enum class for wallnum_t 2020-12-26 21:17:29 +00:00
Kp 92aeee1efc Fix array underflow in GotoPrevWall when no walls exist 2020-12-26 21:17:29 +00:00
Kp fc63029833 Move more symbols into namespaces 2020-12-26 21:17:29 +00:00
Kp e2565e6120 Move some group structures inside #if 0
Some group functionality was disabled in 2665869c24, but the globals
to support the disabled code were not removed.  Move them into a
corresponding #if 0, since they have no value with the group code
disabled.

Fixes: 2665869c24 ("Mark editor groups broken")
2020-12-26 21:17:29 +00:00
Kp faa4d2ce34 Use enum class for vertnum_t 2020-12-26 21:17:29 +00:00
Kp 38770bea12 Remove remap_side_uvs
It has never worked correctly.  It compares real vertex numbers (as used
to index in Vertices[]) to abstract vertex numbers (always in the range
of [0, 7], as used on a theoretical segment.
2020-12-26 21:17:29 +00:00
Kp 9d62300898 Make find_edge more like automap_find_edge
Both have similar purposes, but search for different matching data
structures.
2020-12-26 21:17:29 +00:00
Kp 10b43d4ba0 Enable quick exit from is_free_vertex
Once the loop has determined a vertex is used at least twice, there is
no need to count how many more times it is used.  Return immediately
after detecting the second use.
2020-12-26 21:17:29 +00:00
Kp 95d8095c6d Simplify med_set_vertex
- Make it static
- Remove the update of Num_vertices, since the caller reverses that
  update.
- Remove the reversal, since it is no longer needed.
- Remove the test and update of Vertices.count, because the caller
  always passes a vertex number that makes the test false.
2020-12-26 21:17:29 +00:00
Kp 90d43d6519 Simplify compress_vertices 2020-12-26 21:17:29 +00:00
Kp c58a69dbec Return vertnum_t from med_add_vertex 2020-12-26 21:17:29 +00:00
Kp 479884288c Always delegate to window_create for send_creation_events 2020-12-20 20:39:07 +00:00
Kp b1b2300c7d Use enum class for wall_key 2020-12-19 16:13:26 +00:00
Kp 47c33cbd55 Use enum class for WALL_IS_DOORWAY_FLAG
This reduces the size of the debug information substantially.
2020-12-19 16:13:26 +00:00
Kp 200952c3d9 Add type-specific tag wrappers for newmenu calls
Make the compiler check that title, subtitle, and filename are passed in
the right places.
2020-12-19 16:13:26 +00: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 d309c141e7 Switch non-format uses of nm_messagebox to nm_messagebox_str 2020-10-22 02:26:16 +00:00
Kp ae657007fe Remove send_creation_events parameter
It is always nullptr.
2020-10-22 02:26:16 +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 ffb653c0b8 Pass control_info & to various functions
Switch from a direct global reference to passing control_info& as a
parameter.
2020-10-12 03:28:26 +00:00
Kp f8185494ad Pass UI_DIALOG& to ui_add_gadget_icon 2020-10-12 03:28:26 +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 466f431c91 Pass UI_DIALOG& to ui_add_gadget_checkbox 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 f79e0343d9 Pass UI_DIALOG& to ui_gadget_send_event 2020-10-12 03:28:25 +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 d25d14c24f Make wall_dialog inherit from UI_DIALOG 2020-10-12 03:28:25 +00:00
Kp 7fb4f7b396 Use std::array for editor mine filename 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 a6b8012b5d Make editor_dialog inherit from UI_DIALOG 2020-09-21 03:18:12 +00:00
Kp e4442a1b05 Remove code for ORTHO_VIEWS
Support for ORTHO_VIEWS has been broken since commit
db514a5ded in December 2004.

`git blame HEAD -L872,+4 -- similar/editor/meddraw.cpp`:
```
db514a5ded main/editor/meddraw.c (Bradley Bell 2004-12-19 13:54:27 +0000 872) 			}
db514a5ded main/editor/meddraw.c (Bradley Bell 2004-12-19 13:54:27 +0000 873) 		} else
db514a5ded main/editor/meddraw.c (Bradley Bell 2004-12-19 13:54:27 +0000 874) #if ORTHO_VIEWS
db514a5ded main/editor/meddraw.c (Bradley Bell 2004-12-19 13:54:27 +0000 875) 		 else if ( screen_canvas == TopViewBox->canvas )
```

When ORTHO_VIEWS is true, this code expands to `} else else if (...)`; a
double-else is not legal, so the code cannot have been compiled with
ORTHO_VIEWS enabled.  All 4 of the relevant lines date to db514a5ded,
which itself is an import of files from the D1X editor.
2020-09-21 03:18:12 +00:00
Kp cd620e5f8c Make trigger_dialog inherit from UI_DIALOG 2020-09-21 03:18:12 +00:00
Kp 09966079c4 Make centers_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 3c1c270643 Make info_dialog_window inherit from window 2020-09-21 03:18:12 +00:00
Kp d056daa162 Remove obsolete UI_DIALOG constructor, macros 2020-09-21 03:18:12 +00:00
Kp b3c3066a38 Fix no-joystick build
When joystick support is not present, `event_joystick_get_button` is not
declared in joy.h.

Fixes: c24864b180 ("make menus controllable with joystick")
2020-09-11 03:08:02 +00:00