Skip to content

Commit ec2263a

Browse files
committed
xrEngine/Environment_editor.cpp: no need to use ref variable
It was needed in the previous version of the editor, but now it's redundant
1 parent 7d60b6c commit ec2263a

File tree

1 file changed

+9
-10
lines changed

1 file changed

+9
-10
lines changed

src/xrEngine/Environment_editor.cpp

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,6 @@ void CEnvironment::on_tool_frame()
348348
ImGui::EndMenuBar();
349349
}
350350

351-
auto& current = CurrentEnv;
352351
float time_factor = g_pGameLevel ? g_pGameLevel->GetEnvironmentTimeFactor() : fTimeFactor;
353352

354353
if (ImGui::CollapsingHeader("Environment time", ImGuiTreeNodeFlags_DefaultOpen))
@@ -403,7 +402,7 @@ void CEnvironment::on_tool_frame()
403402
}
404403
//ImGui::SameLine();
405404
if (ConfigStyleSelector("Weather config style", CurrentWeather->soc_style))
406-
current.soc_style = CurrentWeather->soc_style;
405+
CurrentEnv.soc_style = CurrentWeather->soc_style;
407406

408407
ImGui::TableNextColumn();
409408
if (ImGui::BeginCombo("Effect", IsWFXPlaying() ? CurrentWeatherName.c_str() : ""))
@@ -427,7 +426,7 @@ void CEnvironment::on_tool_frame()
427426
//ImGui::SameLine();
428427
ImGui::BeginDisabled(!IsWFXPlaying());
429428
if (ConfigStyleSelector("Effect config style", CurrentWeather->soc_style))
430-
current.soc_style = CurrentWeather->soc_style;
429+
CurrentEnv.soc_style = CurrentWeather->soc_style;
431430
ImGui::EndDisabled();
432431
ImGui::EndTable();
433432
}
@@ -447,22 +446,22 @@ void CEnvironment::on_tool_frame()
447446

448447
ImGui::TableNextColumn();
449448
u32 hours, minutes, seconds;
450-
SplitTime(current.exec_time, hours, minutes, seconds);
449+
SplitTime(CurrentEnv.exec_time, hours, minutes, seconds);
451450

452451
string128 temp;
453452
xr_sprintf(temp, "%02d:%02d:%02d###frame_time", hours, minutes, seconds);
454453

455-
const float current0_time = Current[0] ? Current[0]->exec_time : current.exec_time;
456-
const float current1_time = Current[1] ? Current[1]->exec_time : current.exec_time;
454+
const float current0_time = Current[0] ? Current[0]->exec_time : CurrentEnv.exec_time;
455+
const float current1_time = Current[1] ? Current[1]->exec_time : CurrentEnv.exec_time;
457456

458457
ImGui::BeginDisabled(!Current[0] || !Current[1]);
459-
if (ImGui::SliderFloat(temp, &current.exec_time,
458+
if (ImGui::SliderFloat(temp, &CurrentEnv.exec_time,
460459
current0_time, current1_time, "", ImGuiSliderFlags_NoInput))
461460
{
462461
//Invalidate();
463462
if (g_pGameLevel)
464-
g_pGameLevel->SetEnvironmentGameTimeFactor(iFloor(current.exec_time * 1000.f), time_factor);
465-
SetGameTime(current.exec_time, time_factor);
463+
g_pGameLevel->SetEnvironmentGameTimeFactor(iFloor(CurrentEnv.exec_time * 1000.f), time_factor);
464+
SetGameTime(CurrentEnv.exec_time, time_factor);
466465
lerp();
467466
}
468467
ImGui::EndDisabled();
@@ -487,7 +486,7 @@ void CEnvironment::on_tool_frame()
487486
ImGui::Text("Please, load a level or select time frame manually.");
488487

489488
ImGui::TableNextColumn();
490-
current.ed_show_params(*this);
489+
CurrentEnv.ed_show_params(*this);
491490

492491
ImGui::TableNextColumn();
493492
if (Current[1])

0 commit comments

Comments
 (0)