diff --git a/source/games/blood/src/blood.cpp b/source/games/blood/src/blood.cpp index aa00efbe4..a90745598 100644 --- a/source/games/blood/src/blood.cpp +++ b/source/games/blood/src/blood.cpp @@ -552,9 +552,9 @@ void GameInterface::loadPalette(void) for (int i = 0; i < 5; i++) { - auto pal = fileSystem.LoadFile(PAL[i]); - if (pal.size() < 768) I_FatalError("%s: file too small", PAL[i]); - paletteSetColorTable(i, pal.data(), false, false); + auto pal = fileSystem.ReadFileFullName(PAL[i]); + if (pal.GetSize() < 768) I_FatalError("%s: file too small", PAL[i]); + paletteSetColorTable(i, (const uint8_t*)pal.GetMem(), false, false); } numshades = 64; @@ -566,13 +566,13 @@ void GameInterface::loadPalette(void) if (i < 15) I_FatalError("%s: file not found", PLU[i]); else continue; } - auto data = fileSystem.GetFileData(lump); - if (data.size() != 64 * 256) + auto data = fileSystem.ReadFile(lump); + if (data.GetSize() != 64 * 256) { if (i < 15) I_FatalError("%s: Incorrect PLU size", PLU[i]); else continue; } - lookups.setTable(i, data.data()); + lookups.setTable(i, (const uint8_t*)data.GetMem()); } lookups.setFadeColor(1, 255, 255, 255); diff --git a/source/games/duke/src/gamedef.cpp b/source/games/duke/src/gamedef.cpp index 3d9e1b924..5035c7b2c 100644 --- a/source/games/duke/src/gamedef.cpp +++ b/source/games/duke/src/gamedef.cpp @@ -118,7 +118,7 @@ struct TempMusic class ConCompiler { - char* textptr = nullptr; + const char* textptr = nullptr; int line_number = 0; int errorcount = 0, warningcount = 0; // was named 'error' and 'warning' which is too generic for public variables and may clash with other code. int currentsourcefile = -1; @@ -782,7 +782,7 @@ void ConCompiler::checkforkeyword() int ConCompiler::CountCaseStatements() { int lCount; - char* temptextptr; + const char* temptextptr; int savescript; int savecase; int temp_line_number; @@ -1079,7 +1079,7 @@ int ConCompiler::parsecommand() return 0; } - auto data = fileSystem.GetFileData(fni, 1); + auto data = fileSystem.ReadFile(fni); temp_current_file = currentsourcefile; currentsourcefile = fni; @@ -1089,7 +1089,7 @@ int ConCompiler::parsecommand() temp_ifelse_check = checking_ifelse; checking_ifelse = 0; auto origtptr = textptr; - textptr = (char*)data.data(); + textptr = data.GetString(); do done = parsecommand(); @@ -3106,8 +3106,8 @@ void ConCompiler::compilecon(const char *filenam) I_FatalError("%s: Missing con file(s).", filenam); } Printf("Compiling: '%s'.\n", filenam); - auto data = fileSystem.GetFileData(currentsourcefile, 1); - textptr = (char*)data.data(); + auto data = fileSystem.ReadFile(currentsourcefile); + textptr = data.GetString(); line_number = 1; errorcount = warningcount = 0; diff --git a/source/games/exhumed/src/sound.cpp b/source/games/exhumed/src/sound.cpp index 7adb28d5a..b9c1a5979 100644 --- a/source/games/exhumed/src/sound.cpp +++ b/source/games/exhumed/src/sound.cpp @@ -175,9 +175,9 @@ int LoadSound(const char* name) auto lump = S_LookupSound(filename); if (lump > 0) { - auto check = fileSystem.GetFileData(lump); + auto check = fileSystem.ReadFile(lump); bool loops = false; - if (check.size() > 26 && check[26] == 6 && !memcmp("Creative Voice File", check.data(), 19)) + if (check.GetSize() > 26 && check.GetString()[26] == 6 && !memcmp("Creative Voice File", check.GetString(), 19)) { // This game uses the actual loop point information in the sound data as its only means to check if a sound is looped. loops = true; diff --git a/source/games/sw/src/colormap.cpp b/source/games/sw/src/colormap.cpp index 81e522687..bbf8312b4 100644 --- a/source/games/sw/src/colormap.cpp +++ b/source/games/sw/src/colormap.cpp @@ -231,15 +231,20 @@ void GameInterface::loadPalette(void) unsigned int i; int play; uint8_t tempbuf[256]; + uint8_t pal[768]; paletteLoadFromDisk(); - auto pal = fileSystem.LoadFile("3drealms.pal", 0); - if (pal.size() >= 768) + auto palr = fileSystem.OpenFileReader("3drealms.pal"); + if (palr.isOpen()) { - for (auto& c : pal) - c <<= 2; + auto siz = palr.Read(pal, 768); + if (siz == 768) + { + for (auto& c : pal) + c <<= 2; - paletteSetColorTable(DREALMSPAL, pal.data(), true, true); + paletteSetColorTable(DREALMSPAL, pal, true, true); + } }