MCPcopy Create free account
hub / github.com/ZDoom/Raze / LoadScriptFile

Function LoadScriptFile

source/games/sw/src/scrip2.cpp:70–89  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

68*/
69
70TArray<uint8_t> LoadScriptFile(const char *filename)
71{
72 TArray<uint8_t> ret;
73 FileReader fp;
74
75 if (!(fp = fileSystem.OpenFileReader(filename)).isOpen())
76 {
77 // If there's no script file, forget it.
78 return ret;
79 }
80
81 ret.Resize((unsigned)fp.GetLength() + 1);
82 if (fp.Read(ret.Data(), fp.GetLength()) < fp.GetLength())
83 {
84 scriptline = 1;
85 endofscript = false;
86 tokenready = false;
87 }
88 return ret;
89}
90
91
92/*

Callers 1

LoadKVXFromScriptFunction · 0.85

Calls 6

isOpenMethod · 0.80
OpenFileReaderMethod · 0.45
ResizeMethod · 0.45
GetLengthMethod · 0.45
ReadMethod · 0.45
DataMethod · 0.45

Tested by

no test coverage detected