MCPcopy Create free account
hub / github.com/OpenDungeons/OpenDungeons / readSceneMenu

Method readSceneMenu

source/renderscene/RenderSceneMenu.cpp:62–90  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

60}
61
62void RenderSceneMenu::readSceneMenu(const std::string& fileName)
63{
64 if(!mSceneGroups.empty())
65 {
66 OD_LOG_ERR("Scene already loaded. Cannot read " + fileName);
67 return;
68 }
69
70 std::stringstream defFile;
71 if(!Helper::readFileWithoutComments(fileName, defFile))
72 {
73 OD_LOG_ERR("Couldn't read " + fileName);
74 return;
75 }
76
77 std::string nextParam;
78 while(true)
79 {
80 if(!defFile.good())
81 break;
82
83 RenderSceneGroup* group = RenderSceneGroup::load(defFile);
84 if(group == nullptr)
85 return;
86
87 group->setRenderSceneListener(this);
88 mSceneGroups.emplace_back(group);
89 }
90}

Callers 1

readMainSceneMethod · 0.80

Calls 2

readFileWithoutCommentsFunction · 0.85

Tested by

no test coverage detected