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

Method CEnvironment

ogsr_engine/xr_3da/Environment.cpp:41–127  ·  view source on GitHub ↗

///////////////////////////////////////////////////////////////////// environment

Source from the content-addressed store, hash-verified

39//////////////////////////////////////////////////////////////////////////
40// environment
41CEnvironment::CEnvironment()
42{
43 USED_COP_WEATHER = FS.path_exist(fsgame::game_weathers);
44
45 m_last_weather_shift = 0;
46 bNeed_re_create_env = FALSE;
47 b_wfx = false;
48 Current[0] = nullptr;
49 Current[1] = nullptr;
50 CurrentWeather = nullptr;
51 CurrentWeatherName = nullptr;
52 eff_Rain = nullptr;
53 eff_LensFlare = nullptr;
54 eff_Thunderbolt = nullptr;
55 OnDeviceCreate();
56
57 fGameTime = 0.f;
58 fTimeFactor = 12.f;
59
60 wind_strength_factor = 0.f;
61 wind_gust_factor = 0.f;
62 wetness_factor = 0.f;
63 wind_blast_strength = 0.f;
64 wind_blast_direction.set(1.f, 0.f, 0.f);
65
66 wind_blast_strength_start_value = 0.f;
67 wind_blast_strength_stop_value = 0.f;
68
69 wind_anim = {0.0f, 0.0f};
70
71 // fill clouds hemi verts & faces
72 const Fvector* verts;
73 CloudsVerts.resize(xrHemisphereVertices(2, verts));
74 CopyMemory(&CloudsVerts.front(), verts, CloudsVerts.size() * sizeof(Fvector));
75 const u16* indices;
76 CloudsIndices.resize(xrHemisphereIndices(2, indices));
77 CopyMemory(&CloudsIndices.front(), indices, CloudsIndices.size() * sizeof(u16));
78
79 // perlin noise
80 PerlinNoise1D = xr_new<CPerlinNoise1D>(Random.randI(0, 0xFFFF));
81 PerlinNoise1D->SetOctaves(2);
82 PerlinNoise1D->SetAmplitude(0.66666f);
83
84 if (USED_COP_WEATHER)
85 {
86 string_path file_name;
87 m_ambients_config = xr_new<CInifile>(FS.update_path(file_name, fsgame::game_configs, "environment\\ambients.ltx"), TRUE, TRUE, FALSE);
88 m_sound_channels_config = xr_new<CInifile>(FS.update_path(file_name, fsgame::game_configs, "environment\\sound_channels.ltx"), TRUE, TRUE, FALSE);
89 m_effects_config = xr_new<CInifile>(FS.update_path(file_name, fsgame::game_configs, "environment\\effects.ltx"), TRUE, TRUE, FALSE);
90 m_suns_config = xr_new<CInifile>(FS.update_path(file_name, fsgame::game_configs, "environment\\suns.ltx"), TRUE, TRUE, FALSE);
91 m_thunderbolt_collections_config = xr_new<CInifile>(FS.update_path(file_name, fsgame::game_configs, "environment\\thunderbolt_collections.ltx"), TRUE, TRUE, FALSE);
92 m_thunderbolts_config = xr_new<CInifile>(FS.update_path(file_name, fsgame::game_configs, "environment\\thunderbolts.ltx"), TRUE, TRUE, FALSE);
93
94 m_static_sun_movement = FS.exist(fsgame::game_configs, "environment\\sun_positions.ltx");
95 if (m_static_sun_movement)
96 m_sun_pos_config = xr_new<CInifile>(FS.update_path(file_name, fsgame::game_configs, "environment\\sun_positions.ltx"), TRUE, TRUE, FALSE);
97
98 CInifile* config = xr_new<CInifile>(FS.update_path(file_name, fsgame::game_configs, "environment\\environment.ltx"), TRUE, TRUE, FALSE);

Callers

nothing calls this directly

Calls 15

xrHemisphereVerticesFunction · 0.85
CopyMemoryFunction · 0.85
xrHemisphereIndicesFunction · 0.85
deg2radFunction · 0.85
clampFunction · 0.85
xr_deleteFunction · 0.85
path_existMethod · 0.80
randIMethod · 0.80
existMethod · 0.80
_minFunction · 0.50
setMethod · 0.45
resizeMethod · 0.45

Tested by

no test coverage detected