MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / Init

Method Init

ogsr_engine/xrGame/ui/MMSound.cpp:10–31  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8CMMSound::~CMMSound() { all_Stop(); }
9
10void CMMSound::Init(CUIXml& xml_doc, LPCSTR path)
11{
12 string256 _path;
13
14 int nodes_num = xml_doc.GetNodesNum(path, 0, "menu_music");
15
16 XML_NODE* tab_node = xml_doc.NavigateToNode(path, 0);
17 xml_doc.SetLocalRoot(tab_node);
18 for (int i = 0; i < nodes_num; ++i)
19 m_play_list.push_back(xml_doc.Read("menu_music", i, ""));
20 xml_doc.SetLocalRoot(xml_doc.GetRoot());
21
22 string_path buff{};
23
24 strconcat(sizeof(_path), _path, path, ":whell_sound");
25 if (FS.exist(buff, fsgame::game_sounds, xml_doc.Read(_path, 0, ""), ".ogg"))
26 m_whell.create(xml_doc.Read(_path, 0, ""), st_Effect, sg_SourceType);
27
28 strconcat(sizeof(_path), _path, path, ":whell_click");
29 if (FS.exist(buff, fsgame::game_sounds, xml_doc.Read(_path, 0, ""), ".ogg"))
30 m_whell_click.create(xml_doc.Read(_path, 0, ""), st_Effect, sg_SourceType);
31}
32
33void CMMSound::whell_Play()
34{

Callers

nothing calls this directly

Calls 6

GetNodesNumMethod · 0.80
NavigateToNodeMethod · 0.80
existMethod · 0.80
push_backMethod · 0.45
ReadMethod · 0.45
createMethod · 0.45

Tested by

no test coverage detected