//
// Created by martin on 11.02.22.
//

#ifndef ANIMTESTBED_ANIMGRAPHEDITOR_H
#define ANIMTESTBED_ANIMGRAPHEDITOR_H

#include "AnimGraph.h"

inline int GenerateInputAttributeId(int node_id, int input_index) {
  return ((input_index + 1) << 14) + node_id;
}

inline void
SplitInputAttributeId(int attribute_id, int* node_id, int* input_index) {
  *node_id = attribute_id & ((1 << 14) - 1);
  *input_index = (attribute_id >> 14) - 1;
}

inline int GenerateOutputAttributeId(int node_id, int output_index) {
  return ((output_index + 1) << 23) + node_id;
}

inline void
SplitOutputAttributeId(int attribute_id, int* node_id, int* output_index) {
  *node_id = attribute_id & ((1 << 14) - 1);
  *output_index = (attribute_id >> 23) - 1;
}

void AnimGraphEditorUpdate();

void AnimGraphEditorGetRuntimeGraph(AnimGraph& anim_graph);

#endif  //ANIMTESTBED_ANIMGRAPHEDITOR_H
