Fixed various clang-tidy messages.
This commit is contained in:
@@ -18,7 +18,6 @@
|
||||
#include "SyncTrack.h"
|
||||
|
||||
struct AnimNode;
|
||||
struct NodeSocketAccessorBase;
|
||||
|
||||
struct AnimNodeResource {
|
||||
std::string m_name;
|
||||
@@ -34,7 +33,7 @@ static inline AnimNodeResource AnimNodeResourceFactory(
|
||||
result.m_type_name = node_type_name;
|
||||
result.m_anim_node = AnimNodeFactory(node_type_name);
|
||||
result.m_socket_accessor =
|
||||
AnimNodeDescriptorFactory(node_type_name.c_str(), result.m_anim_node);
|
||||
AnimNodeDescriptorFactory(node_type_name, result.m_anim_node);
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -43,9 +42,9 @@ static inline AnimNodeResource AnimNodeResourceFactory(
|
||||
//
|
||||
struct AnimGraphConnectionResource {
|
||||
size_t source_node_index = -1;
|
||||
std::string source_socket_name = "";
|
||||
std::string source_socket_name;
|
||||
size_t target_node_index = -1;
|
||||
std::string target_socket_name = "";
|
||||
std::string target_socket_name;
|
||||
};
|
||||
|
||||
struct AnimGraphResource {
|
||||
@@ -54,9 +53,9 @@ struct AnimGraphResource {
|
||||
std::vector<AnimGraphConnectionResource> m_connections;
|
||||
|
||||
~AnimGraphResource() {
|
||||
for (size_t i = 0, n = m_nodes.size(); i < n; i++) {
|
||||
delete m_nodes[i].m_anim_node;
|
||||
delete m_nodes[i].m_socket_accessor;
|
||||
for (auto & m_node : m_nodes) {
|
||||
delete m_node.m_anim_node;
|
||||
delete m_node.m_socket_accessor;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,9 +70,6 @@ struct AnimGraphResource {
|
||||
AnimNodeResource& getGraphOutputNode() { return m_nodes[0]; }
|
||||
AnimNodeResource& getGraphInputNode() { return m_nodes[1]; }
|
||||
|
||||
const AnimNodeResource& getGraphOutputNode() const { return m_nodes[0]; }
|
||||
const AnimNodeResource& getGraphInputNode() const { return m_nodes[1]; }
|
||||
|
||||
size_t getNodeIndex(const AnimNodeResource& node_resource) const {
|
||||
for (size_t i = 0, n = m_nodes.size(); i < n; i++) {
|
||||
if (&m_nodes[i] == &node_resource) {
|
||||
@@ -84,7 +80,7 @@ struct AnimGraphResource {
|
||||
return -1;
|
||||
}
|
||||
|
||||
size_t addNode(AnimNodeResource node_resource) {
|
||||
size_t addNode(const AnimNodeResource &node_resource) {
|
||||
m_nodes.push_back(node_resource);
|
||||
return m_nodes.size() - 1;
|
||||
}
|
||||
@@ -126,9 +122,8 @@ struct AnimGraphResource {
|
||||
bool isSocketConnected(
|
||||
const AnimNodeResource& node,
|
||||
const std::string& socket_name) {
|
||||
int node_index = getNodeIndex(node);
|
||||
for (size_t i = 0, n = m_connections.size(); i < n; i++) {
|
||||
const AnimGraphConnectionResource& connection = m_connections[i];
|
||||
size_t node_index = getNodeIndex(node);
|
||||
for (const auto & connection : m_connections) {
|
||||
if ((connection.source_node_index == node_index
|
||||
&& connection.source_socket_name == socket_name)
|
||||
|| ((connection.target_node_index == node_index)
|
||||
@@ -144,9 +139,8 @@ struct AnimGraphResource {
|
||||
|
||||
void createRuntimeNodeInstances(AnimGraph& instance) const;
|
||||
void prepareGraphIOData(AnimGraph& instance) const;
|
||||
void connectRuntimeNodes(AnimGraph& instance) const;
|
||||
void setRuntimeNodeProperties(AnimGraph& instance) const;
|
||||
std::vector<Socket*> getConstNodeInputs(AnimGraph& instance, std::vector<NodeDescriptorBase*>& instance_node_descriptors) const;
|
||||
std::vector<Socket*> getConstNodeInputs(std::vector<NodeDescriptorBase*>& instance_node_descriptors) const;
|
||||
};
|
||||
|
||||
#endif //ANIMTESTBED_ANIMGRAPHRESOURCE_H
|
||||
|
||||
Reference in New Issue
Block a user