♻️Typed file loading

Tthis gives us the option to specify what type a file should be loaded
as, avoidng the need to case it and does some automatic checks on the
fitness of the data, while making the process simpler.

If no type is given then the type will be set to std::byte which limit
what operations can be performed on the data.
This commit is contained in:
Anders Jenbo 2021-05-03 18:36:13 +02:00
commit fa0b286693
27 changed files with 670 additions and 798 deletions

View file

@ -894,14 +894,14 @@ void MakeLightTable()
}
{
auto trn = LoadFileInMem("PlrGFX\\Infra.TRN");
auto trn = LoadFileInMem<BYTE>("PlrGFX\\Infra.TRN");
for (i = 0; i < 256; i++) {
*tbl++ = trn[i];
}
}
{
auto trn = LoadFileInMem("PlrGFX\\Stone.TRN");
auto trn = LoadFileInMem<BYTE>("PlrGFX\\Stone.TRN");
for (i = 0; i < 256; i++) {
*tbl++ = trn[i];
}