Commit Graph
27 Commits
Author SHA1 Message Date
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
2022-07-01 00:54:22 +02:00
Gleb Mazovetskiy ede7eab7e8 Fix -wnarrowing from SDL_Rect construction 2022-06-15 11:12:42 +01:00
Gleb Mazovetskiy 779ccaca17 Overhaul translation fetching
1. Do not modify the map after loading. Instead, return string views
   (guaranteed to be null-terminated) from look up functions and return
   the key directly if not found.
2. Use an `unorded_map` instead of `map` where available (C++20).
   Saves a bit of RAM (~50 KiB) and improves lookup performance.
2022-06-14 12:46:36 +01:00
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.
2022-06-13 09:54:01 +01:00
obligaron d86c4e5d84 Introduce GetUIRectangle() to distinguish between UI and main panel 2022-05-29 20:20:44 +02:00
Gleb Mazovetskiy c2917b1dc8 DiabloUi: Load animated PCX sprites as CEL
Reduces memory usage in menu (and thus the overall allocator pressure)
2022-04-25 05:31:26 +01:00
Anders Jenbo 1409e604f5 Reduce string conversions 2022-03-20 11:04:15 +01:00
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)
2021-12-28 04:34:26 +01:00
staphen 74a77666b9 Improve behavior of ToControllerButtonEvent() 2021-12-24 23:08:41 +01:00
Adam Heinermann 1484b4d8cf Implement Discord rich presence (#3711) 2021-12-15 17:14:17 +01:00
obligaron b5ab9758d0 Replace gbSpawned with gbIsSpawn 2021-12-02 01:08:33 +01:00
Anders Jenbo 7771a08d03 Translatable mainpanel 2021-09-19 07:21:52 +02:00
Anders Jenbo 7169882b1f ✨ Implement new font rendering 2021-09-12 01:37:28 +02:00
ephphatha 0575716eac Rename UiFlags members to group related options 2021-07-31 20:22:40 +02:00
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.
2021-07-31 20:22:40 +02:00
ephphatha 4ad53232a0 Convert the UiFlags enum to a scoped enum type
Replace operator&& with named function
2021-07-31 20:22:40 +02:00
Vladimir Olteanu c57560674e Use smart pointers for UI items
vector::push_back(new Foo(...)) leaks if resizing fails
2021-07-08 03:37:47 -07:00
Anders Jenbo de4ced7e4f Clang-tidy: readability-qualified-auto 2021-06-27 00:56:08 +02:00
Anders Jenbo e3526a5ff6 🌐 Convert all src to UTF8 2021-04-28 01:58:00 +02:00
Anders Jenbo dbfa9c27a5 ✨ Enable translation for all menus 2021-04-25 06:55:11 +02:00
Anders Jenbo cc164985a3 🎨 Correct type checks in src sub-folder 2021-04-22 20:33:24 +02:00
Anders Jenbo 191d98207b 🎨 readability-identifier-naming on DiabloUI 2021-04-22 00:50:07 +02:00
Anders Jenbo d846a30157 🧹 acceptable parts of bugprone-* 2021-04-22 00:08:19 +02:00
Anders Jenbo 373f28736f 🎨 Acceptable parts of modernize-* 2021-04-19 22:42:19 +02:00
Anders Jenbo b978d80119 🎨 llvm-include-order 2021-04-19 20:11:20 +02:00
Gleb Mazovetskiy e92cf9d7c8 🧹 DiabloUI/title.cpp: Move to anonymous namespace 2021-04-17 13:37:04 +02:00
Anders Jenbo 8c821e98d3 🚚 Restructure files 2021-04-16 03:57:22 +02:00