本文整理汇总了C++中tilemap_t::draw方法的典型用法代码示例。如果您正苦于以下问题:C++ tilemap_t::draw方法的具体用法?C++ tilemap_t::draw怎么用?C++ tilemap_t::draw使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类tilemap_t
的用法示例。
在下文中一共展示了tilemap_t::draw方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1:
UINT32 chance32_state::screen_update_chance32(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0);
m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0);
return 0;
}
示例2: screen_update_fresh
UINT32 fresh_state::screen_update_fresh(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
m_bg_2_tilemap->draw(screen, bitmap, cliprect, 0, 0);
m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0);
return 0;
}
示例3: screen_update_cultures
UINT32 cultures_state::screen_update_cultures(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
int attr;
// tilemaps attributes
attr = (m_bg0_regs_x[3] & 1 ? TILEMAP_FLIPX : 0) | (m_bg0_regs_y[3] & 1 ? TILEMAP_FLIPY : 0);
m_bg0_tilemap->set_flip(attr);
attr = (m_bg1_regs_x[3] & 1 ? TILEMAP_FLIPX : 0) | (m_bg1_regs_y[3] & 1 ? TILEMAP_FLIPY : 0);
m_bg1_tilemap->set_flip(attr);
attr = (m_bg2_regs_x[3] & 1 ? TILEMAP_FLIPX : 0) | (m_bg2_regs_y[3] & 1 ? TILEMAP_FLIPY : 0);
m_bg2_tilemap->set_flip(attr);
// tilemaps scrolls
m_bg0_tilemap->set_scrollx(0, (m_bg0_regs_x[2] << 8) + m_bg0_regs_x[0]);
m_bg1_tilemap->set_scrollx(0, (m_bg1_regs_x[2] << 8) + m_bg1_regs_x[0]);
m_bg2_tilemap->set_scrollx(0, (m_bg2_regs_x[2] << 8) + m_bg2_regs_x[0]);
m_bg0_tilemap->set_scrolly(0, (m_bg0_regs_y[2] << 8) + m_bg0_regs_y[0]);
m_bg1_tilemap->set_scrolly(0, (m_bg1_regs_y[2] << 8) + m_bg1_regs_y[0]);
m_bg2_tilemap->set_scrolly(0, (m_bg2_regs_y[2] << 8) + m_bg2_regs_y[0]);
m_bg2_tilemap->draw(screen, bitmap, cliprect, 0, 0);
m_bg0_tilemap->draw(screen, bitmap, cliprect, 0, 0);
m_bg1_tilemap->draw(screen, bitmap, cliprect, 0, 0);
return 0;
}
示例4: screen_update_lbeach
UINT32 lbeach_state::screen_update_lbeach(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
// draw bg layer (road)
m_bg_tilemap->set_scrolly(0, *m_scroll_y);
m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0);
// check collision
int sprite_code = *m_sprite_code & 0xf;
int sprite_x = *m_sprite_x * 2 - 4;
int sprite_y = 160;
m_colmap_car.fill(0, cliprect);
m_gfxdecode->gfx(2)->transpen(m_palette,m_colmap_car,cliprect, sprite_code, 0, 0, 0, sprite_x, sprite_y, 0);
bitmap_ind16 &fg_bitmap = m_fg_tilemap->pixmap();
m_collision_bg_car = 0;
m_collision_fg_car = 0;
for (int y = sprite_y; y < (sprite_y + 16); y++)
{
for (int x = sprite_x; x < (sprite_x + 16) && cliprect.contains(x, y); x++)
{
m_collision_bg_car |= (bitmap.pix16(y, x) & m_colmap_car.pix16(y, x) & 1);
m_collision_fg_car |= (fg_bitmap.pix16(y, x) & m_colmap_car.pix16(y, x) & 1);
}
}
// draw fg layer (tiles)
m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0);
// draw player car
m_gfxdecode->gfx(2)->transpen(m_palette,bitmap,cliprect, sprite_code, 0, 0, 0, sprite_x, sprite_y, 0);
return 0;
}
示例5: screen_update_dunhuang
UINT32 dunhuang_state::screen_update_dunhuang(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
int layers_ctrl = -1;
#if DUNHUANG_DEBUG
if (machine().input().code_pressed(KEYCODE_Z))
{
int msk = 0;
if (machine().input().code_pressed(KEYCODE_Q)) msk |= 1;
if (machine().input().code_pressed(KEYCODE_W)) msk |= 2;
if (msk != 0) layers_ctrl &= msk;
}
#endif
bitmap.fill(m_palette->black_pen(), cliprect);
switch (m_layers)
{
case 0x04: // girl select: bg over fg
if (layers_ctrl & 2) m_tmap2->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
if (layers_ctrl & 1) m_tmap->draw(screen, bitmap, cliprect, 0, 0);
break;
case 0x05: // dips: must hide fg
if (layers_ctrl & 1) m_tmap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
break;
case 0x07: // game,demo: fg over bg
default:
if (layers_ctrl & 1) m_tmap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
if (layers_ctrl & 2) m_tmap2->draw(screen, bitmap, cliprect, 0, 0);
break;
}
return 0;
}
示例6: screen_update_majorpkr
UINT32 majorpkr_state::screen_update_majorpkr(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
m_bg_tilemap->draw(screen, bitmap, cliprect, 0);
m_fg_tilemap->draw(screen, bitmap, cliprect, 0);
return 0;
}
示例7: screen_update_drtomy
uint32_t drtomy_state::screen_update_drtomy(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
m_tilemap_bg->draw(screen, bitmap, cliprect, 0, 0);
m_tilemap_fg->draw(screen, bitmap, cliprect, 0, 0);
draw_sprites(bitmap, cliprect);
return 0;
}
示例8:
uint32_t quizpun2_state::screen_update_quizpun2(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
int layers_ctrl = -1;
#ifdef MAME_DEBUG
if (machine().input().code_pressed(KEYCODE_Z))
{
int msk = 0;
if (machine().input().code_pressed(KEYCODE_Q)) msk |= 1;
if (machine().input().code_pressed(KEYCODE_W)) msk |= 2;
if (msk != 0) layers_ctrl &= msk;
}
#endif
int bg_scroll = (m_scroll & 0x3) >> 0;
int fg_scroll = (m_scroll & 0xc) >> 2;
m_bg_tmap->set_scrolly(0, bg_scroll * 0x100);
m_fg_tmap->set_scrolly(0, fg_scroll * 0x100);
if (layers_ctrl & 1) m_bg_tmap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
else bitmap.fill(m_palette->black_pen(), cliprect);
if (layers_ctrl & 2) m_fg_tmap->draw(screen, bitmap, cliprect, 0, 0);
// popmessage("BG: %x FG: %x", bg_scroll, fg_scroll);
return 0;
}
示例9: screen_update
UINT32 joystand_state::screen_update( screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect )
{
int layers_ctrl = -1;
#ifdef MAME_DEBUG
if (machine().input().code_pressed(KEYCODE_Z))
{
int msk = 0;
if (machine().input().code_pressed(KEYCODE_Q)) msk |= 1;
if (machine().input().code_pressed(KEYCODE_W)) msk |= 2;
if (machine().input().code_pressed(KEYCODE_A)) msk |= 4;
if (machine().input().code_pressed(KEYCODE_S)) msk |= 8;
if (msk != 0) layers_ctrl &= msk;
}
#endif
m_bg1_tmap->set_scrollx(0, 0);
m_bg1_tmap->set_scrolly(0, 0);
m_bg2_tmap->set_scrollx(0, m_scroll[0] - 0xa);
m_bg2_tmap->set_scrolly(0, m_scroll[1]);
draw_bg15_tilemap();
bitmap.fill(m_palette->black_pen(), cliprect);
if (layers_ctrl & 4) copybitmap_trans(bitmap, m_bg15_bitmap[0], 0, 0, 1, 0, cliprect, BG15_TRANSPARENT);
if (layers_ctrl & 8) copybitmap_trans(bitmap, m_bg15_bitmap[1], 0, 0, 0, 0, cliprect, BG15_TRANSPARENT);
if (layers_ctrl & 1) m_bg1_tmap->draw(screen, bitmap, cliprect, 0, 0);
if (layers_ctrl & 2) m_bg2_tmap->draw(screen, bitmap, cliprect, 0, 0);
popmessage("S0: %04X S1: %04X EN: %04X OUT: %04X", m_scroll[0], m_scroll[1], m_enable[0], m_outputs[0]);
return 0;
}
示例10: screen_update_galaxi
UINT32 galaxi_state::screen_update_galaxi(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
m_bg3_tmap->set_scrollx(m_bg3_xscroll);
m_bg3_tmap->set_scrolly(m_bg3_yscroll);
int layers_ctrl = -1;
#ifdef MAME_DEBUG
if (machine().input().code_pressed(KEYCODE_R)) // remapped due to inputs changes.
{
int msk = 0;
if (machine().input().code_pressed(KEYCODE_T)) msk |= 1;
if (machine().input().code_pressed(KEYCODE_Y)) msk |= 2;
if (machine().input().code_pressed(KEYCODE_U)) msk |= 4;
if (machine().input().code_pressed(KEYCODE_I)) msk |= 8;
if (machine().input().code_pressed(KEYCODE_O)) msk |= 16;
if (msk != 0) layers_ctrl &= msk;
}
#endif
if (layers_ctrl & 1) m_bg1_tmap->draw(screen, bitmap, cliprect, TILEMAP_DRAW_OPAQUE, 0);
else bitmap.fill(m_palette->black_pen(), cliprect);
if (layers_ctrl & 2) m_bg2_tmap->draw(screen, bitmap, cliprect, 0, 0);
if (layers_ctrl & 4) m_bg3_tmap->draw(screen, bitmap, cliprect, 0, 0);
if (layers_ctrl & 8) m_bg4_tmap->draw(screen, bitmap, cliprect, 0, 0);
if (layers_ctrl & 16) m_fg_tmap->draw(screen, bitmap, cliprect, 0, 0);
return 0;
}
示例11: screen_update_chanbara
UINT32 chanbara_state::screen_update_chanbara(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
m_bg2_tilemap->set_scrolly(0, m_scroll | (m_scrollhi << 8));
m_bg2_tilemap->draw(screen, bitmap, cliprect, 0, 0);
draw_sprites(bitmap, cliprect);
m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0);
return 0;
}
示例12:
UINT32 mil4000_state::screen_update_mil4000(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
m_sc0_tilemap->draw(screen, bitmap, cliprect, 0,0);
m_sc1_tilemap->draw(screen, bitmap, cliprect, 0,0);
m_sc2_tilemap->draw(screen, bitmap, cliprect, 0,0);
m_sc3_tilemap->draw(screen, bitmap, cliprect, 0,0);
return 0;
}
示例13: screen_update_pzletime
UINT32 pzletime_state::screen_update_pzletime(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
int count;
int y, x;
bitmap.fill(machine().pens[0], cliprect); //bg pen
m_txt_tilemap->set_scrolly(0, m_tilemap_regs[0] - 3);
m_txt_tilemap->set_scrollx(0, m_tilemap_regs[1]);
m_mid_tilemap->set_scrolly(0, m_tilemap_regs[2] - 3);
m_mid_tilemap->set_scrollx(0, m_tilemap_regs[3] - 7);
if (m_video_regs[2] & 1)
{
count = 0;
for (y = 255; y >= 0; y--)
{
for (x = 0; x < 512; x++)
{
if (m_bg_videoram[count] & 0x8000)
bitmap.pix16((y - 18) & 0xff, (x - 32) & 0x1ff) = 0x300 + (m_bg_videoram[count] & 0x7fff);
count++;
}
}
}
m_mid_tilemap->draw(screen, bitmap, cliprect, 0, 0);
{
UINT16 *spriteram = m_spriteram;
int offs, spr_offs, colour, sx, sy;
for(offs = 0; offs < 0x2000 / 2; offs += 4)
{
if(spriteram[offs + 0] == 8)
break;
spr_offs = spriteram[offs + 3] & 0x0fff;
sy = 0x200 - (spriteram[offs + 0] & 0x1ff) - 35;
sx = (spriteram[offs + 1] & 0x1ff) - 30;
colour = (spriteram[offs + 0] & 0xf000) >> 12;
// is spriteram[offs + 0] & 0x200 flipy? it's always set
drawgfx_transpen(bitmap, cliprect, machine().gfx[1], spr_offs, colour, 0, 1, sx, sy, 0);
}
}
m_txt_tilemap->draw(screen, bitmap, cliprect, 0, 0);
if ((screen.frame_number() % 16) != 0)
m_txt_tilemap->draw(screen, bitmap, cliprect, 1, 0);
return 0;
}
示例14: screen_update_cabaret
UINT32 cabaret_state::screen_update_cabaret(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
bitmap.fill(get_black_pen(machine()), cliprect);
m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0);
m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0);
return 0;
}
示例15: screen_update_cabaret
uint32_t cabaret_state::screen_update_cabaret(screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect)
{
bitmap.fill(m_palette->black_pen(), cliprect);
m_bg_tilemap->draw(screen, bitmap, cliprect, 0, 0);
m_fg_tilemap->draw(screen, bitmap, cliprect, 0, 0);
return 0;
}