cleaned up some redundant file reads and fixed file opening in the movie player.

As a streaming action this cannot borrow the one from the archive.
This commit is contained in:
Christoph Oelckers 2023-12-13 16:56:47 +01:00
commit df3e82d94c
10 changed files with 31 additions and 17 deletions

View file

@ -89,7 +89,6 @@ void FShaderProgram::Compile(ShaderType type, const char *lumpName, const char *
{
int lump = fileSystem.CheckNumForFullName(lumpName);
if (lump == -1) I_FatalError("Unable to load '%s'", lumpName);
auto sp = fileSystem.ReadFile(lump);
FString code = GetStringFromLump(lump);
Compile(type, lumpName, code, defines, maxGlslVersion);

View file

@ -383,11 +383,9 @@ bool FShader::Load(const char * name, const char * vert_prog_lump_, const char *
int vp_lump = fileSystem.CheckNumForFullName(vert_prog_lump.GetChars(), 0);
if (vp_lump == -1) I_Error("Unable to load '%s'", vert_prog_lump.GetChars());
auto vp_data = fileSystem.ReadFile(vp_lump);
int fp_lump = fileSystem.CheckNumForFullName(frag_prog_lump.GetChars(), 0);
if (fp_lump == -1) I_Error("Unable to load '%s'", frag_prog_lump.GetChars());
auto fp_data = fileSystem.ReadFile(fp_lump);
@ -422,7 +420,6 @@ bool FShader::Load(const char * name, const char * vert_prog_lump_, const char *
{
int pp_lump = fileSystem.CheckNumForFullName(proc_prog_lump.GetChars());
if (pp_lump == -1) I_Error("Unable to load '%s'", proc_prog_lump.GetChars());
auto ppf = fileSystem.ReadFile(pp_lump);
FString pp_data = GetStringFromLump(pp_lump);
if (pp_data.IndexOf("ProcessMaterial") < 0 && pp_data.IndexOf("SetupMaterial") < 0)

View file

@ -89,7 +89,6 @@ void FShaderProgram::Compile(ShaderType type, const char *lumpName, const char *
{
int lump = fileSystem.CheckNumForFullName(lumpName);
if (lump == -1) I_FatalError("Unable to load '%s'", lumpName);
auto sp = fileSystem.ReadFile(lump);
FString code = GetStringFromLump(lump);
Compile(type, lumpName, code, defines, maxGlslVersion);
}

View file

@ -69,7 +69,6 @@ FString VkPPShader::LoadShaderCode(const FString &lumpName, const FString &defin
{
int lump = fileSystem.CheckNumForFullName(lumpName.GetChars());
if (lump == -1) I_FatalError("Unable to load '%s'", lumpName.GetChars());
auto sp = fileSystem.ReadFile(lump);
FString code = GetStringFromLump(lump);
FString patchedCode;

View file

@ -475,7 +475,6 @@ FString VkShaderManager::LoadPrivateShaderLump(const char *lumpname)
{
int lump = fileSystem.CheckNumForFullName(lumpname, 0);
if (lump == -1) I_Error("Unable to load '%s'", lumpname);
auto data = fileSystem.ReadFile(lump);
return GetStringFromLump(lump);
}