Gleb Mazovetskiy
7e582a5840
DiabloUi: Render focus indicators as PCX
...
They're slightly larger as PCX then CEL but are tiny overall.
This was the last use of `LoadPcxAssetAsCel`.
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
7a58f800f4
DiabloUI: Clean up logo handling ( #4830 )
...
1. There is no small logo. Simply use 2 variables.
2. The medium logo is much smaller as PCX:
* Hellfire (`ui_art\hf_logo2.pcx`): 1591816 bytes -> 195850 bytes
* Diablo (`ui_art\smlogo.pcx`): 341923 bytes -> 333099 bytes
* Move `ArtLogoBig` to `title.cpp`
It is only ever used there
4 years ago
Anders Jenbo
72656b3011
Move path and palette to the engine folder
4 years ago
Anders Jenbo
99181fd709
Move more files to the engine folder
4 years ago
Gleb Mazovetskiy
8e9c9e0238
Reduced the size of `OwnedCelSprite*` by 8 bytes
...
`OwnedCelSpriteWithFrameHeight`: 40 -> 32
4 years ago
Andrew James
13a3424ff0
Add helpers for creating/using Rectangles in UI contexts ( #4734 )
...
* Add MakeRectangle helper to convert from SDL_Rect
* Add Rectangle::inset method for shrinking a rectangle
Turns out some of the other use cases I though this could apply to were actually doing something based on a fixed region
* Simplify initialisation of settings menu rects
4 years ago
ephphatha
e246ac78db
Simplify character test in UiValidPlayerName
4 years ago
ephphatha
771beeb82d
Use string_view for UiValidPlayerName
4 years ago
Gleb Mazovetskiy
f22d1d0149
Remove uses of deprecated codecvt
...
codecvt is deprecated in C++17 and we don't really need all of its heavy
machinery for simply converting to UTF-8.
4 years ago
Gleb Mazovetskiy
2386fd12a9
Fix a few warnings
4 years ago
Gleb Mazovetskiy
ede7eab7e8
Fix `-wnarrowing` from `SDL_Rect` construction
4 years ago
Gleb Mazovetskiy
c380c7fa61
PCX: Add transparency support
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
staphen
56e8dbfec5
Apply CopyUtf8() to SelheroCatToName()
4 years ago
obligaron
d86c4e5d84
Introduce GetUIRectangle() to distinguish between UI and main panel
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
Gleb Mazovetskiy
21c64fd0af
Hardware cursor: Simplify initialization
...
Set the palette at load time.
Since we only support hardware cursors in SDL2, we can take advantage of
its reference-counted palettes.
4 years ago
Bubio
9574fb30fe
FIX: Selecting Quit Game opens into the Support menu #4334
4 years ago
Gleb Mazovetskiy
79c7eee10a
Mouse/Gamepad fixes
...
Introduces a `ControlDevice` global which is distinct from `ControlMode`
in that it is set to `Gamepad` even when simulating a mouse.
This allows us to avoid a number of edge cases related to mode changes.
Fixes #4242
4 years ago
Gleb Mazovetskiy
543f988cc3
Fix hardware cursor initialization
...
Hardware cursor should get initialized even for non mouse control types
(e.g. `ControlTypes::None`), because by the time the control type gets
initialized or changes the cursor is already set up and won't change.
Fixes #4233
4 years ago
ephphatha
f9ce2108f6
Use string_view for switch keyboard input
4 years ago
staphen
df830f6495
Save settings before leaving the settings menu
4 years ago
staphen
e0a3c553b4
Add window focus logic for SDL1
4 years ago
staphen
470c8c47f4
Force unpause when window focus gained in UI menus
4 years ago
obligaron
1fc40aa211
DiabloUI: Fix Handling of UiFlags::NeedsNextElement
4 years ago
Anders Jenbo
b0252b3339
Make Gamepad cursor independant of hardware mouse
...
The gamepad cursor (inventory, spells etc) no longer relies on warping a
real mouse cursor. This should make things work better on platforms that
do not support this, like Wayland.
4 years ago
Anders Jenbo
6b2481a76c
Touch support on all SDL2 platforms
4 years ago
ephphatha
1abc617e1a
Consistently trigger menu/movie transitions on mouse up instead of down
...
Keypresses still occur on keydown to allow for repetition (e.g. when scrolling)
4 years ago
Bubio
d1315e934a
Fixed issue #3788
4 years ago
staphen
74a77666b9
Improve behavior of ToControllerButtonEvent()
4 years ago
obligaron
18fb40ee32
Settingsmenu: Implement KeyInput
4 years ago
staphen
af59f7e254
Update fullscreen option in settings menu after Alt+Enter
4 years ago
Anders Jenbo
cf9b5ae79d
Split up graphics settings initializers
4 years ago
Adam Heinermann
1484b4d8cf
Implement Discord rich presence ( #3711 )
4 years ago
Gleb Mazovetskiy
401d0ff33f
DiabloUI: Handle mouse wheel in SDL 1.2
4 years ago
obligaron
467ed9dd9d
Fix page down/up don't wrap in settingsmenu
4 years ago
Andrew James
5046b1288d
Apply clang-tidy configuration to (some of) ui_item.h ( #3719 )
4 years ago
obligaron
8a235186f2
Settingsmenu: Clean up UI-Resources before switching options that require RecreateUI
4 years ago
obligaron
b5ab9758d0
Replace gbSpawned with gbIsSpawn
4 years ago
obligaron
721e05d5e0
Add DrawStringWithColors support to UiListItem
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
5b43d047c6
UiListItem support disabled elements
4 years ago
obligaron
918122ecb1
UiListItem can have individual UiFlags
4 years ago
obligaron
adfdb1e54f
Refactored UiList ViewPort Logic
4 years ago
Anders Jenbo
799f1763af
Performce UTF8 aware limited string copies
4 years ago
Gleb Mazovetskiy
b8affd5fe5
Fix a few build warnings
4 years ago