本文整理汇总了C++中drawgfx函数的典型用法代码示例。如果您正苦于以下问题:C++ drawgfx函数的具体用法?C++ drawgfx怎么用?C++ drawgfx使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了drawgfx函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: VIDEO_UPDATE
static VIDEO_UPDATE(fortecar)
{
int x,y,count;
count = 0;
fillbitmap(bitmap,machine->pens[0],cliprect);
for (y=0;y<32;y++)
{
for(x=0;x<64;x++)
{
int tile;
tile = fortecar_ram[0x800+(count*4)+1];
drawgfx(bitmap,machine->gfx[0],tile,0,0,0,x*8,y*8,cliprect,TRANSPARENCY_PEN,0);
count++;
}
}
return 0;
}
示例2: draw_sprites
static void draw_sprites( struct mame_bitmap *bitmap, const struct rectangle *cliprect, int bFog ){
const struct GfxElement *gfx = Machine->gfx[3];
int bank = (grchamp_videoreg0&0x20)?0x40:0x00;
const UINT8 *source = spriteram;
const UINT8 *finish = source+0x40;
while( source<finish ){
int sx = source[3];
int sy = 240-source[0];
int color = bFog?8:source[2];
int code = source[1];
drawgfx( bitmap, gfx,
bank + (code&0x3f),
color,
code&0x40,code&0x80,
sx,sy,
cliprect,
TRANSPARENCY_PEN, 0 );
source += 4;
}
}
示例3: drtomy_draw_sprites
static void drtomy_draw_sprites(mame_bitmap *bitmap, const rectangle *cliprect)
{
int i, x, y, ex, ey;
const gfx_element *gfx = Machine->gfx[0];
static int x_offset[2] = {0x0,0x2};
static int y_offset[2] = {0x0,0x1};
for (i = 3; i < 0x1000/2; i+=4){
int sx = drtomy_spriteram[i+2] & 0x01ff;
int sy = (240 - (drtomy_spriteram[i] & 0x00ff)) & 0x00ff;
int number = drtomy_spriteram[i+3];
int color = (drtomy_spriteram[i+2] & 0x1e00) >> 9;
int attr = (drtomy_spriteram[i] & 0xfe00) >> 9;
int xflip = attr & 0x20;
int yflip = attr & 0x40;
int spr_size;
if (attr & 0x04){
spr_size = 1;
}
else{
spr_size = 2;
number &= (~3);
}
for (y = 0; y < spr_size; y++){
for (x = 0; x < spr_size; x++){
ex = xflip ? (spr_size-1-x) : x;
ey = yflip ? (spr_size-1-y) : y;
drawgfx(bitmap,gfx,number + x_offset[ex] + y_offset[ey],
color,xflip,yflip,
sx-0x09+x*8,sy+y*8,
cliprect,TRANSPARENCY_PEN,0);
}
}
}
}
示例4: draw_text
static void draw_text( struct osd_bitmap *bitmap ) {
int offs;
const struct rectangle *clip = &Machine->visible_area;
for ( offs = 0; offs < 0x800; offs += 2 ) {
unsigned short data = READ_WORD( &colorram[offs] );
int tile_number = data&0x3ff;
if ( tile_number != 0xd ) {
int color = data>>10;
int sx = 8 * ( ( offs >> 1 ) % 32 );
int sy = 8 * ( ( offs >> 1 ) / 32 );
drawgfx( bitmap,Machine->gfx[0],
tile_number,
color,
0,0, /* no flip */
sx,sy,
clip,TRANSPARENCY_PEN,0x3);
}
}
示例5: tnk3_draw_background
static void tnk3_draw_background( mame_bitmap *bitmap, int scrollx, int scrolly,
int x_size, int y_size, int bg_type )
{
const gfx_element *gfx = Machine->gfx[1];
rectangle *clip = &Machine->screen[0].visarea;
int tile_number, attributes, color, sx, sy;
int offs, x, y;
/* to be moved to memmap */
for(x=0; x<x_size; x++) for(y=0; y<y_size; y++)
{
offs = (x*y_size + y) << 1;
tile_number = videoram[offs];
attributes = videoram[offs+1];
if(tile_number != dirtybuffer[offs] || attributes != dirtybuffer[offs+1])
{
dirtybuffer[offs] = tile_number;
dirtybuffer[offs+1] = attributes;
if(bg_type == 0)
{
/* type tnk3 */
tile_number |= (attributes & 0x30) << 4;
color = (attributes & 0xf) ^ 8;
}
else
{
/* type ikari */
tile_number |= (attributes & 0x03) << 8;
color = attributes >> 4;
}
sx = x * 512 / x_size;
sy = y * 512 / y_size;
drawgfx(tmpbitmap,gfx,tile_number,color,0,0,sx,sy,0,TRANSPARENCY_NONE,0);
}
}
示例6: popper_draw_sprites
static void popper_draw_sprites(mame_bitmap *bitmap,const rectangle *cliprect)
{
int offs,sx,sy,flipx,flipy;
for (offs = 0; offs < popper_spriteram_size-4; offs += 4)
{
/*if y position is in the current strip */
if(popper_spriteram[offs+1] && (((popper_spriteram[offs]+(popper_flipscreen?2:0))&0xf0) == (0x0f-offs/0x80)<<4))
{
/*offs y pos */
/*offs+1 sprite number */
/*offs+2 */
/*76543210 */
/*x------- flipy */
/*-x------ flipx */
/*--xx---- unused */
/*----xxxx colour */
/*offs+3 x pos */
sx = popper_spriteram[offs+3];
sy = 240-popper_spriteram[offs];
flipx = (popper_spriteram[offs+2]&0x40)>>6;
flipy = (popper_spriteram[offs+2]&0x80)>>7;
if (popper_flipscreen)
{
sx = 248 - sx;
sy = 242 - sy;
flipx = !flipx;
flipy = !flipy;
}
drawgfx(bitmap,Machine->gfx[1],
popper_spriteram[offs+1],
(popper_spriteram[offs+2]&0x0f),
flipx,flipy,
sx,sy,
cliprect,TRANSPARENCY_PEN,0);
}
}
示例7: mustache_draw_sprites
static void mustache_draw_sprites( struct mame_bitmap *bitmap, const struct rectangle *cliprect )
{
struct rectangle clip = *cliprect;
const struct GfxElement *gfx = Machine->gfx[1];
int offs;
for (offs = 0;offs < spriteram_size;offs += 4)
{
int sy = 240-spriteram[offs];
int sx = 240-spriteram[offs+3];
int code = spriteram[offs+2];
int attr = spriteram[offs+1];
int color = (attr & 0xe0)>>5;
if (sy == 240) continue;
code+=(attr&0x0c)<<6;
if ((control_byte & 0xa))
clip.max_y = Machine->visible_area.max_y;
else
if (flip_screen)
clip.min_y = Machine->visible_area.min_y + 56;
else
clip.max_y = Machine->visible_area.max_y - 56;
if (flip_screen)
{
sx = 240 - sx;
sy = 240 - sy;
}
drawgfx(bitmap,gfx,
code,
color,
flip_screen,flip_screen,
sx,sy,
&clip,TRANSPARENCY_PEN,0);
}
}
示例8: draw_sprites
static void draw_sprites(running_machine *machine, bitmap_t *bitmap,const rectangle *cliprect)
{
int offs,sx,sy,flipx,flipy;
for (offs = 0; offs < popper_spriteram_size-4; offs += 4)
{
//if y position is in the current strip
if(popper_spriteram[offs+1] && (((popper_spriteram[offs]+(popper_flipscreen?2:0))&0xf0) == (0x0f-offs/0x80)<<4))
{
//offs y pos
//offs+1 sprite number
//offs+2
//76543210
//x------- flipy
//-x------ flipx
//--xx---- unused
//----xxxx colour
//offs+3 x pos
sx = popper_spriteram[offs+3];
sy = 240-popper_spriteram[offs];
flipx = (popper_spriteram[offs+2]&0x40)>>6;
flipy = (popper_spriteram[offs+2]&0x80)>>7;
if (popper_flipscreen)
{
sx = 248 - sx;
sy = 242 - sy;
flipx = !flipx;
flipy = !flipy;
}
drawgfx(bitmap,machine->gfx[1],
popper_spriteram[offs+1],
(popper_spriteram[offs+2]&0x0f),
flipx,flipy,
sx,sy,
cliprect,TRANSPARENCY_PEN,0);
}
}
示例9: draw_bg
static void draw_bg(mame_bitmap *bitmap)
{
int offs;
int scroll[256];
for (offs = 0;offs < 0x400;offs++)
{
int code = videoram[0x400+offs];
if (dirtybuffer[0x400+offs] || dirtychar[code])
{
int sx = offs % 32;
int sy = offs / 32;
dirtybuffer[0x400+offs] = 0;
if (flip_screen_x) sx = 31 - sx;
if (flip_screen_y) sy = 31 - sy;
drawgfx(tmpbitmap1,Machine->gfx[0],
code,
2,
flip_screen_x,flip_screen_y,
8*sx,8*sy,
NULL,TRANSPARENCY_NONE,0);
}
}
/* first copy to a temp bitmap doing column scroll */
for (offs = 0;offs < 256;offs++)
scroll[offs] = -buggychl_scrollv[offs/8];
copyscrollbitmap(tmpbitmap2,tmpbitmap1,1,&bg_scrollx,256,scroll,NULL,TRANSPARENCY_NONE,0);
/* then copy to the screen doing row scroll */
for (offs = 0;offs < 256;offs++)
scroll[offs] = -buggychl_scrollh[offs];
copyscrollbitmap(bitmap,tmpbitmap2,256,scroll,0,0,&Machine->screen[0].visarea,TRANSPARENCY_COLOR,32);
}
示例10: circus_draw_fg
static void circus_draw_fg( mame_bitmap *bitmap )
{
/* The sync generator hardware is used to */
/* draw the border and diving boards */
draw_line (bitmap,0,18,255,18,0);
draw_line (bitmap,0,249,255,249,1);
draw_line (bitmap,0,18,0,248,0);
draw_line (bitmap,247,18,247,248,0);
draw_line (bitmap,0,137,17,137,0);
draw_line (bitmap,231,137,248,137,0);
draw_line (bitmap,0,193,17,193,0);
draw_line (bitmap,231,193,248,193,0);
drawgfx(bitmap,Machine->gfx[1],
clown_z,
0,
0,0,
clown_y,clown_x,
&Machine->screen[0].visarea,TRANSPARENCY_PEN,0);
}
示例11: champbas_draw_sprites
static void champbas_draw_sprites( mame_bitmap *bitmap )
{
int offs;
for (offs = spriteram_size - 2; offs >= 0; offs -= 2)
{
int code = spriteram[offs] >> 2;
int color = spriteram[offs + 1];
int flipx = spriteram[offs] & 0x01;
int flipy = spriteram[offs] & 0x02;
int sx = ((256 + 16 - spriteram_2[offs + 1]) & 0xff) - 16;
int sy = spriteram_2[offs] - 16;
drawgfx(bitmap,
Machine->gfx[2 + gfxbank],
code, color,
flipx, flipy,
sx, sy,
&Machine->screen[0].visarea,
TRANSPARENCY_COLOR, 0);
}
}
示例12: circus_draw_fg
static void circus_draw_fg(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect)
{
/* The sync generator hardware is used to */
/* draw the border and diving boards */
draw_line (bitmap,cliprect,0,18,255,18,0);
draw_line (bitmap,cliprect,0,249,255,249,1);
draw_line (bitmap,cliprect,0,18,0,248,0);
draw_line (bitmap,cliprect,247,18,247,248,0);
draw_line (bitmap,cliprect,0,137,17,137,0);
draw_line (bitmap,cliprect,231,137,248,137,0);
draw_line (bitmap,cliprect,0,193,17,193,0);
draw_line (bitmap,cliprect,231,193,248,193,0);
drawgfx(bitmap,machine->gfx[1],
clown_z,
0,
0,0,
clown_y,clown_x,
cliprect,TRANSPARENCY_PEN,0);
}
示例13: VIDEO_UPDATE
static VIDEO_UPDATE( galaxia )
{
int x,y, count;
fillbitmap(bitmap,0,cliprect);
count = 0;
for (y=0;y<256/8;y++)
{
for (x=0;x<256/8;x++)
{
int tile = galaxia_video[count];
drawgfx(bitmap,screen->machine->gfx[0],tile,0,0,0,x*8,y*8,cliprect,TRANSPARENCY_NONE,0);
count++;
}
}
return 0;
}
示例14: draw_chars
static void draw_chars(mame_bitmap *bitmap, int priority)
{
int offs, transparency;
transparency = (priority == 0) ? TRANSPARENCY_NONE : TRANSPARENCY_PEN;
for (offs = 0; offs < videoram_size; offs++)
{
int code,sx,sy,col;
UINT8 scroll;
sy = (offs / 32);
sx = (offs % 32);
col = colorram[((sy & 0x1c) << 3) + sx];
if ((col & 0x10) != priority) continue;
scroll = ~ambush_scrollram[sx];
code = videoram[offs] | ((col & 0x60) << 3);
if (flip_screen)
{
sx = 31 - sx;
sy = 31 - sy;
scroll = ~scroll - 1;
}
drawgfx(bitmap,Machine->gfx[0],
code,
(col & 0x0f) | ((*ambush_colorbank & 0x03) << 4),
flip_screen,flip_screen,
8*sx, (8*sy + scroll) & 0xff,
&Machine->screen[0].visarea,transparency,0);
}
}
示例15: draw_sprites
static void draw_sprites(running_machine *machine, mame_bitmap *bitmap, const rectangle *cliprect)
{
const gfx_element *gfx = machine->gfx[1];
int offs;
int line;
int coloffset = ((col0&0x07) << 4);
for (line = cliprect->min_y; line <= cliprect->max_y; line++)
{
UINT8 *sr;
rectangle clip = *cliprect;
sr = sprite_mux_buffer + line * spriteram_size;
clip.min_y = clip.max_y = line;
for (offs = spriteram_size - 4;offs >= 0;offs -= 4)
{
int code,color,sx,sy,flipx,flipy;
sx = sr[offs];
sy = 240 - sr[offs + 3];
if (sy > line-16 && sy <= line)
{
code = sr[offs + 1];
color = (sr[offs + 2] & 0x0f) + coloffset;
flipx = ~sr[offs + 2] & 0x40;
flipy = sr[offs + 2] & 0x80;
drawgfx(bitmap,gfx,
code,
color,
flipx,flipy,
sx,sy,
&clip,TRANSPARENCY_COLOR,0);
}
}
}
}