Gleb Mazovetskiy
8c1a847f41
Remove utils/stdcompat/string_view.hpp
3 years ago
Gleb Mazovetskiy
4cf0053ece
Set underlying type for all the enums
...
Reduces rg99 binary size by 3 KiB.
4 years ago
Gleb Mazovetskiy
9b65eca49b
Remove `Art` and related functions
4 years ago
Gleb Mazovetskiy
961866e1c4
CLX: A new graphics format
...
The format is almost identical to CL2, except it uses the frame header
to store frame width and height instead of 5 32-line offsets.
This means we always have access to frame dimensions, so we can use it
as an on-disk format for our graphics as well.
Additionally, we may be able to optimize the rendering even more
in the future now that we have guaranteed knowledge of frame dimensions.
4 years ago
Gleb Mazovetskiy
0cd035ef61
Load PCX as CL2
...
Similar to #5059 , which converted CEL to CL2 at load time,
we now do the same for PCX.
Some size stats: https://gist.github.com/glebm/067bf1ec73f9d14514932cfe237e4e8e
Notably, fonts RAM usage is decreased by ~35%.
4 years ago
Cesar Canassa
e538acb248
📝 Fixes Doxygen warnings ( #4904 )
4 years ago
Gleb Mazovetskiy
0c7e36e81a
DiabloUI: Clean up portrait loading
...
1. Load portraits as PCX (~30% smaller).
2. Simplify the portrait override logic.
4 years ago
Gleb Mazovetskiy
8514cc80a9
Migrate embedded button data to PCX
...
It is a bit smaller that way.
Also renders the non-embedded dialogs as PCX.
The embedded dialog is still raw pixel data because it is larger as PCX.
4 years ago
Gleb Mazovetskiy
5df03f56e3
DiabloUI: Render scrollbar as PCX
4 years ago
Gleb Mazovetskiy
9e9b656b88
DiabloUI: Render backgrounds as PCX
...
The backgrounds can be quite large, for example
the Hellfire title background is a 2.4 MiB PCX file.
Previously, we converted all background to SDL surfaces.
This required extra memory, e.g. the 2.4 MiB Hellfire
title background uses 4.6 MiB as an SDL surface.
Changes the background to render directly from PCX instead
to reduce the allocator pressure.
4 years ago
Gleb Mazovetskiy
c2917b1dc8
DiabloUi: Load animated PCX sprites as CEL
...
Reduces memory usage in menu (and thus the overall allocator pressure)
4 years ago
staphen
90132b23cc
Fix viewport size of UiList in constructor
4 years ago
Bubio
9574fb30fe
FIX: Selecting Quit Game opens into the Support menu #4334
4 years ago
ephphatha
5d3f161e7b
Use string_view for UiEdit hint
...
Now that platforms with C APIs have been updated to take string_views in the C++ wrappers
4 years ago
Anders Jenbo
1409e604f5
Reduce string conversions
4 years ago
ephphatha
88d9d0ffab
Use string_view for UiArtTextButton, UiButton
4 years ago
Andrew James
5046b1288d
Apply clang-tidy configuration to (some of) ui_item.h ( #3719 )
4 years ago
obligaron
721e05d5e0
Add DrawStringWithColors support to UiListItem
4 years ago
Gleb Mazovetskiy
c57644970f
Move `UiFlags` and `UiPanels` into their own files
...
The first breaks circular dependency between `DiabloUI` and `text_render`.
The latter one moves `UiPanels` to a more appropriate place.
4 years ago
obligaron
78c0ec1f49
Pass viewportSize to UiList constructor and calculate height from it
4 years ago
Gleb Mazovetskiy
7e1fea6f76
clang-format all files in {Source,test}/
...
Also includes a few manual tweaks to comments and newlines for better results.
Co-authored-by: Anders Jenbo <anders@jenbo.dk>
4 years ago
obligaron
55dea2e39e
Introduce UiFlags::NeedsNextElement
4 years ago
obligaron
918122ecb1
UiListItem can have individual UiFlags
4 years ago
staphen
ffbbcc6d62
Support unencrypted multiplayer games with no password
4 years ago
ephphatha
a13cb6ec7e
Providing a basic template specialisation approach to using enums as flags only for certain types.
...
Now hopefully works with GCC 6?
4 years ago
Gleb Mazovetskiy
ff9affa513
Fix a couple of noisy MSVC warnings
5 years ago
Anders Jenbo
4dd8b121ec
Replace TTF with PCX font
5 years ago
Anders Jenbo
7771a08d03
Translatable mainpanel
5 years ago
Anders Jenbo
7169882b1f
✨ Implement new font rendering
5 years ago
Aaron Sun
3ee90ca629
Add options for sub-panel alignment
5 years ago
ephphatha
8930b789d6
Rename UiType members to follow naming convention
...
Convention seems to be that scrollbar is treated as a single unhyphenated word so the UiScrollbar class was renamed to match.
5 years ago
ephphatha
0575716eac
Rename UiFlags members to group related options
5 years ago
ephphatha
bd140142c3
Convert UiType to a scoped enum
5 years ago
ephphatha
7d93cada67
Refactor UiItemBase and derived types to reduce duplicate constructors
...
Using optional arguments where possible so that all use cases can share the same constructor. Also moving member initialisation to the initialiser list syntax as this makes it clear that the derived class is only setting properties on that class, leaving the parent constructor to initialise members of the parent class.
5 years ago
ephphatha
4ad53232a0
Convert the UiFlags enum to a scoped enum type
...
Replace operator&& with named function
5 years ago
Anders Jenbo
a19e7b2a3b
Remove some more use of miniwin
5 years ago
obligaron
1956c6a1c2
Fix some 64bit warnings
5 years ago
obligaron
91fe708e8f
Fix warnings in ui_item.h
5 years ago
Vladimir Olteanu
ed9b105299
DiabloUI: make UiArtText follow mutating char*
5 years ago
Vladimir Olteanu
c57560674e
Use smart pointers for UI items
...
vector::push_back(new Foo(...)) leaks if resizing fails
5 years ago
staphen
9ca9de3eba
Add virtual keyboard hints and 3DS keyboard improvements
5 years ago
thebigMuh
7fbcfeb35c
Adding text rendering flag to adjust spacing to fit horizontally
...
Now also works for multiline strings
5 years ago
Anders Jenbo
68923c6c33
✨ Generic game text render function
...
This should gradually replace all the direct rendering of game texts
throughout the code. The interface is made to closly mirror that of the
art fonts as that is what will eventually be used for rendering Unicode
fonts both in the menus and ingame.
fixup! ✨ Generic game text render function
5 years ago
Gleb Mazovetskiy
295b5bce81
🧹 DiabloUI: Clean up text render cache
...
Cleans up the handling of text render cache for `UiText` and `UiButton`.
This also happens to fix a memory leak (`FreeCache` was never called).
5 years ago
Anders Jenbo
8c821e98d3
🚚 Restructure files
5 years ago
Anders Jenbo
6e1a106a38
🚚 Move header we implement into the project
5 years ago
Anders Jenbo
819fd40376
🎨 Consistent enum value style ( #1458 )
5 years ago
Anders Jenbo
e7ae8ddd04
🚚 Move all enums to there respective headers
5 years ago
Anders Jenbo
bfb3c11c2b
🎨 Change namespace to devilution
5 years ago
Anders Jenbo
4e8843ee7c
Implement most of the Hellfire menu
...
Still missing is the support screen (functionally identical to the
credit screen)
This also fixes a long standing issue with the menu code where it would
some times return the index and some times the value of the selected
menu item. It now always returns the index and reciver must look up the
value.
6 years ago