MCPcopy Create free account
hub / github.com/WolfireGames/overgrowth / LoadCollisionNormals

Function LoadCollisionNormals

Source/Main/engine.cpp:4327–4347  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4325}
4326
4327void LoadCollisionNormals(SceneGraph* scenegraph) {
4328 PROFILER_ZONE(g_profiler_ctx, "LoadCollisionNormals");
4329 std::string path = scenegraph->level_path_.GetOriginalPathStr() + ".col_norm.zip";
4330 if (FileExists(path, kAnyPath)) {
4331 char temp_path[kPathSize];
4332 FindFilePath(path.c_str(), temp_path, kPathSize, kAnyPath);
4333 ExpandedZipFile expanded_zip_file;
4334 {
4335 PROFILER_ZONE(g_profiler_ctx, "Unzipping file");
4336 UnZip(temp_path, expanded_zip_file);
4337 }
4338 std::vector<char> buffer;
4339 const char* data;
4340 const char* filename;
4341 unsigned size;
4342 expanded_zip_file.GetEntry(0, filename, data, size);
4343 buffer.resize(size);
4344 memcpy(&buffer[0], data, size);
4345 ParseCollisionNormalsFile(scenegraph, buffer);
4346 }
4347}
4348
4349// Draw the current frame
4350void Engine::Draw() {

Callers 2

LoadLevelDataMethod · 0.85
DrawImGuiFunction · 0.85

Calls 8

FileExistsFunction · 0.85
FindFilePathFunction · 0.85
UnZipFunction · 0.85
GetOriginalPathStrMethod · 0.80
GetEntryMethod · 0.80
c_strMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected