Skip to content

Commit c1eddc3

Browse files
committed
Move weather editor inside CEnvironment
1 parent 8564cde commit c1eddc3

File tree

8 files changed

+184
-172
lines changed

8 files changed

+184
-172
lines changed

src/xrEngine/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ target_sources_grouped(
99
editor_base_input.cpp
1010
editor_helper.cpp
1111
editor_helper.h
12-
editor_weather.cpp
1312
)
1413

1514
target_sources_grouped(
@@ -142,6 +141,7 @@ target_sources_grouped(
142141
FILES
143142
Environment.cpp
144143
Environment.h
144+
Environment_editor.cpp
145145
Environment_misc.cpp
146146
Environment_render.cpp
147147
xrHemisphere.cpp

src/xrEngine/Environment.h

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include "xrCommon/xr_vector.h"
88
#include "xrCommon/xr_map.h"
99
#include "xrSound/Sound.h"
10+
#include "editor_base.h"
1011

1112
// refs
1213
class ENGINE_API IRender_Visual;
@@ -193,6 +194,8 @@ class ENGINE_API CEnvDescriptor
193194
exec_time_loaded = tm1;
194195
}
195196

197+
void ed_show_params(const CEnvironment& env); // ImGui editor
198+
196199
void on_device_create();
197200
void on_device_destroy();
198201

@@ -217,9 +220,11 @@ class ENGINE_API CEnvDescriptorMixer : public CEnvDescriptor
217220
float f, CEnvModifier& M, float m_power);
218221

219222
static std::pair<Fvector3, float> calculate_dynamic_sun_dir(float fGameTime, float azimuth);
223+
224+
void ed_show_params(const CEnvironment& env); // ImGui editor
220225
};
221226

222-
class ENGINE_API CEnvironment
227+
class ENGINE_API CEnvironment : public xray::editor::ide_tool
223228
{
224229
friend class dxEnvironmentRender;
225230
struct str_pred
@@ -318,6 +323,7 @@ class ENGINE_API CEnvironment
318323
void mods_unload();
319324

320325
void OnFrame();
326+
void on_tool_frame() override;
321327
void lerp();
322328

323329
void RenderSky();
@@ -362,6 +368,9 @@ class ENGINE_API CEnvironment
362368

363369
void save_weathers(CInifile* environment_config = nullptr) const;
364370
void save_weather_effects(CInifile* environment_config = nullptr) const;
371+
372+
private:
373+
pcstr tool_name() override { return "Weather Editor"; }
365374
};
366375

367376
ENGINE_API extern Flags32 psEnvFlags;

0 commit comments

Comments
 (0)