10 Commits
Author SHA1 Message Date
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
Anders Jenbo dc2d97c112 Split lighting shades from trn tables 2023-04-21 07:40:19 +02:00
Gleb Mazovetskiy 9db80ef5d7 Assets: Load files directly for UNPACKED_MPQS
When using `UNPACKED_MPQS`, avoid all the SDL machinery for reading
files.

This is beneficial not only due to reduced indirection but also because
we can test for the file's existence and get the file size without
opening it, which is much faster.
2022-11-22 02:44:25 +01:00
Gleb Mazovetskiy 41f43ea3f5 Support unpacked MPQs from devilutionx-mpq-tools
https://github.com/diasurgical/devilutionx-mpq-tools produces an unpacked MPQ
with all the graphics converted to CLX and the unused files removed.
This is primarily useful on RAM-constrained platforms, such as PS2,
because it eliminates the MPQ overhead.

Adds a build option to load from such unpacked directories instead of the MPQ.

These directories are searched for in the same locations
where the MPQs would be searched for otherwise.

Example directory layout:

* /usr/local/share/diasurgical/devilutionx/diabdat/ -- unpacked and converted diabdat.mpq
* /usr/local/share/diasurgical/devilutionx/hellfire/ -- unpacked and converted hellfire MPQs (all of them merged into 1 directory)
* /usr/local/share/diasurgical/devilutionx/fonts/ -- unpacked fonts.mpq
* /usr/local/share/diasurgical/devilutionx/pl/ -- unpacked pl.mpq

These directory structure is produced by calling `unpack_and_minify_mpq`
2022-10-11 18:00:57 +01: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 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%.
2022-07-20 22:58:15 +01:00
Gleb Mazovetskiy 0c7e36e81a DiabloUI: Clean up portrait loading
1. Load portraits as PCX (~30% smaller).
2. Simplify the portrait override logic.
2022-07-01 16:15:40 +01:00
Gleb Mazovetskiy de10b96bfb Fix PCX LoadFrameOffsets 2022-06-19 12:32:00 +02:00
Gleb Mazovetskiy c380c7fa61 PCX: Add transparency support 2022-06-13 09:54:01 +01:00
Gleb Mazovetskiy 220d38aa5c Direct PCX rendering 2022-06-13 09:54:01 +01:00