Archived
1
Fork 0

Clang-tidy changes

This commit is contained in:
Joshua Goins 2018-12-26 20:16:32 -05:00
parent b6b5a71803
commit 1ebc0606f8
4 changed files with 7 additions and 9 deletions

View file

@ -26,7 +26,7 @@ Cinematic* AnimationSystem::loadCinematic(const std::string& path) {
shot->end = shotObject["end"];
shot->world = shotObject["world"];
for(auto entityObject : shotObject["entities"]) {
for(const auto& entityObject : shotObject["entities"]) {
CinematicEntity entity;
entity.data = entityObject;
@ -147,7 +147,7 @@ void AnimationSystem::update(Cinematic* cinematic, float deltaTime) {
void AnimationSystem::preloadShot(Shot* shot) {
worldManager.loadWorld(shot->world);
for(auto cimEntity : shot->entities) {
for(const auto& cimEntity : shot->entities) {
EntityID entity = parseEntity(cimEntity.data, worldManager.getWorld(shot->world));
for(auto animation : shot->animations) {
@ -164,8 +164,6 @@ void AnimationSystem::loadShot(Shot* shot) {
}
void AnimationSystem::unloadShot(Shot* shot) {
World* world = worldManager.getCurrentWorld();
for(auto entity : shot->loadedEntities)
ECS::destroyEntity(entity);
}

View file

@ -33,10 +33,10 @@ void Config::save(const char* to) {
return;
std::string currentCategory;
for(auto itr : categories) {
for(const auto& itr : categories) {
file << "[" << itr.first << "]\n";
for(auto itr2 : itr.second) {
for(const auto& itr2 : itr.second) {
file << itr2.first << "=" << itr2.second << "\n";
}

View file

@ -36,7 +36,7 @@ EntityID parseEntity(const nlohmann::json& json, World* world) {
light->type = componentObject["kind"];
} else if(componentType == "Camera") {
CameraComponent* camera = ECS::addComponent<CameraComponent>(entity);
ECS::addComponent<CameraComponent>(entity);
}
}

View file

@ -28,8 +28,8 @@ void WorldManager::loadWorld(const std::string& path) {
world->color[1] = atof(tokens[1].c_str());
world->color[2] = atof(tokens[2].c_str());
for(auto entityObject : json["entities"])
EntityID entity = parseEntity(entityObject, world);
for(const auto& entityObject : json["entities"])
parseEntity(entityObject, world);
loadedWorlds[path] = world;
}