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

Method Load

ogsr_engine/xr_3da/GameMtlLib.cpp:17–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

15}
16
17void SGameMtl::Load(IReader& fs)
18{
19 R_ASSERT(fs.find_chunk(GAMEMTL_CHUNK_MAIN));
20 ID = fs.r_u32();
21 fs.r_stringZ(m_Name);
22
23 if (fs.find_chunk(GAMEMTL_CHUNK_DESC))
24 {
25 fs.r_stringZ(m_Desc);
26 }
27
28 R_ASSERT(fs.find_chunk(GAMEMTL_CHUNK_FLAGS));
29 Flags.assign(fs.r_u32());
30
31 R_ASSERT(fs.find_chunk(GAMEMTL_CHUNK_PHYSICS));
32 fPHFriction = fs.r_float();
33 fPHDamping = fs.r_float();
34 fPHSpring = fs.r_float();
35 fPHBounceStartVelocity = fs.r_float();
36 fPHBouncing = fs.r_float();
37
38 R_ASSERT(fs.find_chunk(GAMEMTL_CHUNK_FACTORS));
39 fShootFactor = fs.r_float();
40 fBounceDamageFactor = fs.r_float();
41 fVisTransparencyFactor = fs.r_float();
42 fSndOcclusionFactor = fs.r_float();
43
44 if (fs.find_chunk(GAMEMTL_CHUNK_FACTORS_MP))
45 fs.r_float();
46
47 if (fs.find_chunk(GAMEMTL_CHUNK_FLOTATION))
48 fFlotationFactor = fs.r_float();
49
50 if (fs.find_chunk(GAMEMTL_CHUNK_INJURIOUS))
51 fInjuriousSpeed = fs.r_float();
52
53 if (fs.find_chunk(GAMEMTL_CHUNK_DENSITY))
54 fDensityFactor = fs.r_float();
55}
56
57void CGameMtlLibrary::Load()
58{

Callers

nothing calls this directly

Calls 15

MsgFunction · 0.85
LogFunction · 0.85
GetMaterialIdxFunction · 0.85
find_chunkMethod · 0.80
existMethod · 0.80
r_openMethod · 0.80
r_closeMethod · 0.80
open_chunk_iteratorMethod · 0.80
r_u32Method · 0.45
r_stringZMethod · 0.45
assignMethod · 0.45
r_floatMethod · 0.45

Tested by

no test coverage detected