MCPcopy Create free account
hub / github.com/BohemiaInteractive/CWR / LoadSound

Method LoadSound

engine/Poseidon/Audio/DynSound.cpp:125–157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

123}
124
125void SoundObject::LoadSound()
126{
127 SoundPars pars;
128 const ParamEntry* cls = FindSound(_soundName, pars);
129
130 if (cls)
131 {
132 ParamEntry* entry = cls->FindEntry("forceTitles");
133 if (entry)
134 {
135 _forceTitles = *entry;
136 }
137 if (_forceTitles || USER_CONFIG.showTitles)
138 {
139 entry = cls->FindEntry("titlesFont");
140 if (entry)
141 {
142 _titlesFont = GEngine->LoadFont(GetFontID(*entry));
143 _titlesSize = (*cls) >> "titlesSize";
144 }
145
146 const ParamEntry& cfg = (*cls) >> "titles";
147 int n = cfg.GetSize() / 2;
148 for (int i = 0; i < n; i++)
149 {
150 int index = _titles.Add();
151 float t = cfg[2 * i];
152 _titles[index].time = Glob.time + t;
153 _titles[index].text = cfg[2 * i + 1];
154 }
155 }
156 }
157}
158
159static OLinkArray<SoundObject> SpeakingObjects;
160

Callers

nothing calls this directly

Calls 6

FindSoundFunction · 0.85
GetFontIDFunction · 0.85
FindEntryMethod · 0.45
LoadFontMethod · 0.45
GetSizeMethod · 0.45
AddMethod · 0.45

Tested by

no test coverage detected