summaryrefslogtreecommitdiffstatshomepage
path: root/src/frontend/mame/ui
diff options
context:
space:
mode:
Diffstat (limited to 'src/frontend/mame/ui')
-rw-r--r--src/frontend/mame/ui/selmenu.cpp14
-rw-r--r--src/frontend/mame/ui/ui.cpp2
-rw-r--r--src/frontend/mame/ui/viewgfx.cpp10
-rw-r--r--src/frontend/mame/ui/widgets.cpp23
4 files changed, 22 insertions, 27 deletions
diff --git a/src/frontend/mame/ui/selmenu.cpp b/src/frontend/mame/ui/selmenu.cpp
index 92bdd3ada64..cfcb6175dc5 100644
--- a/src/frontend/mame/ui/selmenu.cpp
+++ b/src/frontend/mame/ui/selmenu.cpp
@@ -392,9 +392,9 @@ menu_select_launch::cache::cache(running_machine &machine)
// create a texture for snapshot
m_snapx_texture.reset(render.texture_alloc(render_texture::hq_scale));
- std::memcpy(&m_no_avail_bitmap.pix32(0), no_avail_bmp, 256 * 256 * sizeof(uint32_t));
+ std::memcpy(&m_no_avail_bitmap.pix(0), no_avail_bmp, 256 * 256 * sizeof(uint32_t));
- std::memcpy(&m_star_bitmap.pix32(0), favorite_star_bmp, 32 * 32 * sizeof(uint32_t));
+ std::memcpy(&m_star_bitmap.pix(0), favorite_star_bmp, 32 * 32 * sizeof(uint32_t));
m_star_texture.reset(render.texture_alloc());
m_star_texture->set_bitmap(m_star_bitmap, m_star_bitmap.cliprect(), TEXFORMAT_ARGB32);
@@ -410,7 +410,7 @@ menu_select_launch::cache::cache(running_machine &machine)
m_toolbar_texture.emplace_back(render.texture_alloc(), render);
m_sw_toolbar_texture.emplace_back(render.texture_alloc(), render);
- std::memcpy(&m_toolbar_bitmap.back().pix32(0), toolbar_bitmap_bmp[i], 32 * 32 * sizeof(uint32_t));
+ std::memcpy(&m_toolbar_bitmap.back().pix(0), toolbar_bitmap_bmp[i], 32 * 32 * sizeof(uint32_t));
if (m_toolbar_bitmap.back().valid())
m_toolbar_texture.back()->set_bitmap(m_toolbar_bitmap.back(), m_toolbar_bitmap.back().cliprect(), TEXFORMAT_ARGB32);
else
@@ -418,7 +418,7 @@ menu_select_launch::cache::cache(running_machine &machine)
if ((i == 0U) || (i == 2U))
{
- std::memcpy(&m_sw_toolbar_bitmap.back().pix32(0), toolbar_bitmap_bmp[i], 32 * 32 * sizeof(uint32_t));
+ std::memcpy(&m_sw_toolbar_bitmap.back().pix(0), toolbar_bitmap_bmp[i], 32 * 32 * sizeof(uint32_t));
if (m_sw_toolbar_bitmap.back().valid())
m_sw_toolbar_texture.back()->set_bitmap(m_sw_toolbar_bitmap.back(), m_sw_toolbar_bitmap.back().cliprect(), TEXFORMAT_ARGB32);
else
@@ -1147,7 +1147,7 @@ bool menu_select_launch::scale_icon(bitmap_argb32 &&src, texture_and_bitmap &dst
dst.bitmap.allocate(max_width, max_height);
for (int y = 0; tmp.height() > y; ++y)
for (int x = 0; tmp.width() > x; ++x)
- dst.bitmap.pix32(y, x) = tmp.pix32(y, x);
+ dst.bitmap.pix(y, x) = tmp.pix(y, x);
dst.texture->set_bitmap(dst.bitmap, dst.bitmap.cliprect(), TEXFORMAT_ARGB32);
return true;
}
@@ -2412,7 +2412,7 @@ void menu_select_launch::arts_render_images(bitmap_argb32 &&tmp_bitmap, float or
for (int x = 0; x < 256; x++)
{
for (int y = 0; y < 256; y++)
- tmp_bitmap.pix32(y, x) = src.pix32(y, x);
+ tmp_bitmap.pix(y, x) = src.pix(y, x);
}
no_available = true;
}
@@ -2475,7 +2475,7 @@ void menu_select_launch::arts_render_images(bitmap_argb32 &&tmp_bitmap, float or
for (int x = 0; x < dest_xPixel; x++)
for (int y = 0; y < dest_yPixel; y++)
- snapx_bitmap.pix32(y + y1, x + x1) = dest_bitmap.pix32(y, x);
+ snapx_bitmap.pix(y + y1, x + x1) = dest_bitmap.pix(y, x);
// apply bitmap
m_cache->snapx_texture()->set_bitmap(snapx_bitmap, snapx_bitmap.cliprect(), TEXFORMAT_ARGB32);
diff --git a/src/frontend/mame/ui/ui.cpp b/src/frontend/mame/ui/ui.cpp
index ff16d117117..c229110caac 100644
--- a/src/frontend/mame/ui/ui.cpp
+++ b/src/frontend/mame/ui/ui.cpp
@@ -216,7 +216,7 @@ void mame_ui_manager::init()
config_save_delegate(&mame_ui_manager::config_save, this));
// create mouse bitmap
- uint32_t *dst = &m_mouse_bitmap.pix32(0);
+ uint32_t *dst = &m_mouse_bitmap.pix(0);
memcpy(dst,mouse_bitmap,32*32*sizeof(uint32_t));
m_mouse_arrow_texture = machine().render().texture_alloc();
m_mouse_arrow_texture->set_bitmap(m_mouse_bitmap, m_mouse_bitmap.cliprect(), TEXFORMAT_ARGB32);
diff --git a/src/frontend/mame/ui/viewgfx.cpp b/src/frontend/mame/ui/viewgfx.cpp
index 5b4d187bc95..bc6dee9cd47 100644
--- a/src/frontend/mame/ui/viewgfx.cpp
+++ b/src/frontend/mame/ui/viewgfx.cpp
@@ -994,18 +994,16 @@ static void gfxset_draw_item(running_machine &machine, gfx_element &gfx, int ind
{
int width = (rotate & ORIENTATION_SWAP_XY) ? gfx.height() : gfx.width();
int height = (rotate & ORIENTATION_SWAP_XY) ? gfx.width() : gfx.height();
- const rgb_t *palette = dpalette->palette()->entry_list_raw() + gfx.colorbase() + color * gfx.granularity();
-
- int x, y;
+ rgb_t const *const palette = dpalette->palette()->entry_list_raw() + gfx.colorbase() + color * gfx.granularity();
// loop over rows in the cell
- for (y = 0; y < height; y++)
+ for (int y = 0; y < height; y++)
{
- uint32_t *dest = &bitmap.pix32(dsty + y, dstx);
+ uint32_t *dest = &bitmap.pix(dsty + y, dstx);
const uint8_t *src = gfx.get_data(index);
// loop over columns in the cell
- for (x = 0; x < width; x++)
+ for (int x = 0; x < width; x++)
{
int effx = x, effy = y;
const uint8_t *s;
diff --git a/src/frontend/mame/ui/widgets.cpp b/src/frontend/mame/ui/widgets.cpp
index d8907303b36..59fda0f203c 100644
--- a/src/frontend/mame/ui/widgets.cpp
+++ b/src/frontend/mame/ui/widgets.cpp
@@ -36,7 +36,7 @@ widgets_manager::widgets_manager(running_machine &machine)
for (unsigned x = 0; x < 256; ++x)
{
unsigned const alpha((x < 25) ? (0xff * x / 25) : (x >(256 - 25)) ? (0xff * (255 - x) / 25) : 0xff);
- m_hilight_bitmap->pix32(0, x) = rgb_t(alpha, 0xff, 0xff, 0xff);
+ m_hilight_bitmap->pix(0, x) = rgb_t(alpha, 0xff, 0xff, 0xff);
}
m_hilight_texture.reset(render.texture_alloc());
m_hilight_texture->set_bitmap(*m_hilight_bitmap, m_hilight_bitmap->cliprect(), TEXFORMAT_ARGB32);
@@ -49,7 +49,7 @@ widgets_manager::widgets_manager(running_machine &machine)
unsigned const r = r1 + (y * (r2 - r1) / 128);
unsigned const g = g1 + (y * (g2 - g1) / 128);
unsigned const b = b1 + (y * (b2 - b1) / 128);
- m_hilight_main_bitmap->pix32(y, 0) = rgb_t(r, g, b);
+ m_hilight_main_bitmap->pix(y, 0) = rgb_t(r, g, b);
}
m_hilight_main_texture.reset(render.texture_alloc());
m_hilight_main_texture->set_bitmap(*m_hilight_main_bitmap, m_hilight_main_bitmap->cliprect(), TEXFORMAT_ARGB32);
@@ -67,18 +67,17 @@ widgets_manager::widgets_manager(running_machine &machine)
void widgets_manager::render_triangle(bitmap_argb32 &dest, bitmap_argb32 &source, const rectangle &sbounds, void *param)
{
- int halfwidth = dest.width() / 2;
- int height = dest.height();
- int x, y;
+ int const halfwidth = dest.width() / 2;
+ int const height = dest.height();
// start with all-transparent
dest.fill(rgb_t(0x00, 0x00, 0x00, 0x00));
// render from the tip to the bottom
- for (y = 0; y < height; y++)
+ for (int y = 0; y < height; y++)
{
int linewidth = (y * (halfwidth - 1) + (height / 2)) * 255 * 2 / height;
- uint32_t *target = &dest.pix32(y, halfwidth);
+ uint32_t *const target = &dest.pix(y, halfwidth);
// don't antialias if height < 12
if (dest.height() < 12)
@@ -89,25 +88,23 @@ void widgets_manager::render_triangle(bitmap_argb32 &dest, bitmap_argb32 &source
}
// loop while we still have data to generate
- for (x = 0; linewidth > 0; x++)
+ for (int x = 0; linewidth > 0; x++)
{
int dalpha;
-
- // first column we only consume one pixel
if (x == 0)
{
+ // first column we only consume one pixel
dalpha = std::min(0xff, linewidth);
target[x] = rgb_t(dalpha, 0xff, 0xff, 0xff);
}
-
- // remaining columns consume two pixels, one on each side
else
{
+ // remaining columns consume two pixels, one on each side
dalpha = std::min(0x1fe, linewidth);
target[x] = target[-x] = rgb_t(dalpha / 2, 0xff, 0xff, 0xff);
}
- // account for the weight we consumed */
+ // account for the weight we consumed
linewidth -= dalpha;
}
}