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

Method load

ogsr_engine/xr_3da/Environment_misc.cpp:20–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18ENGINE_API BOOL bLevelEnvModExport{};
19
20bool CEnvModifier::load(IReader* fs, u32 version)
21{
22 // Проверка на корректность файла. Real Wolf.
23 if (fs->tell() + (version < 0x0016 ? 76 : (version < 0x0018 ? 78 : 103)) > fs->length())
24 {
25 R_ASSERT(version < 0x0018, "!!Invalid file level.env_mod!");
26 return false;
27 }
28
29 fs->r_fvector3(position);
30 radius = fs->r_float();
31 power = fs->r_float();
32 far_plane = fs->r_float();
33 fs->r_fvector3(fog_color);
34 fog_density = fs->r_float();
35 fs->r_fvector3(ambient);
36 fs->r_fvector3(sky_color);
37 fs->r_fvector3(hemi_color);
38
39 use_flags.one();
40 if (version >= 0x0016)
41 {
42 use_flags.assign(fs->r_u16());
43 }
44
45 if (version >= 0x0018)
46 {
47 shape_type = fs->r_u8();
48 fs->r_fvector3(shape_rotate);
49 fs->r_fvector3(shape_halfsize);
50
51 obb.m_translate.set(position);
52 obb.m_rotate.set(Fmatrix().setXYZ(shape_rotate));
53 obb.m_halfsize.set(shape_halfsize);
54 }
55
56 return true;
57}
58
59bool CEnvModifier::loadIni(CInifile& ini, LPCSTR section)
60{

Callers 5

create_sound_channelMethod · 0.45
AppendEnvAmbMethod · 0.45
mods_loadMethod · 0.45
create_descriptorMethod · 0.45

Calls 15

_GetItemCountFunction · 0.85
_GetItemFunction · 0.85
fis_zeroFunction · 0.85
deg2radFunction · 0.85
clampFunction · 0.85
oneMethod · 0.80
setXYZMethod · 0.80
line_existMethod · 0.80
setHPMethod · 0.80
AppendEnvAmbMethod · 0.80
_validFunction · 0.50
tellMethod · 0.45

Tested by

no test coverage detected