*
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
#include <shaders/IShaderGraphNode.h>
|
||||
|
||||
|
||||
namespace LifeGraphics
|
||||
{
|
||||
IShaderGraphNode::IShaderGraphNode()
|
||||
:checked(false), resource_id(0)
|
||||
{
|
||||
}
|
||||
|
||||
bool IShaderGraphNode::Serialize(LifeCore::IMemoryStream* stm)
|
||||
{
|
||||
return IPropertyHolder::Serialize(stm);
|
||||
}
|
||||
bool IShaderGraphNode::Deserialize(LifeCore::IMemoryStream* stm)
|
||||
{
|
||||
return IPropertyHolder::Deserialize(stm);
|
||||
}
|
||||
IShaderGraphNodePort* IShaderGraphNode::GetInputPort(size_t id)
|
||||
{
|
||||
return Inputs[id];
|
||||
}
|
||||
IShaderGraphNodePort* IShaderGraphNode::GetInputPortByName(const String& name)
|
||||
{
|
||||
size_t cnt = Inputs.size();
|
||||
|
||||
for(size_t i = 0; i < cnt; i++){
|
||||
if(Inputs[i]->Name == name)
|
||||
return Inputs[i];
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
IShaderGraphNodePort* IShaderGraphNode::GetOutputPortByName(const String& name)
|
||||
{
|
||||
size_t cnt = Outputs.size();
|
||||
|
||||
for(size_t i = 0; i < cnt; i++){
|
||||
if(Outputs[i]->Name == name)
|
||||
return Outputs[i];
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
IShaderGraphNodePort* IShaderGraphNode::GetOutputPortByID(size_t id){
|
||||
size_t cnt = Outputs.size();
|
||||
if(id < cnt){
|
||||
return Outputs[id];
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
size_t IShaderGraphNode::GetOutputID(IShaderGraphNodePort* port)
|
||||
{
|
||||
for(size_t i = 0; i < Outputs.size(); i++){
|
||||
if(Outputs[i] == port)
|
||||
return i;
|
||||
}
|
||||
return 100500;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user