本文整理汇总了C++中screen_device::container方法的典型用法代码示例。如果您正苦于以下问题:C++ screen_device::container方法的具体用法?C++ screen_device::container怎么用?C++ screen_device::container使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类screen_device
的用法示例。
在下文中一共展示了screen_device::container方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: screen_update
UINT32 vector_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
UINT32 flags = PRIMFLAG_ANTIALIAS(machine().options().antialias() ? 1 : 0) | PRIMFLAG_BLENDMODE(BLENDMODE_ADD) | PRIMFLAG_VECTOR(1);
const rectangle &visarea = screen.visible_area();
float xscale = 1.0f / (65536 * visarea.width());
float yscale = 1.0f / (65536 * visarea.height());
float xoffs = (float)visarea.min_x;
float yoffs = (float)visarea.min_y;
point *curpoint;
int lastx = 0;
int lasty = 0;
curpoint = m_vector_list.get();
screen.container().empty();
screen.container().add_rect(0.0f, 0.0f, 1.0f, 1.0f, rgb_t(0xff,0x00,0x00,0x00), PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_VECTORBUF(1));
for (int i = 0; i < m_vector_index; i++)
{
render_bounds coords;
float intensity = (float)curpoint->intensity / 255.0f;
float intensity_weight = normalized_sigmoid(intensity, vector_options::s_beam_intensity_weight);
// check for static intensity
float beam_width = m_min_intensity == m_max_intensity
? vector_options::s_beam_width_min
: vector_options::s_beam_width_min + intensity_weight * (vector_options::s_beam_width_max - vector_options::s_beam_width_min);
// normalize width
beam_width *= 1.0f / (float)VECTOR_WIDTH_DENOM;
coords.x0 = ((float)lastx - xoffs) * xscale;
coords.y0 = ((float)lasty - yoffs) * yscale;
coords.x1 = ((float)curpoint->x - xoffs) * xscale;
coords.y1 = ((float)curpoint->y - yoffs) * yscale;
if (curpoint->intensity != 0)
{
screen.container().add_line(
coords.x0, coords.y0, coords.x1, coords.y1,
beam_width,
(curpoint->intensity << 24) | (curpoint->col & 0xffffff),
flags);
}
lastx = curpoint->x;
lasty = curpoint->y;
curpoint++;
}
return 0;
}
示例2: screen_update
UINT32 laserdisc_device::screen_update(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
// handle the overlay if present
screen_bitmap &overbitmap = m_overbitmap[m_overindex];
if (overbitmap.valid() && (!m_overupdate_ind16.isnull() || !m_overupdate_rgb32.isnull()))
{
// scale the cliprect to the overlay size
rectangle clip(m_overclip);
clip.min_y = cliprect.min_y * overbitmap.height() / bitmap.height();
if (cliprect.min_y == screen.visible_area().min_y)
clip.min_y = MIN(clip.min_y, m_overclip.min_y);
clip.max_y = (cliprect.max_y + 1) * overbitmap.height() / bitmap.height() - 1;
// call the update callback
if (!m_overupdate_ind16.isnull())
m_overupdate_ind16(screen, overbitmap.as_ind16(), clip);
else
m_overupdate_rgb32(screen, overbitmap.as_rgb32(), clip);
}
// if this is the last update, do the rendering
if (cliprect.max_y == screen.visible_area().max_y)
{
// update the texture with the overlay contents
if (overbitmap.valid())
m_overtex->set_bitmap(overbitmap, m_overclip, overbitmap.texformat());
// get the laserdisc video
bitmap_yuy16 &vidbitmap = get_video();
m_videotex->set_bitmap(vidbitmap, vidbitmap.cliprect(), TEXFORMAT_YUY16);
// reset the screen contents
screen.container().empty();
// add the video texture
if (m_videoenable)
screen.container().add_quad(0.0f, 0.0f, 1.0f, 1.0f, rgb_t(0xff,0xff,0xff,0xff), m_videotex, PRIMFLAG_BLENDMODE(BLENDMODE_NONE) | PRIMFLAG_SCREENTEX(1));
// add the overlay
if (m_overenable && overbitmap.valid())
{
float x0 = 0.5f - 0.5f * m_overscalex + m_overposx;
float y0 = 0.5f - 0.5f * m_overscaley + m_overposy;
float x1 = x0 + m_overscalex;
float y1 = y0 + m_overscaley;
screen.container().add_quad(x0, y0, x1, y1, rgb_t(0xff,0xff,0xff,0xff), m_overtex, PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA) | PRIMFLAG_SCREENTEX(1));
}
// swap to the next bitmap
m_overindex = (m_overindex + 1) % ARRAY_LENGTH(m_overbitmap);
}
return 0;
}
示例3: render
void crosshair_manager::render(screen_device &screen)
{
int player;
for (player = 0; player < MAX_PLAYERS; player++)
{
render_crosshair &crosshair = *m_crosshair[player];
// draw if visible and the right screen
if (crosshair.is_visible() && ((crosshair.screen() == &screen) || (crosshair.screen() == CROSSHAIR_SCREEN_ALL)))
crosshair.draw(screen.container(), m_fade);
}
}
示例4: crosshair_render
void crosshair_render(screen_device &screen)
{
int player;
for (player = 0; player < MAX_PLAYERS; player++)
/* draw if visible and the right screen */
if (global.visible[player] &&
((global.screen[player] == &screen) || (global.screen[player] == CROSSHAIR_SCREEN_ALL)))
{
/* add a quad assuming a 4:3 screen (this is not perfect) */
screen.container().add_quad(global.x[player] - 0.03f, global.y[player] - 0.04f,
global.x[player] + 0.03f, global.y[player] + 0.04f,
MAKE_ARGB(0xc0, global.fade, global.fade, global.fade),
global.texture[player], PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA));
}
}
示例5: render
void crosshair_manager::render(screen_device &screen)
{
int player;
for (player = 0; player < MAX_PLAYERS; player++)
/* draw if visible and the right screen */
if (m_visible[player] &&
((m_screen[player] == &screen) || (m_screen[player] == CROSSHAIR_SCREEN_ALL)))
{
/* add a quad assuming a 4:3 screen (this is not perfect) */
screen.container().add_quad(m_x[player] - 0.03f, m_y[player] - 0.04f,
m_x[player] + 0.03f, m_y[player] + 0.04f,
rgb_t(0xc0, m_fade, m_fade, m_fade),
m_texture[player], PRIMFLAG_BLENDMODE(BLENDMODE_ALPHA));
}
}