Clang-tidy changes
This commit is contained in:
parent
b6b5a71803
commit
1ebc0606f8
4 changed files with 7 additions and 9 deletions
|
@ -26,7 +26,7 @@ Cinematic* AnimationSystem::loadCinematic(const std::string& path) {
|
||||||
shot->end = shotObject["end"];
|
shot->end = shotObject["end"];
|
||||||
shot->world = shotObject["world"];
|
shot->world = shotObject["world"];
|
||||||
|
|
||||||
for(auto entityObject : shotObject["entities"]) {
|
for(const auto& entityObject : shotObject["entities"]) {
|
||||||
CinematicEntity entity;
|
CinematicEntity entity;
|
||||||
entity.data = entityObject;
|
entity.data = entityObject;
|
||||||
|
|
||||||
|
@ -147,7 +147,7 @@ void AnimationSystem::update(Cinematic* cinematic, float deltaTime) {
|
||||||
void AnimationSystem::preloadShot(Shot* shot) {
|
void AnimationSystem::preloadShot(Shot* shot) {
|
||||||
worldManager.loadWorld(shot->world);
|
worldManager.loadWorld(shot->world);
|
||||||
|
|
||||||
for(auto cimEntity : shot->entities) {
|
for(const auto& cimEntity : shot->entities) {
|
||||||
EntityID entity = parseEntity(cimEntity.data, worldManager.getWorld(shot->world));
|
EntityID entity = parseEntity(cimEntity.data, worldManager.getWorld(shot->world));
|
||||||
|
|
||||||
for(auto animation : shot->animations) {
|
for(auto animation : shot->animations) {
|
||||||
|
@ -164,8 +164,6 @@ void AnimationSystem::loadShot(Shot* shot) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void AnimationSystem::unloadShot(Shot* shot) {
|
void AnimationSystem::unloadShot(Shot* shot) {
|
||||||
World* world = worldManager.getCurrentWorld();
|
|
||||||
|
|
||||||
for(auto entity : shot->loadedEntities)
|
for(auto entity : shot->loadedEntities)
|
||||||
ECS::destroyEntity(entity);
|
ECS::destroyEntity(entity);
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,10 +33,10 @@ void Config::save(const char* to) {
|
||||||
return;
|
return;
|
||||||
|
|
||||||
std::string currentCategory;
|
std::string currentCategory;
|
||||||
for(auto itr : categories) {
|
for(const auto& itr : categories) {
|
||||||
file << "[" << itr.first << "]\n";
|
file << "[" << itr.first << "]\n";
|
||||||
|
|
||||||
for(auto itr2 : itr.second) {
|
for(const auto& itr2 : itr.second) {
|
||||||
file << itr2.first << "=" << itr2.second << "\n";
|
file << itr2.first << "=" << itr2.second << "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,7 +36,7 @@ EntityID parseEntity(const nlohmann::json& json, World* world) {
|
||||||
|
|
||||||
light->type = componentObject["kind"];
|
light->type = componentObject["kind"];
|
||||||
} else if(componentType == "Camera") {
|
} else if(componentType == "Camera") {
|
||||||
CameraComponent* camera = ECS::addComponent<CameraComponent>(entity);
|
ECS::addComponent<CameraComponent>(entity);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -28,8 +28,8 @@ void WorldManager::loadWorld(const std::string& path) {
|
||||||
world->color[1] = atof(tokens[1].c_str());
|
world->color[1] = atof(tokens[1].c_str());
|
||||||
world->color[2] = atof(tokens[2].c_str());
|
world->color[2] = atof(tokens[2].c_str());
|
||||||
|
|
||||||
for(auto entityObject : json["entities"])
|
for(const auto& entityObject : json["entities"])
|
||||||
EntityID entity = parseEntity(entityObject, world);
|
parseEntity(entityObject, world);
|
||||||
|
|
||||||
loadedWorlds[path] = world;
|
loadedWorlds[path] = world;
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue