/
SoundShaderDefinitionView.cpp
49 lines (38 loc) · 1.09 KB
/
SoundShaderDefinitionView.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#include "SoundShaderDefinitionView.h"
#include "wxutil/SourceView.h"
namespace ui
{
SoundShaderDefinitionView::SoundShaderDefinitionView(const std::string& shaderName, wxWindow* parent) :
DefinitionView(_("View Sound Shader Definition"), parent)
{
addSourceView(new wxutil::D3MaterialSourceViewCtrl(getMainPanel()));
if (module::GlobalModuleRegistry().moduleExists(MODULE_SOUNDMANAGER))
{
_shader = GlobalSoundManager().getSoundShader(shaderName);
}
}
void SoundShaderDefinitionView::setShader(const std::string& shader)
{
if (module::GlobalModuleRegistry().moduleExists(MODULE_SOUNDMANAGER))
{
_shader = GlobalSoundManager().getSoundShader(shader);
}
update();
}
bool SoundShaderDefinitionView::isEmpty() const
{
return !_shader;
}
std::string SoundShaderDefinitionView::getDeclName()
{
return _shader ? _shader->getName() : std::string();
}
std::string SoundShaderDefinitionView::getDeclFileName()
{
return _shader ? _shader->getShaderFilePath() : std::string();
}
std::string SoundShaderDefinitionView::getDefinition()
{
return _shader ? _shader->getDefinition() : std::string();
}
}