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

Function saveMap

shared/scene/Scene.cpp:153–165  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

151}
152
153void saveMap(FILE* f, const std::unordered_map<uint32_t, uint32_t>& map)
154{
155 std::vector<uint32_t> ms;
156 ms.reserve(map.size() * 2);
157 for (const auto& m : map)
158 {
159 ms.push_back(m.first);
160 ms.push_back(m.second);
161 }
162 const uint32_t sz = static_cast<uint32_t>(ms.size());
163 fwrite(&sz, sizeof(sz), 1, f);
164 fwrite(ms.data(), sizeof(int), ms.size(), f);
165}
166
167void saveScene(const char* fileName, const Scene& scene)
168{

Callers 1

saveSceneFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected