From 7d0ad4897f73753bc7b2fd7d9e769a31b2e2ee32 Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Sun, 10 Dec 2023 10:32:16 +0100 Subject: [PATCH] use proper access functions to ResourceData. --- src/common/fonts/hexfont.cpp | 2 +- src/common/menu/savegamemanager.cpp | 2 +- src/g_game.cpp | 4 ++-- src/menu/loadsavemenu.cpp | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/common/fonts/hexfont.cpp b/src/common/fonts/hexfont.cpp index d8aa4db0ad..6a788c001e 100644 --- a/src/common/fonts/hexfont.cpp +++ b/src/common/fonts/hexfont.cpp @@ -63,7 +63,7 @@ struct HexDataSource FScanner sc; auto data = resf->Read(index); - sc.OpenMem("newconsolefont.hex", (const char*)data.data(), data.size()); + sc.OpenMem("newconsolefont.hex", data.string(), data.size()); sc.SetCMode(true); glyphdata.Push(0); // ensure that index 0 can be used as 'not present'. while (sc.GetString()) diff --git a/src/common/menu/savegamemanager.cpp b/src/common/menu/savegamemanager.cpp index 942a47e73b..4682be7f27 100644 --- a/src/common/menu/savegamemanager.cpp +++ b/src/common/menu/savegamemanager.cpp @@ -306,7 +306,7 @@ unsigned FSavegameManagerBase::ExtractSaveData(int index) auto data = resf->Read(info); FSerializer arc; - if (!arc.OpenReader((const char*)data.data(), data.size())) + if (!arc.OpenReader(data.string(), data.size())) { return index; } diff --git a/src/g_game.cpp b/src/g_game.cpp index 77be536dea..c731993b11 100644 --- a/src/g_game.cpp +++ b/src/g_game.cpp @@ -2013,7 +2013,7 @@ void G_DoLoadGame () auto data = resfile->Read(info); FSerializer arc; - if (!arc.OpenReader((char*)data.data(), data.size())) + if (!arc.OpenReader(data.string(), data.size())) { LoadGameError("TXT_FAILEDTOREADSG"); return; @@ -2088,7 +2088,7 @@ void G_DoLoadGame () } data = resfile->Read(info); - if (!arc.OpenReader((char*)data.data(), data.size())) + if (!arc.OpenReader(data.string(), data.size())) { LoadGameError("TXT_SGINFOERR"); return; diff --git a/src/menu/loadsavemenu.cpp b/src/menu/loadsavemenu.cpp index 3bf2a87c2a..331575737e 100644 --- a/src/menu/loadsavemenu.cpp +++ b/src/menu/loadsavemenu.cpp @@ -84,7 +84,7 @@ void FSavegameManager::ReadSaveStrings() } auto data = savegame->Read(info); FSerializer arc; - if (arc.OpenReader((const char*)data.data(), data.size())) + if (arc.OpenReader(data.string(), data.size())) { int savever = 0; arc("Save Version", savever);