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

Method Load_GameSpecific_After

ogsr_engine/xrGame/Level_load.cpp:25–113  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

23}
24
25BOOL CLevel::Load_GameSpecific_After()
26{
27 // loading static particles
28 string_path fn_game;
29
30 if (FS.exist(fn_game, "$level$", "level.ps_static.ltx"))
31 {
32 CInifile ltXfile = CInifile(fn_game);
33
34 CParticlesObject* pStaticParticles;
35 LPCSTR ref_name;
36 Fmatrix transform;
37 for (const auto& it : ltXfile.sections())
38 {
39 ref_name = it.second->r_string("particle_name");
40 transform.i = it.second->r_fvector3("matrix_1");
41 transform.j = it.second->r_fvector3("matrix_2");
42 transform.k = it.second->r_fvector3("matrix_3");
43 transform.c = it.second->r_fvector3("matrix_4");
44
45 pStaticParticles = CParticlesObject::Create(ref_name, FALSE, false);
46 pStaticParticles->UpdateParent(transform, {});
47 pStaticParticles->Play(false);
48 m_StaticParticles.push_back(pStaticParticles);
49 }
50 }
51 else if (FS.exist(fn_game, "$level$", "level.ps_static"))
52 {
53 IReader* F = FS.r_open(fn_game);
54 CParticlesObject* pStaticParticles;
55 u32 chunk = 0;
56 string256 ref_name;
57 Fmatrix transform;
58 for (IReader* OBJ = F->open_chunk_iterator(chunk); OBJ; OBJ = F->open_chunk_iterator(chunk, OBJ))
59 {
60 OBJ->r_stringZ(ref_name, sizeof(ref_name));
61 OBJ->r(&transform, sizeof(Fmatrix));
62 transform.c.y += 0.01f;
63
64 pStaticParticles = CParticlesObject::Create(ref_name, FALSE, false);
65 pStaticParticles->UpdateParent(transform, {});
66 pStaticParticles->Play(false);
67 m_StaticParticles.push_back(pStaticParticles);
68 }
69 FS.r_close(F);
70 }
71
72 // loading static sounds
73 VERIFY(m_level_sound_manager);
74 m_level_sound_manager->Load();
75
76 // loading sound environment
77 if (FS.exist(fn_game, "$level$", "level.snd_env"))
78 {
79 IReader* F = FS.r_open(fn_game);
80 ::Sound->set_geometry_env(F);
81 FS.r_close(F);
82 }

Callers

nothing calls this directly

Calls 15

CreateFunction · 0.85
existMethod · 0.80
r_openMethod · 0.80
open_chunk_iteratorMethod · 0.80
r_closeMethod · 0.80
set_geometry_envMethod · 0.80
section_existMethod · 0.80
line_existMethod · 0.80
SetGameTimeMethod · 0.80
EnvironmentMethod · 0.80
CInifileClass · 0.70
r_stringMethod · 0.45

Tested by

no test coverage detected