MCPcopy Create free account
hub / github.com/codereader/DarkRadiant / ensureAasFileLoaded

Method ensureAasFileLoaded

radiant/ui/aas/AasFileControl.cpp:67–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

65}
66
67void AasFileControl::ensureAasFileLoaded()
68{
69 if (_aasFile) return;
70
71 ArchiveTextFilePtr file = GlobalFileSystem().openTextFileInAbsolutePath(_info.absolutePath);
72
73 if (file)
74 {
75 std::istream stream(&file->getInputStream());
76 map::IAasFileLoaderPtr loader = GlobalAasFileManager().getLoaderForStream(stream);
77
78 if (loader && loader->canLoad(stream))
79 {
80 stream.seekg(0, std::ios_base::beg);
81
82 _aasFile = loader->loadFromStream(stream);
83
84 // Construct a renderable to attach to the rendersystem
85 _renderable.setAasFile(_aasFile);
86 }
87 }
88}
89
90void AasFileControl::onToggle(wxCommandEvent& ev)
91{

Callers

nothing calls this directly

Calls 5

getLoaderForStreamMethod · 0.80
setAasFileMethod · 0.80
canLoadMethod · 0.45
loadFromStreamMethod · 0.45

Tested by

no test coverage detected