diff options
author | Stephan Vedder <vedder@mbits.info> | 2022-05-04 15:27:53 +0300 |
---|---|---|
committer | Stephan Vedder <vedder@mbits.info> | 2022-05-04 15:27:53 +0300 |
commit | 30be6f88713ed6e1b043cc72cafc1df7728f0710 (patch) | |
tree | f0805b211499a86add4d85e250321c538a0b1e84 | |
parent | 9204c6ca624c21f21436e11d4aead126a481ec8a (diff) |
Manually improve generated changes
-rw-r--r-- | Source/Editors/map_editor.cpp | 21 | ||||
-rw-r--r-- | Source/GUI/dimgui/settings_screen.cpp | 16 | ||||
-rw-r--r-- | Source/Graphics/csg.cpp | 12 | ||||
-rw-r--r-- | Source/Graphics/lightprobecollection.cpp | 8 | ||||
-rw-r--r-- | Source/Graphics/model.cpp | 26 | ||||
-rw-r--r-- | Source/Math/mat4.cpp | 4 | ||||
-rw-r--r-- | Source/Objects/riggedobject.cpp | 4 | ||||
-rw-r--r-- | 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<int> 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<std::string> 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<ModInstance::Campaign> 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(); i<len; i+=3){ diff --git a/Source/Graphics/lightprobecollection.cpp b/Source/Graphics/lightprobecollection.cpp index 8280a03c..b255ad87 100644 --- a/Source/Graphics/lightprobecollection.cpp +++ b/Source/Graphics/lightprobecollection.cpp @@ -934,15 +934,15 @@ void LightProbeCollection::Draw(BulletWorld& bw) { CHECK_GL_ERROR(); // Check long name if short name is not found - for(unsigned int indice : indices){ - if(indice == GL_INVALID_INDEX){ + for(unsigned int index : indices){ + if(index == GL_INVALID_INDEX){ glGetUniformIndices(programHandle, 5, &names[5], indices); break; } } - for(unsigned int indice : indices){ - if(indice == GL_INVALID_INDEX){ + for(unsigned int index : indices){ + if(index == GL_INVALID_INDEX){ return; } } diff --git a/Source/Graphics/model.cpp b/Source/Graphics/model.cpp index be0f3a71..ca4b61a0 100644 --- a/Source/Graphics/model.cpp +++ b/Source/Graphics/model.cpp @@ -858,9 +858,9 @@ void CopyTexCoords2( Model &a, const Model& b ) { [floorf(n_i[2]*100.0f)]; normal_index += 3; vert_index += 3; - for(int indice : indices){ - a.tex_coords2[indice*2+0] = b.tex_coords[i*2+0]; - a.tex_coords2[indice*2+1] = b.tex_coords[i*2+1]; + for(int index : indices){ + a.tex_coords2[index*2+0] = b.tex_coords[i*2+0]; + a.tex_coords2[index*2+1] = b.tex_coords[i*2+1]; } } @@ -900,12 +900,12 @@ void CopyTexCoords2( Model &a, const Model& b ) { [floorf(n_i[2]*10.0f+0.5f)]; normal_index += 3; vert_index += 3; - for(int indice : indices){ - if(a.tex_coords2[indice*2+0] == 0.0f && - a.tex_coords2[indice*2+1] == 0.0f) + for(int index : indices){ + if(a.tex_coords2[index*2+0] == 0.0f && + a.tex_coords2[index*2+1] == 0.0f) { - a.tex_coords2[indice*2+0] = b.tex_coords[i*2+0]; - a.tex_coords2[indice*2+1] = b.tex_coords[i*2+1]; + a.tex_coords2[index*2+0] = b.tex_coords[i*2+0]; + a.tex_coords2[index*2+1] = b.tex_coords[i*2+1]; } } } @@ -946,12 +946,12 @@ void CopyTexCoords2( Model &a, const Model& b ) { [floorf(n_i[2]*1.0f+0.5f)]; normal_index += 3; vert_index += 3; - for(int indice : indices){ - if(a.tex_coords2[indice*2+0] == 0.0f && - a.tex_coords2[indice*2+1] == 0.0f) + for(int index : indices){ + if(a.tex_coords2[index*2+0] == 0.0f && + a.tex_coords2[index*2+1] == 0.0f) { - a.tex_coords2[indice*2+0] = b.tex_coords[i*2+0]; - a.tex_coords2[indice*2+1] = b.tex_coords[i*2+1]; + a.tex_coords2[index*2+0] = b.tex_coords[i*2+0]; + a.tex_coords2[index*2+1] = b.tex_coords[i*2+1]; } } } diff --git a/Source/Math/mat4.cpp b/Source/Math/mat4.cpp index b3a7ac19..45267242 100644 --- a/Source/Math/mat4.cpp +++ b/Source/Math/mat4.cpp @@ -437,8 +437,8 @@ mat4 mat4::operator-(void) const { mat4 result(*this); - for (float & entrie : result.entries) - entrie=-entrie; + for (float & entry : result.entries) + entry=-entry; return result; } diff --git a/Source/Objects/riggedobject.cpp b/Source/Objects/riggedobject.cpp index 3780c5b6..4e3857ed 100644 --- a/Source/Objects/riggedobject.cpp +++ b/Source/Objects/riggedobject.cpp @@ -2794,8 +2794,8 @@ void MorphTarget::Load(const std::string &base_model_name, } else { model_id[0] = Models::Instance()->CopyModel(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; } |