did some cleanup of the FResourceFile interface.

* making all members protected (but adding friend overrides for the classes which still need it)
* allowing to read data without retrieving the FResourceLump object.
This commit is contained in:
Christoph Oelckers 2023-12-10 10:22:07 +01:00
commit ebc808e2a9
12 changed files with 128 additions and 92 deletions

View file

@ -76,15 +76,15 @@ void FSavegameManager::ReadSaveStrings()
{
bool oldVer = false;
bool missing = false;
auto info = savegame->FindLump("info.json");
if (info == nullptr)
auto info = savegame->FindEntry("info.json");
if (info < 0)
{
// savegame info not found. This is not a savegame so leave it alone.
continue;
}
void *data = info->Lock();
auto data = savegame->Read(info);
FSerializer arc;
if (arc.OpenReader((const char *)data, info->LumpSize))
if (arc.OpenReader((const char*)data.data(), data.size()))
{
int savever = 0;
arc("Save Version", savever);