summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/rendlay.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/emu/rendlay.c')
-rw-r--r--src/emu/rendlay.c27
1 files changed, 15 insertions, 12 deletions
diff --git a/src/emu/rendlay.c b/src/emu/rendlay.c
index 97342836972..2f9393180e1 100644
--- a/src/emu/rendlay.c
+++ b/src/emu/rendlay.c
@@ -452,19 +452,22 @@ layout_element::layout_element(running_machine &machine, xml_data_node &elemnode
m_maxstate = 65536;
}
- // determine the scale/offset for normalization
- float xoffs = bounds.x0;
- float yoffs = bounds.y0;
- float xscale = 1.0f / (bounds.x1 - bounds.x0);
- float yscale = 1.0f / (bounds.y1 - bounds.y0);
-
- // normalize all the component bounds
- for (component *curcomp = m_complist.first(); curcomp != NULL; curcomp = curcomp->next())
+ if (m_complist.first() != NULL)
{
- curcomp->m_bounds.x0 = (curcomp->m_bounds.x0 - xoffs) * xscale;
- curcomp->m_bounds.x1 = (curcomp->m_bounds.x1 - xoffs) * xscale;
- curcomp->m_bounds.y0 = (curcomp->m_bounds.y0 - yoffs) * yscale;
- curcomp->m_bounds.y1 = (curcomp->m_bounds.y1 - yoffs) * yscale;
+ // determine the scale/offset for normalization
+ float xoffs = bounds.x0;
+ float yoffs = bounds.y0;
+ float xscale = 1.0f / (bounds.x1 - bounds.x0);
+ float yscale = 1.0f / (bounds.y1 - bounds.y0);
+
+ // normalize all the component bounds
+ for (component *curcomp = m_complist.first(); curcomp != NULL; curcomp = curcomp->next())
+ {
+ curcomp->m_bounds.x0 = (curcomp->m_bounds.x0 - xoffs) * xscale;
+ curcomp->m_bounds.x1 = (curcomp->m_bounds.x1 - xoffs) * xscale;
+ curcomp->m_bounds.y0 = (curcomp->m_bounds.y0 - yoffs) * yscale;
+ curcomp->m_bounds.y1 = (curcomp->m_bounds.y1 - yoffs) * yscale;
+ }
}
// allocate an array of element textures for the states