summaryrefslogtreecommitdiffstatshomepage
path: root/src/emu/rendutil.h
diff options
context:
space:
mode:
author Vas Crabb <vas@vastheman.com>2017-07-29 15:17:14 +1000
committer Vas Crabb <vas@vastheman.com>2017-07-29 15:17:14 +1000
commit3a5c5d15c717e13c5bea47614096defd50db1146 (patch)
tree486c1e4e28d523a9baf5054520df8d9068ede5ec /src/emu/rendutil.h
parent9cea5e1518bcd59181cd3428d67b3d4cfa06fa98 (diff)
Add support for layout item groups, replace simple_list with more
appropriate containers, remove misleading const qualifiers, reduce repeated XML walking. (nw) Groups aren't parameterised, so they aren't as useful as they could be (yes, it's on my TODO list). However, it's already useful for putting a common set of elements in multiple views, potentially at different locations/scales. See intlc44.lay and intlc440.lay for examples of the level of copypasta this can eliminate. Be aware that groups with explicit bounds don't clip thair content, it's only used for calucating the transform matrix.
Diffstat (limited to 'src/emu/rendutil.h')
-rw-r--r--src/emu/rendutil.h40
1 files changed, 20 insertions, 20 deletions
diff --git a/src/emu/rendutil.h b/src/emu/rendutil.h
index ba74f8696ed..b84fc60f704 100644
--- a/src/emu/rendutil.h
+++ b/src/emu/rendutil.h
@@ -52,12 +52,12 @@ static inline float render_round_nearest(float f)
bounds
-------------------------------------------------*/
-static inline void set_render_bounds_xy(render_bounds *bounds, float x0, float y0, float x1, float y1)
+static inline void set_render_bounds_xy(render_bounds &bounds, float x0, float y0, float x1, float y1)
{
- bounds->x0 = x0;
- bounds->y0 = y0;
- bounds->x1 = x1;
- bounds->y1 = y1;
+ bounds.x0 = x0;
+ bounds.y0 = y0;
+ bounds.x1 = x1;
+ bounds.y1 = y1;
}
@@ -66,12 +66,12 @@ static inline void set_render_bounds_xy(render_bounds *bounds, float x0, float y
bounds
-------------------------------------------------*/
-static inline void set_render_bounds_wh(render_bounds *bounds, float x0, float y0, float width, float height)
+static inline void set_render_bounds_wh(render_bounds &bounds, float x0, float y0, float width, float height)
{
- bounds->x0 = x0;
- bounds->y0 = y0;
- bounds->x1 = x0 + width;
- bounds->y1 = y0 + height;
+ bounds.x0 = x0;
+ bounds.y0 = y0;
+ bounds.x1 = x0 + width;
+ bounds.y1 = y0 + height;
}
@@ -80,12 +80,12 @@ static inline void set_render_bounds_wh(render_bounds *bounds, float x0, float y
of two render_bounds
-------------------------------------------------*/
-static inline void sect_render_bounds(render_bounds *dest, const render_bounds *src)
+static inline void sect_render_bounds(render_bounds &dest, const render_bounds &src)
{
- dest->x0 = (dest->x0 > src->x0) ? dest->x0 : src->x0;
- dest->x1 = (dest->x1 < src->x1) ? dest->x1 : src->x1;
- dest->y0 = (dest->y0 > src->y0) ? dest->y0 : src->y0;
- dest->y1 = (dest->y1 < src->y1) ? dest->y1 : src->y1;
+ dest.x0 = (std::max)(dest.x0, src.x0);
+ dest.x1 = (std::min)(dest.x1, src.x1);
+ dest.y0 = (std::max)(dest.y0, src.y0);
+ dest.y1 = (std::min)(dest.y1, src.y1);
}
@@ -94,12 +94,12 @@ static inline void sect_render_bounds(render_bounds *dest, const render_bounds *
render_bounds
-------------------------------------------------*/
-static inline void union_render_bounds(render_bounds *dest, const render_bounds *src)
+static inline void union_render_bounds(render_bounds &dest, const render_bounds &src)
{
- dest->x0 = (dest->x0 < src->x0) ? dest->x0 : src->x0;
- dest->x1 = (dest->x1 > src->x1) ? dest->x1 : src->x1;
- dest->y0 = (dest->y0 < src->y0) ? dest->y0 : src->y0;
- dest->y1 = (dest->y1 > src->y1) ? dest->y1 : src->y1;
+ dest.x0 = (std::min)(dest.x0, src.x0);
+ dest.x1 = (std::max)(dest.x1, src.x1);
+ dest.y0 = (std::min)(dest.y0, src.y0);
+ dest.y1 = (std::max)(dest.y1, src.y1);
}