From 30be6f88713ed6e1b043cc72cafc1df7728f0710 Mon Sep 17 00:00:00 2001 From: Stephan Vedder Date: Wed, 4 May 2022 14:27:53 +0200 Subject: Manually improve generated changes --- Source/Editors/map_editor.cpp | 21 ++++++++++----------- Source/GUI/dimgui/settings_screen.cpp | 16 ++++++++-------- Source/Graphics/csg.cpp | 12 ++++++------ Source/Graphics/lightprobecollection.cpp | 8 ++++---- Source/Graphics/model.cpp | 26 +++++++++++++------------- Source/Math/mat4.cpp | 4 ++-- Source/Objects/riggedobject.cpp | 4 ++-- Source/Physics/bulletobject.cpp | 4 ++-- 8 files changed, 47 insertions(+), 48 deletions(-) diff --git a/Source/Editors/map_editor.cpp b/Source/Editors/map_editor.cpp index 333b7bf5..9d2ba91e 100644 --- a/Source/Editors/map_editor.cpp +++ b/Source/Editors/map_editor.cpp @@ -851,8 +851,8 @@ void MapEditor::Draw() { } if(always_draw_hotspot_connections) { vec3 start = obj->GetTranslation(); - for(int j : obj->connected_to) { - vec3 end = scenegraph_->GetObjectFromID(j)->GetTranslation(); + for(int id : obj->connected_to) { + vec3 end = scenegraph_->GetObjectFromID(id)->GetTranslation(); DebugDraw::Instance()->AddLine(start, end, vec4(0.0f,1.0f,0.0f,0.8f), _delete_on_draw); } } @@ -953,23 +953,22 @@ void MapEditor::Draw() { float highlit_obj_dist = FLT_MAX; std::vector connected_ids; connected_ids.reserve(64); - for(auto & i : selected) { - Object* selected_obj = i; + for(Object* selected_obj : selected) { box_objects.push_back(selected_obj); connected_ids.clear(); - i->GetConnectionIDs(&connected_ids); + selected_obj->GetConnectionIDs(&connected_ids); for(int connected_id : connected_ids) { Object* obj = scenegraph_->GetObjectFromID(connected_id); GetClosest(mouseray, obj, highlit_obj, highlit_obj_dist); box_objects.push_back(obj); } - for(int j : selected_obj->connected_to) { - Object* obj = scenegraph_->GetObjectFromID(j); + for(int id : selected_obj->connected_to) { + Object* obj = scenegraph_->GetObjectFromID(id); GetClosest(mouseray, obj, highlit_obj, highlit_obj_dist); box_objects.push_back(obj); } - for(int j : selected_obj->connected_from) { - Object* obj = scenegraph_->GetObjectFromID(j); + for(int id : selected_obj->connected_from) { + Object* obj = scenegraph_->GetObjectFromID(id); GetClosest(mouseray, obj, highlit_obj, highlit_obj_dist); box_objects.push_back(obj); } @@ -1292,8 +1291,8 @@ void MapEditor::Update(GameCursor* cursor) { entities.push_back(obj); } } - for (auto & entitie : entities) { - entitie->SaveHistoryState(chunks, state_id); + for (auto & entity : entities) { + entity->SaveHistoryState(chunks, state_id); } sky_editor_->SaveHistoryState(chunks, state_id); // Find out how many chunks have been changed diff --git a/Source/GUI/dimgui/settings_screen.cpp b/Source/GUI/dimgui/settings_screen.cpp index 5643d59a..dd9def22 100644 --- a/Source/GUI/dimgui/settings_screen.cpp +++ b/Source/GUI/dimgui/settings_screen.cpp @@ -1167,14 +1167,14 @@ void DrawSettingsImGui(SceneGraph* scenegraph, ImGuiSettingsType type){ std::vector difficulties = config.GetDifficultyPresets(); if(ImGui::BeginMenu("Finish All Levels On Difficulty")) { - for(auto & difficultie : difficulties) { - if( ImGui::Button(difficultie.c_str())) { + for(auto & difficulty : difficulties) { + if( ImGui::Button(difficulty.c_str())) { std::vector campaigns = ModLoading::Instance().GetCampaigns(); for(auto camp : campaigns) { for( size_t j = 0; j < camp.levels.size(); j++ ) { SavedLevel& s = Engine::Instance()->save_file_.GetSave(camp.id.str(),"linear_campaign",camp.levels[j].id.str()); - if( false == s.ArrayContainsValue("finished_difficulties",difficultie) ) { - s.AppendArrayValue("finished_difficulties",difficultie); + if( false == s.ArrayContainsValue("finished_difficulties",difficulty) ) { + s.AppendArrayValue("finished_difficulties",difficulty); } } } @@ -1191,11 +1191,11 @@ void DrawSettingsImGui(SceneGraph* scenegraph, ImGuiSettingsType type){ for( size_t j = 0; j < camp.levels.size(); j++ ) { ModInstance::Level level = camp.levels[j]; if(ImGui::BeginMenu(level.title)) { - for(auto & difficultie : difficulties) { - if( ImGui::Button(difficultie.c_str())) { + for(auto & difficulty : difficulties) { + if( ImGui::Button(difficulty.c_str())) { SavedLevel& s = Engine::Instance()->save_file_.GetSave(camp.id.str(),"linear_campaign",level.id.str()); - if( false == s.ArrayContainsValue("finished_difficulties",difficultie) ) { - s.AppendArrayValue("finished_difficulties",difficultie); + if( false == s.ArrayContainsValue("finished_difficulties",difficulty) ) { + s.AppendArrayValue("finished_difficulties",difficulty); } Engine::Instance()->save_file_.QueueWriteInPlace(); } diff --git a/Source/Graphics/csg.cpp b/Source/Graphics/csg.cpp index bd758410..04531b4e 100644 --- a/Source/Graphics/csg.cpp +++ b/Source/Graphics/csg.cpp @@ -203,13 +203,13 @@ namespace { struct vec3d { double entries[3]; vec3d(double val){ - for(double & entrie : entries){ - entrie = val; + for(double & entry : entries){ + entry = val; } } vec3d(){ - for(double & entrie : entries){ - entrie = 0.0; + for(double & entry : entries){ + entry = 0.0; } } double& operator[](int which){ @@ -1056,8 +1056,8 @@ void AddCSGResult(const CSGResult &result, CSGModelInfo *csg_model, const Model& csg_model->faces.reserve(csg_model->faces.size()+result.indices.size()); int old_faces = csg_model->verts.size()/3; if(!flip){ - for(int indice : result.indices){ - csg_model->faces.push_back(indice + old_faces); + for(int index : result.indices){ + csg_model->faces.push_back(index + old_faces); } } else { for(int i=0, len=result.indices.size(); iCopyModel(base_model_id); Model& model = Models::Instance()->GetModel(model_id[0]); - for(float & vertice : model.vertices){ - vertice = 0.0f; + for(float & vertex : model.vertices){ + vertex = 0.0f; } for(float & tex_coord : model.tex_coords){ tex_coord = 0.0f; diff --git a/Source/Physics/bulletobject.cpp b/Source/Physics/bulletobject.cpp index 727d7dc5..6d1c163c 100644 --- a/Source/Physics/bulletobject.cpp +++ b/Source/Physics/bulletobject.cpp @@ -524,8 +524,8 @@ void BulletObject::CheckForNAN() { btTransform bt_transform; GetDisplayTransform(&bt_transform); mat4 test_mat = SafeGetOpenGLMatrix(body->getWorldTransform()); - for(float entrie : test_mat.entries){ - if(entrie != entrie){ + for(float entry : test_mat.entries){ + if(entry != entry){ LOGE << "NAN found in BulletObject" << std::endl; break; } -- cgit v1.2.3