diff --git a/doc/samples/btphystest.cpp b/doc/samples/btphystest.cpp index da6c1a25..a5a7ef4c 100644 --- a/doc/samples/btphystest.cpp +++ b/doc/samples/btphystest.cpp @@ -347,10 +347,10 @@ BtPhysTest::~BtPhysTest() objects << m_physobj_list.last().m1; m_physobj_list.pop(); } - m_ground_list.empty(); - m_stairs_list.empty(); - m_character_list.empty(); - m_platform_list.empty(); + m_ground_list.clear(); + m_stairs_list.clear(); + m_character_list.clear(); + m_platform_list.clear(); while (objects.count()) { diff --git a/doc/samples/meshviewer/meshviewer.cpp b/doc/samples/meshviewer/meshviewer.cpp index d65c1e0b..b50ee181 100644 --- a/doc/samples/meshviewer/meshviewer.cpp +++ b/doc/samples/meshviewer/meshviewer.cpp @@ -75,7 +75,7 @@ LOLFX_RESOURCE_DECLARE(shinymvtexture); class TargetCamera { public: - void EmptyTargets() { m_targets.empty(); } + void EmptyTargets() { m_targets.clear(); } void AddTarget(vec3 new_target) { m_targets << new_target; } //This considers the box usage A to B as top-left to bottom-right void AddTarget(box3 new_target) @@ -136,7 +136,7 @@ void EasyMeshLoadJob::RetrieveResult(class MeshViewer* app) { for (EasyMeshViewerObject* mesh : m_meshes) app->AddViewerObj(mesh); - m_meshes.empty(); + m_meshes.clear(); } //MeshViewer ------------------------------------------------------------------ @@ -245,7 +245,7 @@ void MeshViewer::UpdateSceneSetup(bool only_destroy) //Delete previous setups for (auto &key : m_ssetups) delete key.second; - m_ssetups.empty(); + m_ssetups.clear(); if (m_ssetup_file_status) { m_file_check->UnregisterFile(m_ssetup_file_status); @@ -305,8 +305,8 @@ void MeshViewer::TickGame(float seconds) //static array mesh_names_str; //Draw viewer objects - m_menu_mesh_names_char.empty(); - m_menu_mesh_names_str.empty(); + m_menu_mesh_names_char.clear(); + m_menu_mesh_names_str.clear(); for (ViewerObject* obj : m_objs) m_menu_mesh_names_str << obj->GetName(); for (auto const &str : m_menu_mesh_names_str) @@ -877,7 +877,7 @@ void MeshViewer::Update(float seconds) } } } - m_ssetup->m_custom_cmd.empty(); + m_ssetup->m_custom_cmd.clear(); #endif //ALL_FEATURES #if HAS_WEB diff --git a/doc/samples/meshviewer/scenesetup.cpp b/doc/samples/meshviewer/scenesetup.cpp index 05924f6b..23284f6b 100644 --- a/doc/samples/meshviewer/scenesetup.cpp +++ b/doc/samples/meshviewer/scenesetup.cpp @@ -58,7 +58,7 @@ bool SceneSetup::Shutdown(bool destroy) Ticker::Unref(m_lights[i]); if (destroy) - m_lights.empty(); + m_lights.clear(); return true; } diff --git a/doc/samples/physics/lolphysics.h b/doc/samples/physics/lolphysics.h index f96fe80b..eb44930e 100644 --- a/doc/samples/physics/lolphysics.h +++ b/doc/samples/physics/lolphysics.h @@ -49,10 +49,10 @@ struct RayCastResult } void Reset() { - m_collider_list.empty(); - m_hit_normal_list.empty(); - m_hit_point_list.empty(); - m_hit_fraction_list.empty(); + m_collider_list.clear(); + m_hit_normal_list.clear(); + m_hit_point_list.clear(); + m_hit_fraction_list.clear(); } array m_collider_list; diff --git a/doc/tutorial/12_voronoi.cpp b/doc/tutorial/12_voronoi.cpp index 2de20b2f..58108b38 100644 --- a/doc/tutorial/12_voronoi.cpp +++ b/doc/tutorial/12_voronoi.cpp @@ -181,7 +181,7 @@ public: m_cur_fbo = VoronoiFbo; else if (m_controller->WasKeyReleasedThisFrame(KEY_F3)) { - voronoi_points.empty(); + voronoi_points.clear(); if (mode == 0) { int i = 4; @@ -201,7 +201,7 @@ public: if (mode == 0) { - voronoi_points.empty(); + voronoi_points.clear(); int maxi = 6; for (int i = 0; i < maxi; ++i) { diff --git a/src/easymesh/easymeshbuild.h b/src/easymesh/easymeshbuild.h index 0eb4390f..e5b9f64d 100644 --- a/src/easymesh/easymeshbuild.h +++ b/src/easymesh/easymeshbuild.h @@ -536,7 +536,7 @@ public: void RegisterVertex(int vert_id, vec3 vert_coord); void RemoveVertex(int vert_id); bool GetMasterList(array &ret_master_list) { ret_master_list = master_list; return ret_master_list.count() > 0; } - void Clear() { vertex_list.empty(); } + void Clear() { vertex_list.clear(); } private: // array vertex_list; diff --git a/src/easymesh/easymeshcsg.cpp b/src/easymesh/easymeshcsg.cpp index 2c10f424..83ed1ee6 100644 --- a/src/easymesh/easymeshcsg.cpp +++ b/src/easymesh/easymeshcsg.cpp @@ -174,8 +174,8 @@ void EasyMesh::MeshCsg(CSGUsage csg_operation) } } #endif - vert_list.empty(); - tri_list.empty(); + vert_list.clear(); + tri_list.clear(); } } diff --git a/src/easymesh/easymeshinternal.cpp b/src/easymesh/easymeshinternal.cpp index b35e3af5..7733e226 100644 --- a/src/easymesh/easymeshinternal.cpp +++ b/src/easymesh/easymeshinternal.cpp @@ -186,7 +186,7 @@ void EasyMesh::VerticesCleanup() //2: Remove all unused vertices array old_vert = m_vert; int shift = 0; - m_vert.empty(); + m_vert.clear(); for (int i = 0; i < vert_ids.count(); ++i) { //Unused vertex, update the shift quantity instead of keeping it. diff --git a/src/easymesh/easymeshrender.cpp b/src/easymesh/easymeshrender.cpp index 7040b965..9f5200b0 100644 --- a/src/easymesh/easymeshrender.cpp +++ b/src/easymesh/easymeshrender.cpp @@ -88,8 +88,8 @@ GpuShaderData::GpuShaderData(uint16_t vert_decl_flags, Shader* shader, DebugRend //----------------------------------------------------------------------------- GpuShaderData::~GpuShaderData() { - m_shader_uniform.empty(); - m_shader_attrib.empty(); + m_shader_uniform.clear(); + m_shader_attrib.clear(); } //----------------------------------------------------------------------------- @@ -228,8 +228,8 @@ GpuEasyMeshData::GpuEasyMeshData() //----------------------------------------------------------------------------- GpuEasyMeshData::~GpuEasyMeshData() { - m_gpudatas.empty(); - m_vdatas.empty(); + m_gpudatas.clear(); + m_vdatas.clear(); if (m_ibo) delete m_ibo; } diff --git a/src/easymesh/easymeshtransform.cpp b/src/easymesh/easymeshtransform.cpp index 8c5f818e..bf8c9e9e 100644 --- a/src/easymesh/easymeshtransform.cpp +++ b/src/easymesh/easymeshtransform.cpp @@ -397,12 +397,12 @@ void EasyMesh::SmoothMesh(int main_pass, int split_per_main_pass, int smooth_per while (smooth_pass--) { - master_list.empty(); + master_list.clear(); if (vert_dict.GetMasterList(master_list)) { for (int i = 0; i < master_list.count(); i++) { - connected_vert.empty(); + connected_vert.clear(); if (vert_dict.FindConnectedVertices(master_list[i], m_indices, m_cursors.last().m2, connected_vert)) { //Calculate vertices sum @@ -421,7 +421,7 @@ void EasyMesh::SmoothMesh(int main_pass, int split_per_main_pass, int smooth_per vec3 new_vert = (alpha * smooth_buf[smbuf][master_list[i] - m_cursors.last().m1] + vert_sum) / (alpha + n); //Set all matching vertices to new value - matching_ids.empty(); + matching_ids.clear(); matching_ids << master_list[i]; vert_dict.FindMatchingVertices(master_list[i], matching_ids); for (int j = 0; j < matching_ids.count(); j++) diff --git a/src/engine/ticker.cpp b/src/engine/ticker.cpp index 17632136..29af6c7c 100644 --- a/src/engine/ticker.cpp +++ b/src/engine/ticker.cpp @@ -388,7 +388,7 @@ void TickerData::GameThreadTick() } data->m_todolist = data->m_todolist_delayed; - data->m_todolist_delayed.empty(); + data->m_todolist_delayed.clear(); /* Tick objects for the game loop */ for (int g = Entity::GAMEGROUP_BEGIN; g < Entity::GAMEGROUP_END && !data->quit /* Stop as soon as required */; ++g) diff --git a/src/gpu/renderer.cpp b/src/gpu/renderer.cpp index c6f3551f..2f2ebf8c 100644 --- a/src/gpu/renderer.cpp +++ b/src/gpu/renderer.cpp @@ -165,7 +165,7 @@ void Renderer::DestroyAll() { for (Renderer* renderer : g_renderers) delete renderer; - g_renderers.empty(); + g_renderers.clear(); } /* diff --git a/src/gpu/shader.cpp b/src/gpu/shader.cpp index 77ce6a9f..483b2557 100644 --- a/src/gpu/shader.cpp +++ b/src/gpu/shader.cpp @@ -982,7 +982,7 @@ void ShaderBuilder::Build(std::string& code) //Cleanup first for (int prog = 0; prog < ShaderProgram::MAX; prog++) for (int var = 0; var < ShaderVariable::MAX; var++) - m_parameters[prog][var].empty(); + m_parameters[prog][var].clear(); //Start building for (int prog = 0; prog < ShaderProgram::MAX; prog++) diff --git a/src/image/image.cpp b/src/image/image.cpp index f9501b09..8aa613bb 100644 --- a/src/image/image.cpp +++ b/src/image/image.cpp @@ -131,7 +131,7 @@ void image::resize(ivec2 size) { for (auto &kv : m_data->m_pixels) delete kv.second; - m_data->m_pixels.empty(); + m_data->m_pixels.clear(); m_data->m_format = PixelFormat::Unknown; } diff --git a/src/input/controller.cpp b/src/input/controller.cpp index 0c2222da..286df331 100644 --- a/src/input/controller.cpp +++ b/src/input/controller.cpp @@ -61,7 +61,7 @@ bool KeyBinding::Unbind(const std::string& device_name, const std::string& key_n void KeyBinding::ClearBindings() { - m_keybindings.empty(); + m_keybindings.clear(); } /////////////////////////////////////////////////////////////////////////////// @@ -190,8 +190,8 @@ bool AxisBinding::UnbindKeys(const std::string& device_name, const std::string& void AxisBinding::ClearBindings() { - m_axisbindings.empty(); - m_keybindings.empty(); + m_axisbindings.clear(); + m_keybindings.clear(); } float AxisBinding::RetrieveCurrentValue() @@ -390,8 +390,8 @@ void Controller::UnbindProfile() if (m_joystick_idx.find(axis.m_joy) != INDEX_NONE) GetAxis(axis.m_idx).UnbindJoystick(axis.m_joy, axis.m_name); } - m_joystick.empty(); - m_joystick_idx.empty(); + m_joystick.clear(); + m_joystick_idx.clear(); m_mutex.unlock(); } diff --git a/src/lol/algorithm/aabb_tree.h b/src/lol/algorithm/aabb_tree.h index 05981a08..e5178ddb 100644 --- a/src/lol/algorithm/aabb_tree.h +++ b/src/lol/algorithm/aabb_tree.h @@ -302,7 +302,7 @@ private: //Extract elements array elements = m_tree[leaf].m_elements; elements.push_unique(AddElement(element)); - m_tree[leaf].m_elements.empty(); + m_tree[leaf].m_elements.clear(); //Add children for (size_t j = 0; j < child_nb; ++j) m_tree[leaf].m_children[j] = AddLeaf(leaf); @@ -331,8 +331,8 @@ public: bool FindElements(const TB& bbox, array& elements) { return TestLeaf(0, GetAABB(), bbox, elements); } void Clear() { - m_tree.empty(); - m_elements.empty(); + m_tree.clear(); + m_elements.clear(); } //-- diff --git a/src/lol/algorithm/portal.h b/src/lol/algorithm/portal.h index 3d239db4..619f609b 100644 --- a/src/lol/algorithm/portal.h +++ b/src/lol/algorithm/portal.h @@ -260,7 +260,7 @@ public: { for (auto door : m_doors) door->DisconnectRoom(this); - m_doors.empty(); + m_doors.clear(); } PortalRoom& operator<<(class PortalDoor* door) @@ -294,8 +294,8 @@ public: delete door; for (auto room : m_rooms) delete room; - m_doors.empty(); - m_rooms.empty(); + m_doors.clear(); + m_rooms.clear(); } //Visible room getter diff --git a/src/lol/base/array.h b/src/lol/base/array.h index e7278e53..dc65ee32 100644 --- a/src/lol/base/array.h +++ b/src/lol/base/array.h @@ -367,7 +367,7 @@ public: m_count = item_count; } - inline void empty() + inline void clear() { remove(0, m_count); } diff --git a/src/messageservice.cpp b/src/messageservice.cpp index 1644dd62..2113a44e 100644 --- a/src/messageservice.cpp +++ b/src/messageservice.cpp @@ -45,7 +45,7 @@ MessageService::MessageService() MessageService::~MessageService() { - m_bucket.empty(); + m_bucket.clear(); } //Setup/Destroy @@ -131,7 +131,7 @@ bool MessageService::FetchAll(MessageBucket id, std::string& message, time_t& fi first_timestamp = bucket[0].m_timestamp; for (int i = 0; i < bucket.count(); ++i) message += bucket[i].m_message; - bucket.empty(); + bucket.clear(); return true; } } diff --git a/src/platform/nacl/nacl-instance.cpp b/src/platform/nacl/nacl-instance.cpp index 981ada6f..8b46b1c9 100644 --- a/src/platform/nacl/nacl-instance.cpp +++ b/src/platform/nacl/nacl-instance.cpp @@ -223,7 +223,7 @@ void NaClInputData::Tick(float seconds) } } } - m_input_events.empty(); + m_input_events.clear(); /* Handle mouse input */ if (IsViewportSizeValid()) diff --git a/src/scene.cpp b/src/scene.cpp index 330417d5..621010ff 100644 --- a/src/scene.cpp +++ b/src/scene.cpp @@ -89,7 +89,7 @@ void SceneDisplay::DestroyAll() { for (SceneDisplay* display : m_scene_displays) delete display; - m_scene_displays.empty(); + m_scene_displays.clear(); } /* ------------------------------------------------ */ @@ -374,9 +374,9 @@ void Scene::Reset() for (int i = 0; i < data->m_tile_api.m_bufs.count(); i++) delete data->m_tile_api.m_bufs[i]; - data->m_tile_api.m_bufs.empty(); + data->m_tile_api.m_bufs.clear(); - data->m_tile_api.m_lights.empty(); + data->m_tile_api.m_lights.clear(); } //---- Primitive source stuff ------------------------------------------------- @@ -446,7 +446,7 @@ void Scene::ReleaseAllPrimitiveSources(uintptr_t key) oldies.reserve(SceneData::m_prim_sources[key].count()); for (PrimitiveSource* source : SceneData::m_prim_sources[key]) oldies << source; - SceneData::m_prim_sources[key].empty(); + SceneData::m_prim_sources[key].clear(); } SceneData::m_prim_mutex.unlock(); @@ -807,7 +807,7 @@ void Scene::render_tiles() // XXX: rename to Blit() tiles[i].m_tileset->Unbind(); } - tiles.empty(); + tiles.clear(); shader->Unbind(); @@ -888,7 +888,7 @@ void Scene::render_lines(float seconds) data->m_line_api.m_vdecl->Unbind(); data->m_line_api.m_shader->Unbind(); - //data->m_line_api.m_lines.empty(); + //data->m_line_api.m_lines.clear(); delete vb; } diff --git a/src/sys/threadtypes.cpp b/src/sys/threadtypes.cpp index f6eb3986..b763b092 100644 --- a/src/sys/threadtypes.cpp +++ b/src/sys/threadtypes.cpp @@ -23,7 +23,7 @@ void DefaultThreadManager::AddJob(ThreadJob* job) bool DefaultThreadManager::GetWorkResult(array& results) { results += m_job_result; - m_job_result.empty(); + m_job_result.clear(); return results.count() > 0; } @@ -140,7 +140,7 @@ void FileUpdateTester::TickGame(float seconds) m_frame_count = 0; DispatchJob(m_job_done); - m_job_done.empty(); + m_job_done.clear(); } } diff --git a/src/t/sys/thread.cpp b/src/t/sys/thread.cpp index f240bb8f..00e48a96 100644 --- a/src/t/sys/thread.cpp +++ b/src/t/sys/thread.cpp @@ -93,7 +93,7 @@ lolunit_declare_fixture(thread_test) bool GetWorkResult(array& results) { results += m_job_result; - m_job_result.empty(); + m_job_result.clear(); msg::info("%s GETWORKRESULT (%i)\n", GetName().c_str(), results.count()); return results.count() > 0; } diff --git a/src/tileset.cpp b/src/tileset.cpp index 831c9a5d..6363c91f 100644 --- a/src/tileset.cpp +++ b/src/tileset.cpp @@ -148,7 +148,7 @@ std::string TileSet::GetName() const //New methods ----------------------------------------------------------------- void TileSet::clear_all() { - m_tileset_data->m_tiles.empty(); + m_tileset_data->m_tiles.clear(); } int TileSet::define_tile(ibox2 rect)