summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/tilemap.cpp
diff options
context:
space:
mode:
author AJR <ajrhacker@users.noreply.github.com>2016-03-31 09:43:53 -0400
committer AJR <ajrhacker@users.noreply.github.com>2016-03-31 09:43:53 -0400
commita7e393b36b57cead61978f332135a509b2ddc82a (patch)
tree4d0d9a4b83d394e8706bd0475f379b5f468c43b1 /src/emu/tilemap.cpp
parent677cfa86fd8675dd15cc6cde0e26fd216823c61b (diff)
Iterate over core classes C++11 style
C++11 range-based for loops can now iterate over simple_list, tagged_list, core_options, device_t::subdevice_list, device_t::interface_list, render_primitive_list and all subclasses of the above, and much code has been refactored to use them. Most core classes that have these lists as members now have methods that return the lists themselves, replacing most of the methods that returned the object at an owned list's head. (A few have been retained due to their use in drivers or OSD.) device_t now manages subdevice and interface lists through subclasses, but has given up the work of adding and removing subdevices to machine_config. memory_manager has its tagged lists exposed, though the old rooted tag lookup methods have been removed (they were privatized already).
Diffstat (limited to 'src/emu/tilemap.cpp')
-rw-r--r--src/emu/tilemap.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/emu/tilemap.cpp b/src/emu/tilemap.cpp
index 807c1b30cf8..69bde8821c0 100644
--- a/src/emu/tilemap.cpp
+++ b/src/emu/tilemap.cpp
@@ -1503,11 +1503,11 @@ tilemap_manager::~tilemap_manager()
while (found)
{
found = false;
- for (tilemap_t *tmap = m_tilemap_list.first(); tmap != nullptr; tmap = tmap->next())
- if (tmap->device() != nullptr)
+ for (tilemap_t &tmap : m_tilemap_list)
+ if (tmap.device() != nullptr)
{
found = true;
- m_tilemap_list.detach(*tmap);
+ m_tilemap_list.detach(tmap);
break;
}
}
@@ -1553,8 +1553,8 @@ tilemap_t &tilemap_manager::create(device_gfx_interface &decoder, tilemap_get_in
void tilemap_manager::set_flip_all(UINT32 attributes)
{
- for (tilemap_t *tmap = m_tilemap_list.first(); tmap != nullptr; tmap = tmap->next())
- tmap->set_flip(attributes);
+ for (tilemap_t &tmap : m_tilemap_list)
+ tmap.set_flip(attributes);
}
@@ -1565,8 +1565,8 @@ void tilemap_manager::set_flip_all(UINT32 attributes)
void tilemap_manager::mark_all_dirty()
{
- for (tilemap_t *tmap = m_tilemap_list.first(); tmap != nullptr; tmap = tmap->next())
- tmap->mark_all_dirty();
+ for (tilemap_t &tmap : m_tilemap_list)
+ tmap.mark_all_dirty();
}