8 Commits

Author SHA1 Message Date
Jan Engelhardt
a84408d5fc ui: cure UBSAN warning about cast in UIStatic::SetTitle
```
ui/UIStatic.cpp:113:15: runtime error: downcast of address 0x7b9f03ae6a00 which does not point to an object of type 'UIPrimativeItem'
0x7b9f03ae6a00: note: object is of type 'UITextItem'
 00 00 00 00  d0 f9 57 02 00 00 00 00  ff be be be 00 ff 00 00  03 00 00 00 be be be be  70 64 dd 02
              ^~~~~~~~~~~~~~~~~~~~~~~
              vptr for 'UITextItem'

[lines as per 51fb3fea609e81d3897c33d901dce0b7be68c082; ±1 line]
f0  UIStatic::SetTitle (this=0x7ccff4a8b200, item=0x7bfff384a030) at ui/UIStatic.cpp:113
f1  newuiSheet::UpdateChanges (this=0x7bfff3a8ee38) at Descent3/newui_core.cpp:1721
f2  newuiMenu::DoUI (this=0x7bfff3a8e4c0) at Descent3/newui_core.cpp:921
f3  OptionsMenu () at Descent3/config.cpp:1432
f4  MainMenu () at Descent3/menu.cpp:837
f5  MainLoop () at Descent3/descent.cpp:541
f6  Descent3 () at Descent3/descent.cpp:503
f7  oeD3LnxApp::run (this=0x7bfff3901050) at Descent3/sdlmain.cpp:142
f8  main (argc=1, argv=0x7fffffffdae8) at Descent3/sdlmain.cpp:322
```

In `SetTitle`, `CopyUIItem()` returns a `UIItem *` backed by the same class
that `item` is, which is not guaranteed to be a UIPrimativeItem object. That
guarantee only holds in the `SetBackground` function.

Fixes: df209742fc (bogus cast added)
Fixes: 51fb3fea60 (added UITextItem in the options dialog)
2025-05-27 00:28:01 +02:00
Jan Engelhardt
9687cd5e27 ui: delete empty function bodies 2024-11-03 23:39:38 +01:00
Jan Engelhardt
a6d37b68e5 ui: replace in-constructor assignments by initializations 2024-11-03 23:39:37 +01:00
Azamat H. Hackimov
87882c9976 Isolate ui submodule
Isolate ui from rest of the project, minor cleanups.
2024-07-28 16:50:41 +03:00
JeodC
a4ab78192c Join license header with historical commentrs
Join the license header with historical comments using a separator so IDEs can correctly parse the initial header.

Also use .gitattributes to ensure all files are LF.
2024-05-08 14:41:19 -04:00
Kevin Bentley
1f45163248 Updated source to reflect the license that this code is released under. 2024-04-20 09:57:49 -06:00
Kevin Bentley
c6640cc631 clang-format on everything. 2024-04-16 12:56:40 -06:00
Kevin Bentley
df209742fc Initial import 2024-04-15 21:43:29 -06:00