18 Commits
Author SHA1 Message Date
Gleb Mazovetskiy e5881688f4 text_render: Replace optional args with struct
4 options args are a bit unwieldy, especially when you want
to pass only the first and the last one.

With a struct, there is no need to specify the default values
for the args in between.
2023-10-25 09:19:14 +01:00
Gleb Mazovetskiy 8c1a847f41 Remove utils/stdcompat/string_view.hpp 2023-08-14 09:59:14 +01:00
Gleb Mazovetskiy 14540164a7 Remove utils/stdcompat/optional.hpp 2023-08-14 01:54:29 +01:00
Gleb Mazovetskiy 5bf0b8bc96 Add more missing <cstdint> includes
https://github.com/diasurgical/devilutionX/pull/6095 only added includes
for `uint32_t`, this PR also adds the includes for the remaining
integral types.
2023-05-10 16:29:27 +01:00
ephphatha 829d6b0d4a address clang-format violations 2023-04-16 08:44:22 +02:00
ephphatha 2ce420425e Remake talkbutton.clx as a sheet of two sprites 2023-04-16 08:44:22 +02:00
ephphatha a9f9e2b451 Unroll loop for building alt button states to allow optimising talkbutton.clx 2023-04-16 08:44:22 +02:00
Gleb Mazovetskiy c351acbf7e Remove redundant devilutionx.mpq check
We now check it only once in `CheckArchivesUpToDate`.
We then use `LoadClx` instead of `LoadOptionalClx` throughout.
2022-08-04 15:16:00 +02:00
Gleb Mazovetskiy d71a54dba8 Render main panel buttons as CLX
Converted with:

```
pcx2clx --num-sprites 3 data/talkbutton.pcx && rm data/talkbutton.pcx
```

Sizes:

```
Surface(63, 114) -> CLX	7296 -> 5336	-26.9%
Surface(53, 48) -> CLX	2688 -> 2324	-13.5%
```
2022-08-04 15:16:00 +02:00
Gleb Mazovetskiy 609b711d32 Render char panel as CLX
Converted with:
```
pcx2clx --num-sprites 6 data/panel8bucp.pcx && rm data/panel8bucp.pcx
```

Size: 112640 -> 93215 bytes, -17.2%
2022-08-04 15:16:00 +02:00
Gleb Mazovetskiy 17a97450bc Convert assets to CLX
Converted using the following commands:

```
cd Packaging/resources/assets
pcx2clx --transparent-color 1 --num-sprites 256 fonts/*.pcx && rm fonts/*.pcx
pcx2clx --num-sprites 2 ui_art/dvl_but_sml.pcx && rm ui_art/dvl_but_sml.pcx
pcx2clx --transparent-color 1 data/hintbox.pcx data/hintboxbackground.pcx && rm data/hintbox.pcx data/hintboxbackground.pcx
pcx2clx --transparent-color 1 --num-sprites 6 data/hinticons.pcx && rm data/hinticons.pcx
pcx2clx --num-sprites 2 data/panel8buc.pcx data/dirtybuc.pcx data/dirtybucp.pcx && rm data/panel8buc.pcx data/dirtybuc.pcx data/dirtybucp.pcx
pcx2clx --transparent-color 1 data/healthbox.pcx && rm data/healthbox.pcx
pcx2clx --transparent-color 1 --num-sprites 6 data/resistance.pcx && rm data/resistance.pcx
pcx2clx --transparent-color 1 --num-sprites 5 data/monstertags.pcx && rm data/monstertags.pcx
pcx2clx --transparent-color 1 data/stash.pcx && rm data/stash.pcx
pcx2clx --transparent-color 1 --num-sprites 5 data/stashnavbtns.pcx && rm data/stashnavbtns.pcx
pcx2clx **/*.pcx && rm **/*.pcx
git checkout master -- ui_art/black_diablo.pcx ui_art/black_hellfire.pcx data/charbg.pcx data/talkbutton.pcx data/panel8bucp.pcx
rm ui_art/black_diablo.clx ui_art/black_hellfire.clx data/charbg.clx data/talkbutton.clx data/panel8bucp.clx
```
2022-08-03 16:37:04 +02:00
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.
2022-08-03 02:38:55 +02:00
Gleb Mazovetskiy 8ca71272b8 Load all CEL as CL2
Convert CEL files to CL2 at load time. CL2 format is more efficient and is about as fast to render.

CEL vs CL2 sizes, on dLvl 5: https://gist.github.com/glebm/9bbdd76962abcd4fd2405ecd3379af97

Memory:

* Peak memory (while loading): -300 KiB
* Memory in-game (dLvl5): -700 KiB
* RG99 binary size: -15 KiB (1333096 -> 1317192)

Performance on rg99:

* On average, -1 FPS in town.
* Same FPS in dungeon (20 FPS on dLvl 1).
2022-07-19 10:59:35 +02:00
obligaron bc15bdf3a9 Remove PANEL_ defines and replace them with GetMainPanel() 2022-05-29 20:20:44 +02:00
Anders Jenbo 1409e604f5 Reduce string conversions 2022-03-20 11:04:15 +01:00
Anders Jenbo 704a04ae4d Add support for Unicode fonts 2021-09-24 03:03:58 +02:00
qndel 0569dba547 fix typos 2021-09-19 10:14:06 +01:00
Anders Jenbo 7771a08d03 Translatable mainpanel 2021-09-19 07:21:52 +02:00