本文整理汇总了C++中drawgfx函数的典型用法代码示例。如果您正苦于以下问题:C++ drawgfx函数的具体用法?C++ drawgfx怎么用?C++ drawgfx使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了drawgfx函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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;
}
开发者ID:broftkd,项目名称:historic-mame,代码行数:20,代码来源:fortecar.c
示例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;
}
}
开发者ID:Sunoo,项目名称:nonamemame,代码行数:20,代码来源:grchamp.c
示例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);
}
}
}
}
开发者ID:BirchJD,项目名称:advancemame-0.106.1-RPi,代码行数:41,代码来源:drtomy.c
示例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);
}
}
开发者ID:ArnaudFeld,项目名称:MameAppleTV,代码行数:21,代码来源:cabal.cpp
示例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);
}
}
开发者ID:broftkd,项目名称:historic-mess,代码行数:40,代码来源:snk.c
示例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);
}
}
开发者ID:CrouchingLlama,项目名称:openlase-mame,代码行数:40,代码来源:popper.c
示例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);
}
}
开发者ID:Sunoo,项目名称:nonamemame,代码行数:40,代码来源:mustache.c
示例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);
}
}
开发者ID:cdenix,项目名称:ps3-mame-0125,代码行数:40,代码来源:popper.c
示例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);
}
开发者ID:broftkd,项目名称:historic-mess,代码行数:40,代码来源:buggychl.c
示例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);
}
开发者ID:broftkd,项目名称:historic-mess,代码行数:22,代码来源:circus.c
示例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);
}
}
开发者ID:broftkd,项目名称:historic-mess,代码行数:22,代码来源:champbas.c
示例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);
}
开发者ID:cdenix,项目名称:ps3-mame-0125,代码行数:22,代码来源:circus.c
示例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;
}
开发者ID:cdenix,项目名称:ps3-mame-0125,代码行数:22,代码来源:galaxia.c
示例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);
}
}
开发者ID:broftkd,项目名称:historic-mess,代码行数:39,代码来源:ambush.c
示例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);
}
}
}
}
开发者ID:broftkd,项目名称:historic-mame,代码行数:39,代码来源:tp84.c
示例16: draw_background
static void draw_background(struct mame_bitmap *bitmap, int bank, int colortype)
{
int offs;
/* for every character in the Video RAM, check if it has been modified */
/* since last time and update it accordingly. */
for (offs = videoram_size - 1;offs >= 0;offs--)
{
int scroll,sx,sy,col;
sx = offs % 32;
sy = offs / 32;
if (colortype)
{
col = (wiz_attributesram[2 * sx + 1] & 0x07);
}
else
{
col = (wiz_attributesram[2 * (offs % 32) + 1] & 0x04) + (videoram[offs] & 3);
}
scroll = (8*sy + 256 - wiz_attributesram[2 * sx]) % 256;
if (flipy)
{
scroll = (248 - scroll) % 256;
}
if (flipx) sx = 31 - sx;
drawgfx(bitmap,Machine->gfx[bank],
videoram[offs],
col + 8 * palette_bank,
flipx,flipy,
8*sx,scroll,
&Machine->visible_area,TRANSPARENCY_PEN,0);
}
}
开发者ID:Ezio-PS,项目名称:mame2003-libretro,代码行数:39,代码来源:wiz_vidhrdw.c
示例17: talbot_draw_sprites
static void talbot_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[1],
code, color,
flipx, flipy,
sx, sy,
&Machine->visible_area,
TRANSPARENCY_PEN, 0);
}
}
开发者ID:CrouchingLlama,项目名称:openlase-mame,代码行数:22,代码来源:talbot.c
示例18: xybots_vh_screenrefresh
void xybots_vh_screenrefresh(struct osd_bitmap *bitmap, int full_refresh)
{
int i;
/* update the palette */
if (update_palette())
memset(atarigen_pf_dirty, 1, atarigen_playfieldram_size / 2);
/* set up the all-transparent overrender palette */
for (i = 0; i < 16; i++)
atarigen_overrender_colortable[i] = palette_transparent_pen;
/* render the playfield */
atarigen_pf_process(pf_render_callback, bitmap, &Machine->visible_area);
/* render the motion objects */
atarigen_mo_process(mo_render_callback, bitmap);
/* redraw the alpha layer completely */
{
const struct GfxElement *gfx = Machine->gfx[2];
int sx, sy, offs;
for (sy = 0; sy < YCHARS; sy++)
for (sx = 0, offs = sy * 64; sx < XCHARS; sx++, offs++)
{
int data = READ_WORD(&atarigen_alpharam[offs * 2]);
int code = data & 0x3ff;
int opaque = data & 0x8000;
if (code || opaque)
{
int color = (data >> 12) & 7;
drawgfx(bitmap, gfx, code, color, 0, 0, 8 * sx, 8 * sy, 0,
opaque ? TRANSPARENCY_NONE : TRANSPARENCY_PEN, 0);
}
}
}
开发者ID:Nebuleon,项目名称:mame4all,代码行数:39,代码来源:xybots.cpp
示例19: draw_sprites
static void draw_sprites( struct osd_bitmap *bitmap ){
const struct rectangle *clip = &Machine->visible_area;
const struct GfxElement *gfx = Machine->gfx[1];
UINT16 *source = (UINT16 *)spriteram;
UINT16 *finish = source+0x800;
while( source<finish ){
UINT16 attributes = source[1];
if( attributes&0x01 ){ /* enable */
int flipx = attributes&0x10;
int flipy = attributes&0x08;
int height = (attributes>>5)&0x7;
int sy = source[0]&0xff;
int sx = source[5]&0xff;
UINT16 tile_number = source[2]&0xff;
UINT16 color = source[4]&0xf;
int bank = source[3]&0xff;
int i;
if (attributes&0x04) sx|=0x100;
if (attributes&0x02) sy=239+(0x100-sy); else sy=240-sy;
if (sx>0x17f) sx=0-(0x200-sx);
tile_number += (bank*256);
for( i=0; i<=height; i++ ){
int tile_index = tile_number + i;
drawgfx(bitmap,gfx,
tile_index,
color,
flipx,flipy,
sx,sy-i*16,
clip,TRANSPARENCY_PEN,0);
}
}
source+=8;
}
开发者ID:AlanApter,项目名称:steamlink-sdk,代码行数:39,代码来源:ddragon3.c
示例20: tdfever_draw_tx
static void tdfever_draw_tx(running_machine *machine, bitmap_t *bitmap, const rectangle *cliprect, int attributes, int dx, int dy, int base )
{
const UINT8 *source = snk_rambase - 0xd000 + base;
const gfx_element *gfx = machine->gfx[0];
int tile_high = (attributes & 0xf0) << 4;
int color = attributes & 0xf;
int tile_number, sx, sy;
int x, y;
for(x = 0; x < 64; x++) for(y = 0; y < 32; y++)
{
tile_number = source[(x<<5)+y];
if(tile_number == 0x20) continue;
sx = dx + x*8;
sy = dy + y*8;
drawgfx(bitmap,gfx,tile_high|tile_number,color,0,0,sx,sy,cliprect,TRANSPARENCY_PEN,15);
}
}
开发者ID:cdenix,项目名称:ps3-mame-0125,代码行数:22,代码来源:snk.c
注:本文中的drawgfx函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论