Skip to content

Commit

Permalink
Load scene bug solved
Browse files Browse the repository at this point in the history
The load scene had a bug on load function, was not doing news.
  • Loading branch information
vandalo committed Mar 20, 2018
1 parent 0723a6b commit d9e6b03
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 10,489 deletions.
44 changes: 24 additions & 20 deletions LCSEngine/GameObject.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -266,50 +266,54 @@ void GameObject::load(nlohmann::json& conf) {
{
switch ((*it).at("typeComponent").get<int>())
{
//Se lo que piensas... mira al final del switch...
case TRANSFORM:
{
TransformComponent transformComp(this);
transformComp.typeComponent = TRANSFORM;
transformComp.load(*it);
TransformComponent* transformComp = new TransformComponent(this);
transformComp->typeComponent = TRANSFORM;
transformComp->load(*it);
addComponent(transformComp);
}
break;
case MATERIAL:
{
MaterialComponent materialComp(this);
materialComp.typeComponent = MATERIAL;
materialComp.load(*it);
MaterialComponent* materialComp = new MaterialComponent(this);
materialComp->typeComponent = MATERIAL;
materialComp->load(*it);
addComponent(materialComp);
}
break;
case MESH:
{
MeshComponent meshComp(this);
meshComp.typeComponent = MESH;
meshComp.load(*it);
MeshComponent* meshComp = new MeshComponent(this);
meshComp->typeComponent = MESH;
meshComp->load(*it);
addComponent(meshComp);
}
break;
case ANIMATION:
{
AnimationComponent animationComp(this);
animationComp.typeComponent = ANIMATION;
animationComp.load(*it);
AnimationComponent* animationComp = new AnimationComponent(this);
animationComp->typeComponent = ANIMATION;
animationComp->load(*it);
addComponent(animationComp);
}
break;
case AUDIOLISTENER:
{
AudioListenerComponent audioListenerComp(this);
audioListenerComp.typeComponent = AUDIOLISTENER;
audioListenerComp.load(*it);
AudioListenerComponent* audioListenerComp = new AudioListenerComponent(this);
audioListenerComp->typeComponent = AUDIOLISTENER;
audioListenerComp->load(*it);
addComponent(audioListenerComp);
}
break;
case AUDIOSOURCE:
{
AudioSourceComponent audioSourceComp(this);
audioSourceComp.typeComponent = AUDIOSOURCE;
audioSourceComp.load(*it);
AudioSourceComponent* audioSourceComp = new AudioSourceComponent(this);
audioSourceComp->typeComponent = AUDIOSOURCE;
audioSourceComp->load(*it);
addComponent(audioSourceComp);
}
break;
//Las llaves del case si tienes huevos las quitas ¬¬
}
}
}
Expand Down
Loading

0 comments on commit d9e6b03

Please sign in to comment.