summaryrefslogtreecommitdiffstats
path: root/src/frontend/mame/ui/viewgfx.cpp
diff options
context:
space:
mode:
author Miodrag Milanovic <mmicko@gmail.com>2016-07-31 11:50:20 +0200
committer Miodrag Milanovic <mmicko@gmail.com>2016-07-31 14:41:02 +0200
commit9667c6a8cce1829a7321dde67bd0287c73234386 (patch)
treef3665957d557cb18728a40e75f7d9f2341aaff1d /src/frontend/mame/ui/viewgfx.cpp
parent69ac4affc86caac51ff9720083ed128dabdb932f (diff)
std::min and std:max instead of MIN and MAX, also some more macros converted to inline functions (nw)
Diffstat (limited to 'src/frontend/mame/ui/viewgfx.cpp')
-rw-r--r--src/frontend/mame/ui/viewgfx.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/frontend/mame/ui/viewgfx.cpp b/src/frontend/mame/ui/viewgfx.cpp
index 2a4e0ebad38..b19df247cfc 100644
--- a/src/frontend/mame/ui/viewgfx.cpp
+++ b/src/frontend/mame/ui/viewgfx.cpp
@@ -613,14 +613,14 @@ static void gfxset_handler(mame_ui_manager &mui, render_container &container, ui
info.columns[set] = xcells;
// worst case, we need a pixel scale of 1
- pixelscale = MAX(1, pixelscale);
+ pixelscale = std::max(1, pixelscale);
// in the Y direction, we just display as many as we can
ycells = cellboxheight / (pixelscale * cellypix);
// now determine the actual cellbox size
- cellboxwidth = MIN(cellboxwidth, xcells * pixelscale * cellxpix);
- cellboxheight = MIN(cellboxheight, ycells * pixelscale * cellypix);
+ cellboxwidth = std::min(cellboxwidth, xcells * pixelscale * cellxpix);
+ cellboxheight = std::min(cellboxheight, ycells * pixelscale * cellypix);
// compute the size of a single cell at this pixel scale factor, as well as the aspect ratio
cellwidth = (cellboxwidth / (float)xcells) / (float)targwidth;
@@ -998,12 +998,12 @@ static void tilemap_handler(mame_ui_manager &mui, render_container &container, u
{
for (maxxscale = 1; mapwidth * (maxxscale + 1) < mapboxwidth; maxxscale++) { }
for (maxyscale = 1; mapheight * (maxyscale + 1) < mapboxheight; maxyscale++) { }
- pixelscale = MIN(maxxscale, maxyscale);
+ pixelscale = std::min(maxxscale, maxyscale);
}
// recompute the final box size
- mapboxwidth = MIN(mapboxwidth, mapwidth * pixelscale);
- mapboxheight = MIN(mapboxheight, mapheight * pixelscale);
+ mapboxwidth = std::min(mapboxwidth, int(mapwidth * pixelscale));
+ mapboxheight = std::min(mapboxheight, int(mapheight * pixelscale));
// recompute the bounds, centered within the existing bounds
mapboxbounds.x0 += 0.5f * ((mapboxbounds.x1 - mapboxbounds.x0) - (float)mapboxwidth / (float)targwidth);