Commit graph

10932 commits

Author SHA1 Message Date
Kp a6abf76d0a Use enum class for index into ObjBitmaps 2020-10-07 03:59:14 +00:00
Kp 24497fa085 Use enum class for bmread mode selector 2020-10-07 03:59:14 +00:00
Kp 56b45ca2e8 Fix off-by-one in menu logic
If a menu was all text except for the last element, the menu would
incorrectly be classifed as all text, and citem would be pinned to the
first element.

Fixes: 14a9657136 ("Use partial_range to store newmenu_item pointer/length")
2020-10-03 22:34:38 +00:00
Kp c482d01be5 Move some fvi types to namespaces 2020-10-01 03:25:27 +00:00
Kp b136994551 Move valptridx<segment> to dcx
segment is now dcx, so move the valptridx wrapper.
2020-10-01 03:25:27 +00:00
Kp e6126b800f Reorder endlevel definitions to split by dcx/dsx 2020-10-01 03:25:27 +00:00
Kp d7560843b0 Fix exit tunnel sequence
The index and the value were transposed, and since both were integer
types, the type system was unable to warn that the new code was
incorrect.  Swap the variables to bind as intended.

Reported-by: Donkyhotay <https://github.com/dxx-rebirth/dxx-rebirth/issues/544>
Fixes: de4efc4f46 ("Qualify more uses of shared_segment members")
2020-10-01 03:25:27 +00:00
Kp 1fc8663eff Improve ui_add_gadget_inputbox length handling
Fix potential buffer overflow if `length` (now `length_of_initial_text`)
is less than the `strlen` computed length of text.

Rename variables to clarify usage.

Eliminate the unnecessary use of `strlen`.
2020-09-28 03:32:15 +00:00
Kp 88ab83c354 Remove write-only field UI_GADGET_INPUTBOX::slength 2020-09-28 03:32:15 +00:00
Kp 9a5e968646 Use std::unique_ptr for UI_GADGET_INPUTBOX::text 2020-09-28 03:32:15 +00:00
Kp 59ca93f219 Simplify copy+uppercase pattern in editor code
Change d_strupr to both copy and uppercase, instead of using strcpy to
copy and then a separate phase to rewrite the text as uppercase.
2020-09-28 03:32:15 +00:00
Kp cbf9fb9b9e Remove reference to gcc5 in INSTALL.markdown section for Homebrew
According to a comment from Kreeblah[1], homebrew guarantees a new
enough C++ compiler.  Additionally, gcc5 was once new enough, but is now
below the minimum supported version, so installing it is not useful.
Remove the reference to it.

[1]: https://github.com/dxx-rebirth/dxx-rebirth/pull/540#discussion_r486059009
2020-09-21 03:18:12 +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 5cdd562244 Move UI_DIALOG callback handling to virtual function 2020-09-21 03:18:12 +00:00
Kp 8760387188 Make UI_DIALOG inherit from window 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 68da7d0ae5 Make briefing inherit from window 2020-09-21 03:18:12 +00:00
Kp f37dc9e947 Make title_screen inherit from window 2020-09-21 03:18:12 +00:00
Kp e068c685f4 Make scores_menu inherit from window 2020-09-21 03:18:12 +00:00
Kp f0ae880e83 Make gamebitmaps_viewer_window inherit from window 2020-09-21 03:18:12 +00:00
Kp 9f4886c56d Make polygon_models_viewer inherit from window 2020-09-21 03:18:12 +00:00
Kp 08701ca190 Store kmatrix_result in a uint8_t size enum 2020-09-21 03:18:12 +00:00
Kp b9f3e8a40a Remove unused UI_DIALOG fields 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 a069daae41 Remove unused DF_BORDER 2020-09-21 03:18:12 +00:00
Kp b40b48e6f9 Merge branch 'experimental/540/macos-no-framework' into master 2020-09-14 03:42:24 +00:00
Kp f0d3523128 Integrate MacOS no-framework mode into the general argument parser 2020-09-13 21:41:35 +00:00
Kreeblah 347f11e130
Merge 575b2eb111 into 7ded8fb6c5 2020-09-10 23:29:04 -07:00
Kp 7ded8fb6c5 Update issue template OS version lists 2020-09-11 03:08:03 +00:00
Kp 9c5f7b1248 Fix incorrect read length in D1 piggy_read_sounds
Reported-by: Kreeblah <https://github.com/dxx-rebirth/dxx-rebirth/issues/542>
Fixes: faf37e3c14 ("Always allocate D2-sized sound array")
2020-09-11 03:08:03 +00:00
Kp 969caa8c0c Add configure test to check for usable GL utility library
Rebirth built with OpenGL has a hard dependency on the GL utility
library, but did not have a configure time test to report this.  Add
one.

Reported-by: shoober420 <https://github.com/dxx-rebirth/dxx-rebirth/issues/468>
2020-09-11 03:08:02 +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
Kp 3ee3ac7b7a Delete multi_do_death
It is not needed.  Deathmatch players never lose their keys, so there is
no need to reapply them.
2020-09-11 03:08:02 +00:00
Kp 6a9444e5d6 Move some multiplayer functions into namespaces 2020-09-11 03:08:02 +00:00
Kp 61f186bc18 Use enum class for texture1_value 2020-09-11 03:08:02 +00:00
Kp 39cb42b878 Push partial_range construction to newmenu callers
In some cases, callers know the length of the range and can apply better
checks than the called code.
2020-09-11 03:08:02 +00:00
Kp e31d030caf Use zip for nm_messagebox_str 2020-09-11 03:08:02 +00:00
Kp 7de81a7293 Move Afterburner_charge to dsx 2020-09-11 03:08:02 +00:00
Kp 14a9657136 Use partial_range to store newmenu_item pointer/length 2020-09-11 03:08:02 +00:00
Kp c66a5276b7 Pass draw_item newmenu_item by reference 2020-09-11 03:08:02 +00:00
Kp e2204cc8e5 Rotate menu items in terms of ranges, not indexes 2020-09-11 03:08:02 +00:00
Kp 495e808f7b Factor out generating slider special characters
The same logic is used in two places.  Move it to a helper function, and
switch from repeated use of snprintf for one character at a time to
instead use fill_n.
2020-09-11 03:08:02 +00:00
Kp 18282d5b66 Move some menu code into namespaces 2020-09-11 03:08:02 +00:00
Kreeblah 575b2eb111
Don't include classic MacOS in the macOS file location info 2020-09-09 00:28:51 -07:00
Kreeblah 42903497ba
Added more specific instructions for data locations on macOS 2020-09-09 00:23:14 -07:00