Skip to content

Commit

Permalink
#5532: Material Editor can deal with soundMap stages
Browse files Browse the repository at this point in the history
  • Loading branch information
codereader committed Feb 26, 2021
1 parent 18f2d0a commit 70d7154
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion install/ui/materialeditor.fbp
Expand Up @@ -11706,7 +11706,7 @@
<property name="minimize_button">0</property>
<property name="minimum_size"></property>
<property name="moveable">1</property>
<property name="name">m_checkBox38</property>
<property name="name">MaterialStageSoundMapWaveform</property>
<property name="pane_border">1</property>
<property name="pane_position"></property>
<property name="pane_size"></property>
Expand Down
2 changes: 1 addition & 1 deletion install/ui/materialeditor.xrc
Expand Up @@ -2021,7 +2021,7 @@
<option>0</option>
<flag>wxALIGN_CENTER_VERTICAL|wxBOTTOM|wxTOP</flag>
<border>3</border>
<object class="wxCheckBox" name="m_checkBox38">
<object class="wxCheckBox" name="MaterialStageSoundMapWaveform">
<label>Waveform</label>
<checked>0</checked>
</object>
Expand Down
7 changes: 7 additions & 0 deletions radiant/ui/materials/MaterialEditor.cpp
Expand Up @@ -760,6 +760,7 @@ void MaterialEditor::updateStageControls()

auto videoMapFile = getControl<wxTextCtrl>("MaterialStageVideoMapFile");
auto videoMapLoop = getControl<wxCheckBox>("MaterialStageVideoMapLoop");
auto soundMapWave = getControl<wxCheckBox>("MaterialStageSoundMapWaveform");

auto mapType = getControl<wxChoice>("MaterialStageMapType");

Expand All @@ -780,6 +781,7 @@ void MaterialEditor::updateStageControls()
imageMap->Enable();
videoMapFile->SetValue("");
videoMapLoop->SetValue(false);
soundMapWave->SetValue(false);
}

switch (selectedStage->getMapType())
Expand All @@ -801,6 +803,11 @@ void MaterialEditor::updateStageControls()
}
break;
case ShaderLayer::MapType::SoundMap:
{
auto soundMapExpression = std::dynamic_pointer_cast<shaders::ISoundMapExpression>(selectedStage->getMapExpression());
soundMapWave->SetValue(soundMapExpression ? soundMapExpression->isWaveform() : false);
}
break;
case ShaderLayer::MapType::RemoteRenderMap:
case ShaderLayer::MapType::MirrorRenderMap:
break;
Expand Down

0 comments on commit 70d7154

Please sign in to comment.