1. Creates the missing `shared-dl` directory.
2. Unsets some environment variables that interfere with buildroot.
3. Disables `BR2_PER_PACKAGE_DIRECTORIES`, which prevented us
from using the partial sysroot build.
Also documents the `TOOLCHAIN=...` option in docs/building.md.
With this, we no longer require `std::filesystem` support to create the
save file directory when it does not exist.
Note that by default the save file directory exists because it is
created by SDL, so this is mostly useful on platforms that override the
save directory or use `UNPACKED_SAVES`.
From GCC documentation:
> Perform interprocedural pointer analysis and interprocedural modification and reference analysis.
> This option can cause excessive memory and compile-time usage on large compilation units.
> It is not enabled by default at any optimization level.
Also forces the CMake generation to `make` because `ninja` gets into an
infinite loop for some reason on my laptop.
A PGO'd binary can be built as follows:
1. Build with `-DDEVILUTIONX_PROFILE_GENERATE=ON`.
3. Run the timedemo.
4. Build with `-DDEVILUTIONX_PROFILE_USE=ON`.
By default, the profile directory is at `${HOME}/devilutionx-profile`
Example for the RG99:
```bash
# Build the OPK for profiling data collection:
TOOLCHAIN=/opt/rs90-toolchain Packaging/OpenDingux/build.sh rg99 --profile-generate
# Copy the OPK to RG99:
scp -O build-rg99/devilutionx-rg99.opk rg99:/media/sdcard/apps
# Now, run the OPK. It will run the timedemo instead of the actual game and will take a couple of hours.
# ☕☕☕
# Copy the profiling data from RG99
scp -r -O rg99:/media/data/local/home/devilutionx-profile /tmp/devilutionx-profile
# Build the OPK use the collected profiling data:
TOOLCHAIN=/opt/rs90-toolchain Packaging/OpenDingux/build.sh rg99 --profile-use --profile-dir /tmp/devilutionx-profile
# Copy the resulting binary back to RG99
scp -O build-rg99/devilutionx-rg99.opk rg99:/media/sdcard/apps
```
`-O2` increases the binary size by 0.5 MiB which we can now afford.
Increasing buffer size to `768` improves performance (seems to be the
sweet spot).
15-20 FPS in dungeon on the max-mem OD fork.
87x2262 -> 1131x174
This makes the file smaller and also makes the texture fit
on devices with 2048x2048 max texture size (Fixes#5403).
`button.png` updated with:
convert -crop 87x174 button.png +append out.png
optipng -o9 out.png
mv out.png button.png
We want to be able to use unpacked MPQs on low-end platforms
(PS2/rg99/etc).
This is tricky on case-sensitive filesystems. Avoids case issues by
lowercasing all paths in the code (then we'll just need lowercased
listfiles).