CSEngine
Loading...
Searching...
No Matches
MoreComponentFunc.cpp
1//
2// Created by ounols on 19. 8. 31.
3//
4
5#include "MoreComponentFunc.h"
6#include "../Component/Animation/AnimatorComponent.h"
7#include "../Component/CameraComponent.h"
8#include "../Component/CustomComponent.h"
9#include "../Component/LightComponent.h"
10#include "../Component/RenderComponent.h"
11#include "../Component/TransformComponent.h"
12
13#define BIND_COMPONENT_MACRO(CLASSNAME) \
14if(component_type == #CLASSNAME) { \
15 auto comp_r = static_cast<CLASSNAME*>(component); \
16 instance->set(name.c_str(), comp_r); \
17 return; \
18}
19
20using namespace CSE;
21
22void MoreComponentFunc::BindComponentToSQInstance(SComponent* component, std::string name,
23 sqext::SQIClassInstance* instance) {
24 std::string component_type = component->GetClassType();
25
26 BIND_COMPONENT_MACRO(AnimatorComponent);
27 BIND_COMPONENT_MACRO(JointComponent);
28 BIND_COMPONENT_MACRO(CameraComponent);
29 BIND_COMPONENT_MACRO(CustomComponent);
30 BIND_COMPONENT_MACRO(DrawableSkinnedMeshComponent);
31 BIND_COMPONENT_MACRO(DrawableStaticMeshComponent);
32 BIND_COMPONENT_MACRO(LightComponent);
33 BIND_COMPONENT_MACRO(RenderComponent);
34 BIND_COMPONENT_MACRO(TransformComponent);
35}
36