本文整理汇总了C++中bitmap_rgb32::palette方法的典型用法代码示例。如果您正苦于以下问题:C++ bitmap_rgb32::palette方法的具体用法?C++ bitmap_rgb32::palette怎么用?C++ bitmap_rgb32::palette使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类bitmap_rgb32
的用法示例。
在下文中一共展示了bitmap_rgb32::palette方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: crtc_update_row
void comx_clm_device::crtc_update_row(mc6845_device *device, bitmap_rgb32 &bitmap, const rectangle &cliprect, UINT16 ma, UINT8 ra, UINT16 y, UINT8 x_count, INT8 cursor_x, void *param)
{
const rgb_t *palette = palette_entry_list_raw(bitmap.palette());
for (int column = 0; column < x_count; column++)
{
UINT8 code = m_video_ram[((ma + column) & 0x7ff)];
UINT16 addr = (code << 3) | (ra & 0x07);
UINT8 data = m_char_rom[addr & 0x7ff];
if (BIT(ra, 3) && column == cursor_x)
{
data = 0xff;
}
for (int bit = 0; bit < 8; bit++)
{
int x = (column * 8) + bit;
int color = BIT(data, 7) ? 7 : 0;
bitmap.pix32(y, x) = palette[color];
data <<= 1;
}
}
}
示例2: screen_update_malzak
UINT32 malzak_state::screen_update_malzak(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
const rgb_t *palette = bitmap.palette()->entry_list_raw();
int sx, sy;
int x,y;
bitmap.fill(rgb_t::black);
m_trom->screen_update(screen, bitmap, cliprect);
// playfield - not sure exactly how this works...
for (x = 0; x < 16; x++)
for (y = 0; y < 16; y++)
{
sx = ((x * 16 - 48) - m_malzak_x) * 2;
sy = ((y * 16) - m_malzak_y) * 2;
if (sx < -271*2)
sx += 512*2;
if (sx < -15*2)
sx += 256*2;
m_gfxdecode->gfx(0)->zoom_transpen(m_palette,bitmap,cliprect, m_playfield_code[x * 16 + y], 2, 0, 0, sx, sy, 0x20000, 0x20000, 0);
}
/* update the S2636 chips */
bitmap_ind16 &s2636_0_bitmap = m_s2636_0->update(cliprect);
bitmap_ind16 &s2636_1_bitmap = m_s2636_1->update(cliprect);
/* copy the S2636 images into the main bitmap */
{
int y;
for (y = cliprect.min_y; y <= cliprect.max_y / 2; y++)
{
int x;
for (x = cliprect.min_x; x <= cliprect.max_x / 2; x++)
{
int pixel0 = s2636_0_bitmap.pix16(y, x);
int pixel1 = s2636_1_bitmap.pix16(y, x);
if (S2636_IS_PIXEL_DRAWN(pixel0)) {
bitmap.pix32(y*2, x*2) = palette[S2636_PIXEL_COLOR(pixel0)];
bitmap.pix32(y*2+1, x*2) = palette[S2636_PIXEL_COLOR(pixel0)];
bitmap.pix32(y*2, x*2+1) = palette[S2636_PIXEL_COLOR(pixel0)];
bitmap.pix32(y*2+1, x*2+1) = palette[S2636_PIXEL_COLOR(pixel0)];
}
if (S2636_IS_PIXEL_DRAWN(pixel1)) {
bitmap.pix32(y*2, x*2) = palette[S2636_PIXEL_COLOR(pixel1)];
bitmap.pix32(y*2+1, x*2) = palette[S2636_PIXEL_COLOR(pixel1)];
bitmap.pix32(y*2, x*2+1) = palette[S2636_PIXEL_COLOR(pixel1)];
bitmap.pix32(y*2+1, x*2+1) = palette[S2636_PIXEL_COLOR(pixel1)];
}
}
}
}
return 0;
}