public widgets_manager(running_machine machine) { m_hilight_bitmap = new bitmap_ptr(256, 1); m_hilight_texture = null; //, m_hilight_texture(nullptr, machine.render()) m_hilight_main_bitmap = new bitmap_ptr(1, 128); m_hilight_main_texture = null; //, m_hilight_main_texture(nullptr, machine.render()) m_arrow_texture = null; //, m_arrow_texture(nullptr, machine.render()) render_manager render = machine.render(); // create a texture for hilighting items for (UInt32 x = 0; x < 256; ++x) { UInt32 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); RawBuffer m_hilight_bitmapBuf; UInt32 m_hilight_bitmapOffset = m_hilight_bitmap.pix32(out m_hilight_bitmapBuf, 0, (int)x); m_hilight_bitmapBuf.set_uint32((int)m_hilight_bitmapOffset, new rgb_t((byte)alpha, 0xff, 0xff, 0xff)); } m_hilight_texture = render.texture_alloc(); //m_hilight_texture.reset(render.texture_alloc()); m_hilight_texture.set_bitmap(m_hilight_bitmap, m_hilight_bitmap.cliprect(), texture_format.TEXFORMAT_ARGB32); // create a texture for hilighting items in main menu for (UInt32 y = 0; y < 128; ++y) { UInt32 r1 = 0; UInt32 g1 = 169; UInt32 b1 = 255; // any start color UInt32 r2 = 0; UInt32 g2 = 39; UInt32 b2 = 130; // any stop color UInt32 r = r1 + (y * (r2 - r1) / 128); UInt32 g = g1 + (y * (g2 - g1) / 128); UInt32 b = b1 + (y * (b2 - b1) / 128); //m_hilight_main_bitmap->pix32(y, 0) = rgb_t(r, g, b); RawBuffer m_hilight_main_bitmapBuf; UInt32 m_hilight_main_bitmapOffset = m_hilight_main_bitmap.pix32(out m_hilight_main_bitmapBuf, (int)y, 0); m_hilight_main_bitmapBuf.set_uint32((int)m_hilight_main_bitmapOffset, new rgb_t((byte)r, (byte)g, (byte)b)); } m_hilight_main_texture = render.texture_alloc(); //m_hilight_main_texture.reset(render.texture_alloc()); m_hilight_main_texture.set_bitmap(m_hilight_main_bitmap, m_hilight_main_bitmap.cliprect(), texture_format.TEXFORMAT_ARGB32); // create a texture for arrow icons m_arrow_texture = render.texture_alloc(render_triangle); //m_arrow_texture.reset(render.texture_alloc(render_triangle)); }
public widgets_manager(running_machine machine) { m_hilight_bitmap = new bitmap_ptr(256, 1); m_hilight_texture = null; //, m_hilight_texture(nullptr, machine.render()) m_hilight_main_bitmap = new bitmap_ptr(1, 128); m_hilight_main_texture = null; //, m_hilight_main_texture(nullptr, machine.render()) m_arrow_texture = null; //, m_arrow_texture(nullptr, machine.render()) render_manager render = machine.render(); // create a texture for hilighting items for (unsigned x = 0; x < 256; ++x) { unsigned alpha = ((x < 25) ? (0xff * x / 25) : (x > (256 - 25)) ? (0xff * (255 - x) / 25) : 0xff); m_hilight_bitmap.pix(0, (int32_t)x)[0] = new rgb_t((uint8_t)alpha, 0xff, 0xff, 0xff); //m_hilight_bitmap->pix(0, x) = rgb_t(alpha, 0xff, 0xff, 0xff); } m_hilight_texture = render.texture_alloc(); //m_hilight_texture.reset(render.texture_alloc()); m_hilight_texture.set_bitmap(m_hilight_bitmap, m_hilight_bitmap.cliprect(), texture_format.TEXFORMAT_ARGB32); // create a texture for hilighting items in main menu for (unsigned y = 0; y < 128; ++y) { unsigned r1 = 0; unsigned g1 = 169; unsigned b1 = 255; // any start color unsigned r2 = 0; unsigned g2 = 39; unsigned b2 = 130; // any stop color unsigned r = r1 + (y * (r2 - r1) / 128); unsigned g = g1 + (y * (g2 - g1) / 128); unsigned b = b1 + (y * (b2 - b1) / 128); m_hilight_main_bitmap.pix((int32_t)y, 0)[0] = new rgb_t((uint8_t)r, (uint8_t)g, (uint8_t)b); //m_hilight_main_bitmap->pix(y, 0) = rgb_t(r, g, b); } m_hilight_main_texture = render.texture_alloc(); //m_hilight_main_texture.reset(render.texture_alloc()); m_hilight_main_texture.set_bitmap(m_hilight_main_bitmap, m_hilight_main_bitmap.cliprect(), texture_format.TEXFORMAT_ARGB32); // create a texture for arrow icons m_arrow_texture = render.texture_alloc(render_triangle); //m_arrow_texture.reset(render.texture_alloc(render_triangle)); }