MCPcopy Create free account
hub / github.com/PacktPublishing/3D-Graphics-Rendering-Cookbook / loadStringList

Function loadStringList

shared/scene/Material.cpp:18–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

16}
17
18void loadStringList(FILE* f, std::vector<std::string>& lines)
19{
20 {
21 uint32_t sz = 0;
22 fread(&sz, sizeof(uint32_t), 1, f);
23 lines.resize(sz);
24 }
25 std::vector<char> inBytes;
26 for (auto& s: lines)
27 {
28 uint32_t sz = 0;
29 fread(&sz, sizeof(uint32_t), 1, f);
30 inBytes.resize(sz + 1);
31 fread(inBytes.data(), sz + 1, 1, f);
32 s = std::string(inBytes.data());
33 }
34}
35
36void saveMaterials(const char* fileName, const std::vector<MaterialDescription>& materials, const std::vector<std::string>& files)
37{

Callers 2

loadSceneFunction · 0.85
loadMaterialsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected