summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
author Zsolt Vasvari <zsoltvas@mamedev.org>2008-02-24 06:33:02 +0000
committer Zsolt Vasvari <zsoltvas@mamedev.org>2008-02-24 06:33:02 +0000
commit51cae46fac45a94b362742a7b3fa523ece5845cb (patch)
tree891508d8c2dbb9a6c01a5595fbce827cd5b4e70b
parent4c67395bc622fb50675eca8248d929aec6440ab9 (diff)
- Added some asserts to drawgfx and drawgfxzoom
- Moved some variable declerations so that they are only visible where they are actually used Note that the diff is large only because I removed a level of indentation from a huge chunk of code. I could do that because the case it was checking for was already caught by one of the asserts added.
-rw-r--r--src/emu/drawgfx.c1851
1 files changed, 926 insertions, 925 deletions
diff --git a/src/emu/drawgfx.c b/src/emu/drawgfx.c
index a2181bce960..96d7fb34205 100644
--- a/src/emu/drawgfx.c
+++ b/src/emu/drawgfx.c
@@ -1340,13 +1340,11 @@ INLINE void common_drawgfxzoom( mame_bitmap *dest_bmp,const gfx_element *gfx,
const rectangle *clip,int transparency,int transparent_color,
int scalex, int scaley,mame_bitmap *pri_buffer,UINT32 pri_mask)
{
- rectangle myclip;
+ /* verify arguments */
+ assert(dest_bmp != NULL);
+ assert(gfx != NULL);
- UINT8 ah, al;
-
- al = (pdrawgfx_shadow_lowpri) ? 0 : 0x80;
-
- if (!scalex || !scaley) return;
+ if ((scalex == 0) || (scaley == 0)) return;
if (scalex == 0x10000 && scaley == 0x10000)
{
@@ -1372,6 +1370,8 @@ INLINE void common_drawgfxzoom( mame_bitmap *dest_bmp,const gfx_element *gfx,
/* force clip to bitmap boundary */
if (clip)
{
+ rectangle myclip;
+
myclip.min_x = clip->min_x;
myclip.max_x = clip->max_x;
myclip.min_y = clip->min_y;
@@ -1389,277 +1389,133 @@ INLINE void common_drawgfxzoom( mame_bitmap *dest_bmp,const gfx_element *gfx,
/* 8-bit destination bitmap */
if (dest_bmp->bpp == 8)
{
- if( gfx )
+ UINT32 palbase = gfx->color_base + gfx->color_granularity * (color % gfx->total_colors);
+ UINT8 *source_base = gfx->gfxdata + (code % gfx->total_elements) * gfx->char_modulo;
+
+ int sprite_screen_height = (scaley*gfx->height+0x8000)>>16;
+ int sprite_screen_width = (scalex*gfx->width+0x8000)>>16;
+
+ if (sprite_screen_width && sprite_screen_height)
{
- UINT32 palbase = gfx->color_base + gfx->color_granularity * (color % gfx->total_colors);
- UINT8 *source_base = gfx->gfxdata + (code % gfx->total_elements) * gfx->char_modulo;
+ /* compute sprite increment per screen pixel */
+ int dx = (gfx->width<<16)/sprite_screen_width;
+ int dy = (gfx->height<<16)/sprite_screen_height;
- int sprite_screen_height = (scaley*gfx->height+0x8000)>>16;
- int sprite_screen_width = (scalex*gfx->width+0x8000)>>16;
+ int ex = sx+sprite_screen_width;
+ int ey = sy+sprite_screen_height;
- if (sprite_screen_width && sprite_screen_height)
- {
- /* compute sprite increment per screen pixel */
- int dx = (gfx->width<<16)/sprite_screen_width;
- int dy = (gfx->height<<16)/sprite_screen_height;
+ int x_index_base;
+ int y_index;
- int ex = sx+sprite_screen_width;
- int ey = sy+sprite_screen_height;
+ if (flipx )
+ {
+ x_index_base = (sprite_screen_width-1)*dx;
+ dx = -dx;
+ }
+ else
+ {
+ x_index_base = 0;
+ }
- int x_index_base;
- int y_index;
+ if( flipy )
+ {
+ y_index = (sprite_screen_height-1)*dy;
+ dy = -dy;
+ }
+ else
+ {
+ y_index = 0;
+ }
- if( flipx )
- {
- x_index_base = (sprite_screen_width-1)*dx;
- dx = -dx;
+ if( clip )
+ {
+ if( sx < clip->min_x)
+ { /* clip left */
+ int pixels = clip->min_x-sx;
+ sx += pixels;
+ x_index_base += pixels*dx;
}
- else
- {
- x_index_base = 0;
+ if( sy < clip->min_y )
+ { /* clip top */
+ int pixels = clip->min_y-sy;
+ sy += pixels;
+ y_index += pixels*dy;
}
-
- if( flipy )
- {
- y_index = (sprite_screen_height-1)*dy;
- dy = -dy;
+ /* NS 980211 - fixed incorrect clipping */
+ if( ex > clip->max_x+1 )
+ { /* clip right */
+ int pixels = ex-clip->max_x-1;
+ ex -= pixels;
}
- else
- {
- y_index = 0;
- }
-
- if( clip )
- {
- if( sx < clip->min_x)
- { /* clip left */
- int pixels = clip->min_x-sx;
- sx += pixels;
- x_index_base += pixels*dx;
- }
- if( sy < clip->min_y )
- { /* clip top */
- int pixels = clip->min_y-sy;
- sy += pixels;
- y_index += pixels*dy;
- }
- /* NS 980211 - fixed incorrect clipping */
- if( ex > clip->max_x+1 )
- { /* clip right */
- int pixels = ex-clip->max_x-1;
- ex -= pixels;
- }
- if( ey > clip->max_y+1 )
- { /* clip bottom */
- int pixels = ey-clip->max_y-1;
- ey -= pixels;
- }
+ if( ey > clip->max_y+1 )
+ { /* clip bottom */
+ int pixels = ey-clip->max_y-1;
+ ey -= pixels;
}
+ }
- if( ex>sx )
- { /* skip if inner loop doesn't draw anything */
- int y;
+ if( ex>sx )
+ { /* skip if inner loop doesn't draw anything */
+ int y;
- /* case 0: TRANSPARENCY_NONE */
- if (transparency == TRANSPARENCY_NONE)
+ /* case 0: TRANSPARENCY_NONE */
+ if (transparency == TRANSPARENCY_NONE)
+ {
+ if (pri_buffer)
{
- if (pri_buffer)
+ if (gfx->flags & GFX_ELEMENT_PACKED)
{
- if (gfx->flags & GFX_ELEMENT_PACKED)
- {
- for( y=sy; y<ey; y++ )
- {
- UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
- UINT8 *dest = BITMAP_ADDR8(dest_bmp, y, 0);
- UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
-
- int x, x_index = x_index_base;
- for( x=sx; x<ex; x++ )
- {
- if (((1 << pri[x]) & pri_mask) == 0)
- dest[x] = palbase + ((source[x_index>>17] >> ((x_index & 0x10000) >> 14)) & 0x0f);
- pri[x] = 31;
- x_index += dx;
- }
-
- y_index += dy;
- }
- }
- else
+ for( y=sy; y<ey; y++ )
{
- for( y=sy; y<ey; y++ )
- {
- UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
- UINT8 *dest = BITMAP_ADDR8(dest_bmp, y, 0);
- UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
-
- int x, x_index = x_index_base;
- for( x=sx; x<ex; x++ )
- {
- if (((1 << pri[x]) & pri_mask) == 0)
- dest[x] = palbase + source[x_index>>16];
- x_index += dx;
- }
+ UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
+ UINT8 *dest = BITMAP_ADDR8(dest_bmp, y, 0);
+ UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
- y_index += dy;
- }
- }
- }
- else
- {
- if (gfx->flags & GFX_ELEMENT_PACKED)
- {
- for( y=sy; y<ey; y++ )
+ int x, x_index = x_index_base;
+ for( x=sx; x<ex; x++ )
{
- UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
- UINT8 *dest = BITMAP_ADDR8(dest_bmp, y, 0);
-
- int x, x_index = x_index_base;
- for( x=sx; x<ex; x++ )
- {
+ if (((1 << pri[x]) & pri_mask) == 0)
dest[x] = palbase + ((source[x_index>>17] >> ((x_index & 0x10000) >> 14)) & 0x0f);
- x_index += dx;
- }
-
- y_index += dy;
- }
- }
- else
- {
- for( y=sy; y<ey; y++ )
- {
- UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
- UINT8 *dest = BITMAP_ADDR8(dest_bmp, y, 0);
-
- int x, x_index = x_index_base;
- for( x=sx; x<ex; x++ )
- {
- dest[x] = palbase + source[x_index>>16];
- x_index += dx;
- }
-
- y_index += dy;
- }
- }
- }
- }
-
- /* case 1: TRANSPARENCY_PEN */
- if (transparency == TRANSPARENCY_PEN)
- {
- if (pri_buffer)
- {
- if (gfx->flags & GFX_ELEMENT_PACKED)
- {
- for( y=sy; y<ey; y++ )
- {
- UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
- UINT8 *dest = BITMAP_ADDR8(dest_bmp, y, 0);
- UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
-
- int x, x_index = x_index_base;
- for( x=sx; x<ex; x++ )
- {
- int c = (source[x_index>>17] >> ((x_index & 0x10000) >> 14)) & 0x0f;
- if( c != transparent_color )
- {
- if (((1 << pri[x]) & pri_mask) == 0)
- dest[x] = palbase + c;
- pri[x] = 31;
- }
- x_index += dx;
- }
-
- y_index += dy;
+ pri[x] = 31;
+ x_index += dx;
}
- }
- else
- {
- for( y=sy; y<ey; y++ )
- {
- UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
- UINT8 *dest = BITMAP_ADDR8(dest_bmp, y, 0);
- UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
-
- int x, x_index = x_index_base;
- for( x=sx; x<ex; x++ )
- {
- int c = source[x_index>>16];
- if( c != transparent_color )
- {
- if (((1 << pri[x]) & pri_mask) == 0)
- dest[x] = palbase + c;
- pri[x] = 31;
- }
- x_index += dx;
- }
- y_index += dy;
- }
+ y_index += dy;
}
}
else
{
- if (gfx->flags & GFX_ELEMENT_PACKED)
+ for( y=sy; y<ey; y++ )
{
- for( y=sy; y<ey; y++ )
- {
- UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
- UINT8 *dest = BITMAP_ADDR8(dest_bmp, y, 0);
-
- int x, x_index = x_index_base;
- for( x=sx; x<ex; x++ )
- {
- int c = (source[x_index>>17] >> ((x_index & 0x10000) >> 14)) & 0x0f;
- if( c != transparent_color ) dest[x] = palbase + c;
- x_index += dx;
- }
+ UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
+ UINT8 *dest = BITMAP_ADDR8(dest_bmp, y, 0);
+ UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
- y_index += dy;
- }
- }
- else
- {
- for( y=sy; y<ey; y++ )
+ int x, x_index = x_index_base;
+ for( x=sx; x<ex; x++ )
{
- UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
- UINT8 *dest = BITMAP_ADDR8(dest_bmp, y, 0);
-
- int x, x_index = x_index_base;
- for( x=sx; x<ex; x++ )
- {
- int c = source[x_index>>16];
- if( c != transparent_color ) dest[x] = palbase + c;
- x_index += dx;
- }
-
- y_index += dy;
+ if (((1 << pri[x]) & pri_mask) == 0)
+ dest[x] = palbase + source[x_index>>16];
+ x_index += dx;
}
+
+ y_index += dy;
}
}
}
-
- /* case 1b: TRANSPARENCY_PEN_RAW */
- if (transparency == TRANSPARENCY_PEN_RAW)
+ else
{
- if (pri_buffer)
+ if (gfx->flags & GFX_ELEMENT_PACKED)
{
for( y=sy; y<ey; y++ )
{
UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
UINT8 *dest = BITMAP_ADDR8(dest_bmp, y, 0);
- UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
int x, x_index = x_index_base;
for( x=sx; x<ex; x++ )
{
- int c = source[x_index>>16];
- if( c != transparent_color )
- {
- if (((1 << pri[x]) & pri_mask) == 0)
- dest[x] = color + c;
- pri[x] = 31;
- }
+ dest[x] = palbase + ((source[x_index>>17] >> ((x_index & 0x10000) >> 14)) & 0x0f);
x_index += dx;
}
@@ -1676,8 +1532,7 @@ INLINE void common_drawgfxzoom( mame_bitmap *dest_bmp,const gfx_element *gfx,
int x, x_index = x_index_base;
for( x=sx; x<ex; x++ )
{
- int c = source[x_index>>16];
- if( c != transparent_color ) dest[x] = color + c;
+ dest[x] = palbase + source[x_index>>16];
x_index += dx;
}
@@ -1685,11 +1540,14 @@ INLINE void common_drawgfxzoom( mame_bitmap *dest_bmp,const gfx_element *gfx,
}
}
}
+ }
- /* case 2: TRANSPARENCY_PENS */
- if (transparency == TRANSPARENCY_PENS)
+ /* case 1: TRANSPARENCY_PEN */
+ if (transparency == TRANSPARENCY_PEN)
+ {
+ if (pri_buffer)
{
- if (pri_buffer)
+ if (gfx->flags & GFX_ELEMENT_PACKED)
{
for( y=sy; y<ey; y++ )
{
@@ -1700,8 +1558,8 @@ INLINE void common_drawgfxzoom( mame_bitmap *dest_bmp,const gfx_element *gfx,
int x, x_index = x_index_base;
for( x=sx; x<ex; x++ )
{
- int c = source[x_index>>16];
- if (((1 << c) & transparent_color) == 0)
+ int c = (source[x_index>>17] >> ((x_index & 0x10000) >> 14)) & 0x0f;
+ if( c != transparent_color )
{
if (((1 << pri[x]) & pri_mask) == 0)
dest[x] = palbase + c;
@@ -1719,13 +1577,18 @@ INLINE void common_drawgfxzoom( mame_bitmap *dest_bmp,const gfx_element *gfx,
{
UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
UINT8 *dest = BITMAP_ADDR8(dest_bmp, y, 0);
+ UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
int x, x_index = x_index_base;
for( x=sx; x<ex; x++ )
{
int c = source[x_index>>16];
- if (((1 << c) & transparent_color) == 0)
- dest[x] = palbase + c;
+ if( c != transparent_color )
+ {
+ if (((1 << pri[x]) & pri_mask) == 0)
+ dest[x] = palbase + c;
+ pri[x] = 31;
+ }
x_index += dx;
}
@@ -1733,44 +1596,20 @@ INLINE void common_drawgfxzoom( mame_bitmap *dest_bmp,const gfx_element *gfx,
}
}
}
-
- /* case 3: TRANSPARENCY_PEN_TABLE */
- if (transparency == TRANSPARENCY_PEN_TABLE)
+ else
{
- pen_t *palette_shadow_table = Machine->shadow_table;
- if (pri_buffer)
+ if (gfx->flags & GFX_ELEMENT_PACKED)
{
for( y=sy; y<ey; y++ )
{
UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
UINT8 *dest = BITMAP_ADDR8(dest_bmp, y, 0);
- UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
int x, x_index = x_index_base;
for( x=sx; x<ex; x++ )
{
- int c = source[x_index>>16];
- if( c != transparent_color )
- {
- switch(gfx_drawmode_table[c])
- {
- case DRAWMODE_SOURCE:
- if (((1 << (pri[x] & 0x1f)) & pri_mask) == 0)
- {
- if (pri[x] & 0x80)
- dest[x] = palette_shadow_table[palbase + c];
- else
- dest[x] = palbase + c;
- }
- pri[x] = (pri[x] & 0x7f) | 31;
- break;
- case DRAWMODE_SHADOW:
- if (((1 << pri[x]) & pri_mask) == 0)
- dest[x] = palette_shadow_table[dest[x]];
- pri[x] |= al;
- break;
- }
- }
+ int c = (source[x_index>>17] >> ((x_index & 0x10000) >> 14)) & 0x0f;
+ if( c != transparent_color ) dest[x] = palbase + c;
x_index += dx;
}
@@ -1788,18 +1627,7 @@ INLINE void common_drawgfxzoom( mame_bitmap *dest_bmp,const gfx_element *gfx,
for( x=sx; x<ex; x++ )
{
int c = source[x_index>>16];
- if( c != transparent_color )
- {
- switch(gfx_drawmode_table[c])
- {
- case DRAWMODE_SOURCE:
- dest[x] = palbase + c;
- break;
- case DRAWMODE_SHADOW:
- dest[x] = palette_shadow_table[dest[x]];
- break;
- }
- }
+ if( c != transparent_color ) dest[x] = palbase + c;
x_index += dx;
}
@@ -1808,268 +1636,259 @@ INLINE void common_drawgfxzoom( mame_bitmap *dest_bmp,const gfx_element *gfx,
}
}
}
- }
- }
- }
-
- /* 16-bit destination bitmap */
- else if (dest_bmp->bpp == 16)
- {
- if( gfx )
- {
- const pen_t *pal = &Machine->pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
- UINT8 *source_base = gfx->gfxdata + (code % gfx->total_elements) * gfx->char_modulo;
-
- int sprite_screen_height = (scaley*gfx->height+0x8000)>>16;
- int sprite_screen_width = (scalex*gfx->width+0x8000)>>16;
-
- if (sprite_screen_width && sprite_screen_height)
- {
- /* compute sprite increment per screen pixel */
- int dx = (gfx->width<<16)/sprite_screen_width;
- int dy = (gfx->height<<16)/sprite_screen_height;
-
- int ex = sx+sprite_screen_width;
- int ey = sy+sprite_screen_height;
-
- int x_index_base;
- int y_index;
-
- if( flipx )
- {
- x_index_base = (sprite_screen_width-1)*dx;
- dx = -dx;
- }
- else
- {
- x_index_base = 0;
- }
- if( flipy )
+ /* case 1b: TRANSPARENCY_PEN_RAW */
+ if (transparency == TRANSPARENCY_PEN_RAW)
{
- y_index = (sprite_screen_height-1)*dy;
- dy = -dy;
- }
- else
- {
- y_index = 0;
- }
-
- if( clip )
- {
- if( sx < clip->min_x)
- { /* clip left */
- int pixels = clip->min_x-sx;
- sx += pixels;
- x_index_base += pixels*dx;
- }
- if( sy < clip->min_y )
- { /* clip top */
- int pixels = clip->min_y-sy;
- sy += pixels;
- y_index += pixels*dy;
- }
- /* NS 980211 - fixed incorrect clipping */
- if( ex > clip->max_x+1 )
- { /* clip right */
- int pixels = ex-clip->max_x-1;
- ex -= pixels;
- }
- if( ey > clip->max_y+1 )
- { /* clip bottom */
- int pixels = ey-clip->max_y-1;
- ey -= pixels;
- }
- }
-
- if( ex>sx )
- { /* skip if inner loop doesn't draw anything */
- int y;
-
- /* case 0: TRANSPARENCY_NONE */
- if (transparency == TRANSPARENCY_NONE)
+ if (pri_buffer)
{
- if (pri_buffer)
+ for( y=sy; y<ey; y++ )
{
- if (gfx->flags & GFX_ELEMENT_PACKED)
+ UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
+ UINT8 *dest = BITMAP_ADDR8(dest_bmp, y, 0);
+ UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
+
+ int x, x_index = x_index_base;
+ for( x=sx; x<ex; x++ )
{
- for( y=sy; y<ey; y++ )
+ int c = source[x_index>>16];
+ if( c != transparent_color )
{
- UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
- UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
- UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
-
- int x, x_index = x_index_base;
- for( x=sx; x<ex; x++ )
- {
- if (((1 << pri[x]) & pri_mask) == 0)
- dest[x] = pal[(source[x_index>>17] >> ((x_index & 0x10000) >> 14)) & 0x0f];
- pri[x] = 31;
- x_index += dx;
- }
-
- y_index += dy;
+ if (((1 << pri[x]) & pri_mask) == 0)
+ dest[x] = color + c;
+ pri[x] = 31;
}
+ x_index += dx;
}
- else
- {
- for( y=sy; y<ey; y++ )
- {
- UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
- UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
- UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
- int x, x_index = x_index_base;
- for( x=sx; x<ex; x++ )
- {
- if (((1 << pri[x]) & pri_mask) == 0)
- dest[x] = pal[source[x_index>>16]];
- pri[x] = 31;
- x_index += dx;
- }
+ y_index += dy;
+ }
+ }
+ else
+ {
+ for( y=sy; y<ey; y++ )
+ {
+ UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
+ UINT8 *dest = BITMAP_ADDR8(dest_bmp, y, 0);
- y_index += dy;
- }
+ int x, x_index = x_index_base;
+ for( x=sx; x<ex; x++ )
+ {
+ int c = source[x_index>>16];
+ if( c != transparent_color ) dest[x] = color + c;
+ x_index += dx;
}
+
+ y_index += dy;
}
- else
+ }
+ }
+
+ /* case 2: TRANSPARENCY_PENS */
+ if (transparency == TRANSPARENCY_PENS)
+ {
+ if (pri_buffer)
+ {
+ for( y=sy; y<ey; y++ )
{
- if (gfx->flags & GFX_ELEMENT_PACKED)
+ UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
+ UINT8 *dest = BITMAP_ADDR8(dest_bmp, y, 0);
+ UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
+
+ int x, x_index = x_index_base;
+ for( x=sx; x<ex; x++ )
{
- for( y=sy; y<ey; y++ )
+ int c = source[x_index>>16];
+ if (((1 << c) & transparent_color) == 0)
{
- UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
- UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
-
- int x, x_index = x_index_base;
- for( x=sx; x<ex; x++ )
- {
- dest[x] = pal[(source[x_index>>17] >> ((x_index & 0x10000) >> 14)) & 0x0f];
- x_index += dx;
- }
-
- y_index += dy;
+ if (((1 << pri[x]) & pri_mask) == 0)
+ dest[x] = palbase + c;
+ pri[x] = 31;
}
+ x_index += dx;
}
- else
- {
- for( y=sy; y<ey; y++ )
- {
- UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
- UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
- int x, x_index = x_index_base;
- for( x=sx; x<ex; x++ )
- {
- dest[x] = pal[source[x_index>>16]];
- x_index += dx;
- }
+ y_index += dy;
+ }
+ }
+ else
+ {
+ for( y=sy; y<ey; y++ )
+ {
+ UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
+ UINT8 *dest = BITMAP_ADDR8(dest_bmp, y, 0);
- y_index += dy;
- }
+ int x, x_index = x_index_base;
+ for( x=sx; x<ex; x++ )
+ {
+ int c = source[x_index>>16];
+ if (((1 << c) & transparent_color) == 0)
+ dest[x] = palbase + c;
+ x_index += dx;
}
+
+ y_index += dy;
}
}
+ }
- /* case 1: TRANSPARENCY_PEN */
- if (transparency == TRANSPARENCY_PEN)
+ /* case 3: TRANSPARENCY_PEN_TABLE */
+ if (transparency == TRANSPARENCY_PEN_TABLE)
+ {
+ pen_t *palette_shadow_table = Machine->shadow_table;
+ if (pri_buffer)
{
- if (pri_buffer)
- {
- if (gfx->flags & GFX_ELEMENT_PACKED)
- {
- for( y=sy; y<ey; y++ )
- {
- UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
- UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
- UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
+ UINT8 al = (pdrawgfx_shadow_lowpri) ? 0 : 0x80;
- int x, x_index = x_index_base;
- for( x=sx; x<ex; x++ )
- {
- int c = (source[x_index>>17] >> ((x_index & 0x10000) >> 14)) & 0x0f;
- if( c != transparent_color )
- {
- if (((1 << pri[x]) & pri_mask) == 0)
- dest[x] = pal[c];
- pri[x] = 31;
- }
- x_index += dx;
- }
+ for( y=sy; y<ey; y++ )
+ {
+ UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
+ UINT8 *dest = BITMAP_ADDR8(dest_bmp, y, 0);
+ UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
- y_index += dy;
- }
- }
- else
+ int x, x_index = x_index_base;
+ for( x=sx; x<ex; x++ )
{
- for( y=sy; y<ey; y++ )
+ int c = source[x_index>>16];
+ if( c != transparent_color )
{
- UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
- UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
- UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
-
- int x, x_index = x_index_base;
- for( x=sx; x<ex; x++ )
+ switch(gfx_drawmode_table[c])
{
- int c = source[x_index>>16];
- if( c != transparent_color )
+ case DRAWMODE_SOURCE:
+ if (((1 << (pri[x] & 0x1f)) & pri_mask) == 0)
{
- if (((1 << pri[x]) & pri_mask) == 0)
- dest[x] = pal[c];
- pri[x] = 31;
+ if (pri[x] & 0x80)
+ dest[x] = palette_shadow_table[palbase + c];
+ else
+ dest[x] = palbase + c;
}
- x_index += dx;
+ pri[x] = (pri[x] & 0x7f) | 31;
+ break;
+ case DRAWMODE_SHADOW:
+ if (((1 << pri[x]) & pri_mask) == 0)
+ dest[x] = palette_shadow_table[dest[x]];
+ pri[x] |= al;
+ break;
}
-
- y_index += dy;
}
+ x_index += dx;
}
+
+ y_index += dy;
}
- else
+ }
+ else
+ {
+ for( y=sy; y<ey; y++ )
{
- if (gfx->flags & GFX_ELEMENT_PACKED)
- {
- for( y=sy; y<ey; y++ )
- {
- UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
- UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
+ UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
+ UINT8 *dest = BITMAP_ADDR8(dest_bmp, y, 0);
- int x, x_index = x_index_base;
- for( x=sx; x<ex; x++ )
- {
- int c = (source[x_index>>17] >> ((x_index & 0x10000) >> 14)) & 0x0f;
- if( c != transparent_color ) dest[x] = pal[c];
- x_index += dx;
- }
-
- y_index += dy;
- }
- }
- else
+ int x, x_index = x_index_base;
+ for( x=sx; x<ex; x++ )
{
- for( y=sy; y<ey; y++ )
+ int c = source[x_index>>16];
+ if( c != transparent_color )
{
- UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
- UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
-
- int x, x_index = x_index_base;
- for( x=sx; x<ex; x++ )
+ switch(gfx_drawmode_table[c])
{
- int c = source[x_index>>16];
- if( c != transparent_color ) dest[x] = pal[c];
- x_index += dx;
+ case DRAWMODE_SOURCE:
+ dest[x] = palbase + c;
+ break;
+ case DRAWMODE_SHADOW:
+ dest[x] = palette_shadow_table[dest[x]];
+ break;
}
-
- y_index += dy;
}
+ x_index += dx;
}
+
+ y_index += dy;
}
}
+ }
+ }
+ }
+ }
- /* case 1b: TRANSPARENCY_PEN_RAW */
- if (transparency == TRANSPARENCY_PEN_RAW)
+ /* 16-bit destination bitmap */
+ else if (dest_bmp->bpp == 16)
+ {
+ const pen_t *pal = &Machine->pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
+ UINT8 *source_base = gfx->gfxdata + (code % gfx->total_elements) * gfx->char_modulo;
+
+ int sprite_screen_height = (scaley*gfx->height+0x8000)>>16;
+ int sprite_screen_width = (scalex*gfx->width+0x8000)>>16;
+
+ if (sprite_screen_width && sprite_screen_height)
+ {
+ /* compute sprite increment per screen pixel */
+ int dx = (gfx->width<<16)/sprite_screen_width;
+ int dy = (gfx->height<<16)/sprite_screen_height;
+
+ int ex = sx+sprite_screen_width;
+ int ey = sy+sprite_screen_height;
+
+ int x_index_base;
+ int y_index;
+
+ if( flipx )
+ {
+ x_index_base = (sprite_screen_width-1)*dx;
+ dx = -dx;
+ }
+ else
+ {
+ x_index_base = 0;
+ }
+
+ if( flipy )
+ {
+ y_index = (sprite_screen_height-1)*dy;
+ dy = -dy;
+ }
+ else
+ {
+ y_index = 0;
+ }
+
+ if( clip )
+ {
+ if( sx < clip->min_x)
+ { /* clip left */
+ int pixels = clip->min_x-sx;
+ sx += pixels;
+ x_index_base += pixels*dx;
+ }
+ if( sy < clip->min_y )
+ { /* clip top */
+ int pixels = clip->min_y-sy;
+ sy += pixels;
+ y_index += pixels*dy;
+ }
+ /* NS 980211 - fixed incorrect clipping */
+ if( ex > clip->max_x+1 )
+ { /* clip right */
+ int pixels = ex-clip->max_x-1;
+ ex -= pixels;
+ }
+ if( ey > clip->max_y+1 )
+ { /* clip bottom */
+ int pixels = ey-clip->max_y-1;
+ ey -= pixels;
+ }
+ }
+
+ if( ex>sx )
+ { /* skip if inner loop doesn't draw anything */
+ int y;
+
+ /* case 0: TRANSPARENCY_NONE */
+ if (transparency == TRANSPARENCY_NONE)
+ {
+ if (pri_buffer)
{
- if (pri_buffer)
+ if (gfx->flags & GFX_ELEMENT_PACKED)
{
for( y=sy; y<ey; y++ )
{
@@ -2080,13 +1899,9 @@ INLINE void common_drawgfxzoom( mame_bitmap *dest_bmp,const gfx_element *gfx,
int x, x_index = x_index_base;
for( x=sx; x<ex; x++ )
{
- int c = source[x_index>>16];
- if( c != transparent_color )
- {
- if (((1 << pri[x]) & pri_mask) == 0)
- dest[x] = color + c;
- pri[x] = 31;
- }
+ if (((1 << pri[x]) & pri_mask) == 0)
+ dest[x] = pal[(source[x_index>>17] >> ((x_index & 0x10000) >> 14)) & 0x0f];
+ pri[x] = 31;
x_index += dx;
}
@@ -2099,12 +1914,14 @@ INLINE void common_drawgfxzoom( mame_bitmap *dest_bmp,const gfx_element *gfx,
{
UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
+ UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
int x, x_index = x_index_base;
for( x=sx; x<ex; x++ )
{
- int c = source[x_index>>16];
- if( c != transparent_color ) dest[x] = color + c;
+ if (((1 << pri[x]) & pri_mask) == 0)
+ dest[x] = pal[source[x_index>>16]];
+ pri[x] = 31;
x_index += dx;
}
@@ -2112,28 +1929,19 @@ INLINE void common_drawgfxzoom( mame_bitmap *dest_bmp,const gfx_element *gfx,
}
}
}
-
- /* case 2: TRANSPARENCY_PENS */
- if (transparency == TRANSPARENCY_PENS)
+ else
{
- if (pri_buffer)
+ if (gfx->flags & GFX_ELEMENT_PACKED)
{
for( y=sy; y<ey; y++ )
{
UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
- UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
int x, x_index = x_index_base;
for( x=sx; x<ex; x++ )
{
- int c = source[x_index>>16];
- if (((1 << c) & transparent_color) == 0)
- {
- if (((1 << pri[x]) & pri_mask) == 0)
- dest[x] = pal[c];
- pri[x] = 31;
- }
+ dest[x] = pal[(source[x_index>>17] >> ((x_index & 0x10000) >> 14)) & 0x0f];
x_index += dx;
}
@@ -2150,9 +1958,7 @@ INLINE void common_drawgfxzoom( mame_bitmap *dest_bmp,const gfx_element *gfx,
int x, x_index = x_index_base;
for( x=sx; x<ex; x++ )
{
- int c = source[x_index>>16];
- if (((1 << c) & transparent_color) == 0)
- dest[x] = pal[c];
+ dest[x] = pal[source[x_index>>16]];
x_index += dx;
}
@@ -2160,12 +1966,14 @@ INLINE void common_drawgfxzoom( mame_bitmap *dest_bmp,const gfx_element *gfx,
}
}
}
+ }
- /* case 3: TRANSPARENCY_PEN_TABLE */
- if (transparency == TRANSPARENCY_PEN_TABLE)
+ /* case 1: TRANSPARENCY_PEN */
+ if (transparency == TRANSPARENCY_PEN)
+ {
+ if (pri_buffer)
{
- pen_t *palette_shadow_table = Machine->shadow_table;
- if (pri_buffer)
+ if (gfx->flags & GFX_ELEMENT_PACKED)
{
for( y=sy; y<ey; y++ )
{
@@ -2176,28 +1984,12 @@ INLINE void common_drawgfxzoom( mame_bitmap *dest_bmp,const gfx_element *gfx,
int x, x_index = x_index_base;
for( x=sx; x<ex; x++ )
{
- int c = source[x_index>>16];
+ int c = (source[x_index>>17] >> ((x_index & 0x10000) >> 14)) & 0x0f;
if( c != transparent_color )
{
- switch(gfx_drawmode_table[c])
- {
- case DRAWMODE_SOURCE:
- ah = pri[x];
- if (((1 << (ah & 0x1f)) & pri_mask) == 0)
- {
- if (ah & 0x80)
- dest[x] = palette_shadow_table[pal[c]];
- else
- dest[x] = pal[c];
- }
- pri[x] = (ah & 0x7f) | 31;
- break;
- case DRAWMODE_SHADOW:
- if (((1 << pri[x]) & pri_mask) == 0)
- dest[x] = palette_shadow_table[dest[x]];
- pri[x] |= al;
- break;
- }
+ if (((1 << pri[x]) & pri_mask) == 0)
+ dest[x] = pal[c];
+ pri[x] = 31;
}
x_index += dx;
}
@@ -2211,6 +2003,7 @@ INLINE void common_drawgfxzoom( mame_bitmap *dest_bmp,const gfx_element *gfx,
{
UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
+ UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
int x, x_index = x_index_base;
for( x=sx; x<ex; x++ )
@@ -2218,15 +2011,9 @@ INLINE void common_drawgfxzoom( mame_bitmap *dest_bmp,const gfx_element *gfx,
int c = source[x_index>>16];
if( c != transparent_color )
{
- switch(gfx_drawmode_table[c])
- {
- case DRAWMODE_SOURCE:
+ if (((1 << pri[x]) & pri_mask) == 0)
dest[x] = pal[c];
- break;
- case DRAWMODE_SHADOW:
- dest[x] = palette_shadow_table[dest[x]];
- break;
- }
+ pri[x] = 31;
}
x_index += dx;
}
@@ -2235,28 +2022,20 @@ INLINE void common_drawgfxzoom( mame_bitmap *dest_bmp,const gfx_element *gfx,
}
}
}
-
- /* case 6: TRANSPARENCY_ALPHA */
- if (transparency == TRANSPARENCY_ALPHA)
+ else
{
- if (pri_buffer)
+ if (gfx->flags & GFX_ELEMENT_PACKED)
{
for( y=sy; y<ey; y++ )
{
UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
- UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
int x, x_index = x_index_base;
for( x=sx; x<ex; x++ )
{
- int c = source[x_index>>16];
- if( c != transparent_color )
- {
- if (((1 << pri[x]) & pri_mask) == 0)
- dest[x] = alpha_blend16(dest[x], pal[c]);
- pri[x] = 31;
- }
+ int c = (source[x_index>>17] >> ((x_index & 0x10000) >> 14)) & 0x0f;
+ if( c != transparent_color ) dest[x] = pal[c];
x_index += dx;
}
@@ -2274,7 +2053,7 @@ INLINE void common_drawgfxzoom( mame_bitmap *dest_bmp,const gfx_element *gfx,
for( x=sx; x<ex; x++ )
{
int c = source[x_index>>16];
- if( c != transparent_color ) dest[x] = alpha_blend16(dest[x], pal[c]);
+ if( c != transparent_color ) dest[x] = pal[c];
x_index += dx;
}
@@ -2282,63 +2061,284 @@ INLINE void common_drawgfxzoom( mame_bitmap *dest_bmp,const gfx_element *gfx,
}
}
}
+ }
- /* pjp 31/5/02 */
- /* case 7: TRANSPARENCY_ALPHARANGE */
- if (transparency == TRANSPARENCY_ALPHARANGE)
+ /* case 1b: TRANSPARENCY_PEN_RAW */
+ if (transparency == TRANSPARENCY_PEN_RAW)
+ {
+ if (pri_buffer)
{
- if (pri_buffer)
+ for( y=sy; y<ey; y++ )
{
- for( y=sy; y<ey; y++ )
+ UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
+ UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
+ UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
+
+ int x, x_index = x_index_base;
+ for( x=sx; x<ex; x++ )
{
- UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
- UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
- UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
+ int c = source[x_index>>16];
+ if( c != transparent_color )
+ {
+ if (((1 << pri[x]) & pri_mask) == 0)
+ dest[x] = color + c;
+ pri[x] = 31;
+ }
+ x_index += dx;
+ }
- int x, x_index = x_index_base;
- for( x=sx; x<ex; x++ )
+ y_index += dy;
+ }
+ }
+ else
+ {
+ for( y=sy; y<ey; y++ )
+ {
+ UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
+ UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
+
+ int x, x_index = x_index_base;
+ for( x=sx; x<ex; x++ )
+ {
+ int c = source[x_index>>16];
+ if( c != transparent_color ) dest[x] = color + c;
+ x_index += dx;
+ }
+
+ y_index += dy;
+ }
+ }
+ }
+
+ /* case 2: TRANSPARENCY_PENS */
+ if (transparency == TRANSPARENCY_PENS)
+ {
+ if (pri_buffer)
+ {
+ for( y=sy; y<ey; y++ )
+ {
+ UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
+ UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
+ UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
+
+ int x, x_index = x_index_base;
+ for( x=sx; x<ex; x++ )
+ {
+ int c = source[x_index>>16];
+ if (((1 << c) & transparent_color) == 0)
{
- int c = source[x_index>>16];
- if( c != transparent_color )
+ if (((1 << pri[x]) & pri_mask) == 0)
+ dest[x] = pal[c];
+ pri[x] = 31;
+ }
+ x_index += dx;
+ }
+
+ y_index += dy;
+ }
+ }
+ else
+ {
+ for( y=sy; y<ey; y++ )
+ {
+ UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
+ UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
+
+ int x, x_index = x_index_base;
+ for( x=sx; x<ex; x++ )
+ {
+ int c = source[x_index>>16];
+ if (((1 << c) & transparent_color) == 0)
+ dest[x] = pal[c];
+ x_index += dx;
+ }
+
+ y_index += dy;
+ }
+ }
+ }
+
+ /* case 3: TRANSPARENCY_PEN_TABLE */
+ if (transparency == TRANSPARENCY_PEN_TABLE)
+ {
+ pen_t *palette_shadow_table = Machine->shadow_table;
+ if (pri_buffer)
+ {
+ UINT8 al = (pdrawgfx_shadow_lowpri) ? 0 : 0x80;
+
+ for( y=sy; y<ey; y++ )
+ {
+ UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
+ UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
+ UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
+
+ int x, x_index = x_index_base;
+ for( x=sx; x<ex; x++ )
+ {
+ int c = source[x_index>>16];
+ if( c != transparent_color )
+ {
+ UINT8 ah;
+
+ switch(gfx_drawmode_table[c])
{
- if (((1 << pri[x]) & pri_mask) == 0)
+ case DRAWMODE_SOURCE:
+ ah = pri[x];
+ if (((1 << (ah & 0x1f)) & pri_mask) == 0)
{
- if( gfx_alpharange_table[c] == 0xff )
- dest[x] = pal[c];
+ if (ah & 0x80)
+ dest[x] = palette_shadow_table[pal[c]];
else
- dest[x] = alpha_blend_r16(dest[x], pal[c], gfx_alpharange_table[c]);
+ dest[x] = pal[c];
}
- pri[x] = 31;
+ pri[x] = (ah & 0x7f) | 31;
+ break;
+ case DRAWMODE_SHADOW:
+ if (((1 << pri[x]) & pri_mask) == 0)
+ dest[x] = palette_shadow_table[dest[x]];
+ pri[x] |= al;
+ break;
}
- x_index += dx;
}
+ x_index += dx;
+ }
- y_index += dy;
+ y_index += dy;
+ }
+ }
+ else
+ {
+ for( y=sy; y<ey; y++ )
+ {
+ UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
+ UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
+
+ int x, x_index = x_index_base;
+ for( x=sx; x<ex; x++ )
+ {
+ int c = source[x_index>>16];
+ if( c != transparent_color )
+ {
+ switch(gfx_drawmode_table[c])
+ {
+ case DRAWMODE_SOURCE:
+ dest[x] = pal[c];
+ break;
+ case DRAWMODE_SHADOW:
+ dest[x] = palette_shadow_table[dest[x]];
+ break;
+ }
+ }
+ x_index += dx;
}
+
+ y_index += dy;
}
- else
+ }
+ }
+
+ /* case 6: TRANSPARENCY_ALPHA */
+ if (transparency == TRANSPARENCY_ALPHA)
+ {
+ if (pri_buffer)
+ {
+ for( y=sy; y<ey; y++ )
{
- for( y=sy; y<ey; y++ )
+ UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
+ UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
+ UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
+
+ int x, x_index = x_index_base;
+ for( x=sx; x<ex; x++ )
{
- UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
- UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
+ int c = source[x_index>>16];
+ if( c != transparent_color )
+ {
+ if (((1 << pri[x]) & pri_mask) == 0)
+ dest[x] = alpha_blend16(dest[x], pal[c]);
+ pri[x] = 31;
+ }
+ x_index += dx;
+ }
- int x, x_index = x_index_base;
- for( x=sx; x<ex; x++ )
+ y_index += dy;
+ }
+ }
+ else
+ {
+ for( y=sy; y<ey; y++ )
+ {
+ UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
+ UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
+
+ int x, x_index = x_index_base;
+ for( x=sx; x<ex; x++ )
+ {
+ int c = source[x_index>>16];
+ if( c != transparent_color ) dest[x] = alpha_blend16(dest[x], pal[c]);
+ x_index += dx;
+ }
+
+ y_index += dy;
+ }
+ }
+ }
+
+ /* pjp 31/5/02 */
+ /* case 7: TRANSPARENCY_ALPHARANGE */
+ if (transparency == TRANSPARENCY_ALPHARANGE)
+ {
+ if (pri_buffer)
+ {
+ for( y=sy; y<ey; y++ )
+ {
+ UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
+ UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
+ UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
+
+ int x, x_index = x_index_base;
+ for( x=sx; x<ex; x++ )
+ {
+ int c = source[x_index>>16];
+ if( c != transparent_color )
{
- int c = source[x_index>>16];
- if( c != transparent_color )
+ if (((1 << pri[x]) & pri_mask) == 0)
{
if( gfx_alpharange_table[c] == 0xff )
dest[x] = pal[c];
else
dest[x] = alpha_blend_r16(dest[x], pal[c], gfx_alpharange_table[c]);
}
- x_index += dx;
+ pri[x] = 31;
}
+ x_index += dx;
+ }
- y_index += dy;
+ y_index += dy;
+ }
+ }
+ else
+ {
+ for( y=sy; y<ey; y++ )
+ {
+ UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
+ UINT16 *dest = BITMAP_ADDR16(dest_bmp, y, 0);
+
+ int x, x_index = x_index_base;
+ for( x=sx; x<ex; x++ )
+ {
+ int c = source[x_index>>16];
+ if( c != transparent_color )
+ {
+ if( gfx_alpharange_table[c] == 0xff )
+ dest[x] = pal[c];
+ else
+ dest[x] = alpha_blend_r16(dest[x], pal[c], gfx_alpharange_table[c]);
+ }
+ x_index += dx;
}
+
+ y_index += dy;
}
}
}
@@ -2349,438 +2349,436 @@ INLINE void common_drawgfxzoom( mame_bitmap *dest_bmp,const gfx_element *gfx,
/* 32-bit destination bitmap */
else
{
- if( gfx )
+ const pen_t *pal = &Machine->pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
+ UINT8 *source_base = gfx->gfxdata + (code % gfx->total_elements) * gfx->char_modulo;
+
+ int sprite_screen_height = (scaley*gfx->height+0x8000)>>16;
+ int sprite_screen_width = (scalex*gfx->width+0x8000)>>16;
+
+ if (sprite_screen_width && sprite_screen_height)
{
- const pen_t *pal = &Machine->pens[gfx->color_base + gfx->color_granularity * (color % gfx->total_colors)];
- UINT8 *source_base = gfx->gfxdata + (code % gfx->total_elements) * gfx->char_modulo;
+ /* compute sprite increment per screen pixel */
+ int dx = (gfx->width<<16)/sprite_screen_width;
+ int dy = (gfx->height<<16)/sprite_screen_height;
- int sprite_screen_height = (scaley*gfx->height+0x8000)>>16;
- int sprite_screen_width = (scalex*gfx->width+0x8000)>>16;
+ int ex = sx+sprite_screen_width;
+ int ey = sy+sprite_screen_height;
- if (sprite_screen_width && sprite_screen_height)
- {
- /* compute sprite increment per screen pixel */
- int dx = (gfx->width<<16)/sprite_screen_width;
- int dy = (gfx->height<<16)/sprite_screen_height;
+ int x_index_base;
+ int y_index;
- int ex = sx+sprite_screen_width;
- int ey = sy+sprite_screen_height;
+ if( flipx )
+ {
+ x_index_base = (sprite_screen_width-1)*dx;
+ dx = -dx;
+ }
+ else
+ {
+ x_index_base = 0;
+ }
- int x_index_base;
- int y_index;
+ if( flipy )
+ {
+ y_index = (sprite_screen_height-1)*dy;
+ dy = -dy;
+ }
+ else
+ {
+ y_index = 0;
+ }
- if( flipx )
- {
- x_index_base = (sprite_screen_width-1)*dx;
- dx = -dx;
- }
- else
- {
- x_index_base = 0;
+ if( clip )
+ {
+ if( sx < clip->min_x)
+ { /* clip left */
+ int pixels = clip->min_x-sx;
+ sx += pixels;
+ x_index_base += pixels*dx;
}
-
- if( flipy )
- {
- y_index = (sprite_screen_height-1)*dy;
- dy = -dy;
+ if( sy < clip->min_y )
+ { /* clip top */
+ int pixels = clip->min_y-sy;
+ sy += pixels;
+ y_index += pixels*dy;
}
- else
- {
- y_index = 0;
+ /* NS 980211 - fixed incorrect clipping */
+ if( ex > clip->max_x+1 )
+ { /* clip right */
+ int pixels = ex-clip->max_x-1;
+ ex -= pixels;
}
-
- if( clip )
- {
- if( sx < clip->min_x)
- { /* clip left */
- int pixels = clip->min_x-sx;
- sx += pixels;
- x_index_base += pixels*dx;
- }
- if( sy < clip->min_y )
- { /* clip top */
- int pixels = clip->min_y-sy;
- sy += pixels;
- y_index += pixels*dy;
- }
- /* NS 980211 - fixed incorrect clipping */
- if( ex > clip->max_x+1 )
- { /* clip right */
- int pixels = ex-clip->max_x-1;
- ex -= pixels;
- }
- if( ey > clip->max_y+1 )
- { /* clip bottom */
- int pixels = ey-clip->max_y-1;
- ey -= pixels;
- }
+ if( ey > clip->max_y+1 )
+ { /* clip bottom */
+ int pixels = ey-clip->max_y-1;
+ ey -= pixels;
}
+ }
- if( ex>sx )
- { /* skip if inner loop doesn't draw anything */
- int y;
+ if( ex>sx )
+ { /* skip if inner loop doesn't draw anything */
+ int y;
- /* case 0: TRANSPARENCY_NONE */
- if (transparency == TRANSPARENCY_NONE)
+ /* case 0: TRANSPARENCY_NONE */
+ if (transparency == TRANSPARENCY_NONE)
+ {
+ if (pri_buffer)
{
- if (pri_buffer)
+ for( y=sy; y<ey; y++ )
{
- for( y=sy; y<ey; y++ )
- {
- UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
- UINT32 *dest = BITMAP_ADDR32(dest_bmp, y, 0);
- UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
+ UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
+ UINT32 *dest = BITMAP_ADDR32(dest_bmp, y, 0);
+ UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
- int x, x_index = x_index_base;
- for( x=sx; x<ex; x++ )
- {
- if (((1 << pri[x]) & pri_mask) == 0)
- dest[x] = pal[source[x_index>>16]];
- pri[x] = 31;
- x_index += dx;
- }
-
- y_index += dy;
+ int x, x_index = x_index_base;
+ for( x=sx; x<ex; x++ )
+ {
+ if (((1 << pri[x]) & pri_mask) == 0)
+ dest[x] = pal[source[x_index>>16]];
+ pri[x] = 31;
+ x_index += dx;
}
+
+ y_index += dy;
}
- else
+ }
+ else
+ {
+ for( y=sy; y<ey; y++ )
{
- for( y=sy; y<ey; y++ )
- {
- UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
- UINT32 *dest = BITMAP_ADDR32(dest_bmp, y, 0);
+ UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
+ UINT32 *dest = BITMAP_ADDR32(dest_bmp, y, 0);
- int x, x_index = x_index_base;
- for( x=sx; x<ex; x++ )
- {
- dest[x] = pal[source[x_index>>16]];
- x_index += dx;
- }
-
- y_index += dy;
+ int x, x_index = x_index_base;
+ for( x=sx; x<ex; x++ )
+ {
+ dest[x] = pal[source[x_index>>16]];
+ x_index += dx;
}
+
+ y_index += dy;
}
}
+ }
- /* case 1: TRANSPARENCY_PEN */
- if (transparency == TRANSPARENCY_PEN)
+ /* case 1: TRANSPARENCY_PEN */
+ if (transparency == TRANSPARENCY_PEN)
+ {
+ if (pri_buffer)
{
- if (pri_buffer)
+ for( y=sy; y<ey; y++ )
{
- for( y=sy; y<ey; y++ )
- {
- UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
- UINT32 *dest = BITMAP_ADDR32(dest_bmp, y, 0);
- UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
+ UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
+ UINT32 *dest = BITMAP_ADDR32(dest_bmp, y, 0);
+ UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
- int x, x_index = x_index_base;
- for( x=sx; x<ex; x++ )
+ int x, x_index = x_index_base;
+ for( x=sx; x<ex; x++ )
+ {
+ int c = source[x_index>>16];
+ if( c != transparent_color )
{
- int c = source[x_index>>16];
- if( c != transparent_color )
- {
- if (((1 << pri[x]) & pri_mask) == 0)
- dest[x] = pal[c];
- pri[x] = 31;
- }
- x_index += dx;
+ if (((1 << pri[x]) & pri_mask) == 0)
+ dest[x] = pal[c];
+ pri[x] = 31;
}
-
- y_index += dy;
+ x_index += dx;
}
+
+ y_index += dy;
}
- else
+ }
+ else
+ {
+ for( y=sy; y<ey; y++ )
{
- for( y=sy; y<ey; y++ )
- {
- UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
- UINT32 *dest = BITMAP_ADDR32(dest_bmp, y, 0);
-
- int x, x_index = x_index_base;
- for( x=sx; x<ex; x++ )
- {
- int c = source[x_index>>16];
- if( c != transparent_color ) dest[x] = pal[c];
- x_index += dx;
- }
+ UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
+ UINT32 *dest = BITMAP_ADDR32(dest_bmp, y, 0);
- y_index += dy;
+ int x, x_index = x_index_base;
+ for( x=sx; x<ex; x++ )
+ {
+ int c = source[x_index>>16];
+ if( c != transparent_color ) dest[x] = pal[c];
+ x_index += dx;
}
+
+ y_index += dy;
}
}
+ }
- /* case 1b: TRANSPARENCY_PEN_RAW */
- if (transparency == TRANSPARENCY_PEN_RAW)
+ /* case 1b: TRANSPARENCY_PEN_RAW */
+ if (transparency == TRANSPARENCY_PEN_RAW)
+ {
+ if (pri_buffer)
{
- if (pri_buffer)
+ for( y=sy; y<ey; y++ )
{
- for( y=sy; y<ey; y++ )
- {
- UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
- UINT32 *dest = BITMAP_ADDR32(dest_bmp, y, 0);
- UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
+ UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
+ UINT32 *dest = BITMAP_ADDR32(dest_bmp, y, 0);
+ UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
- int x, x_index = x_index_base;
- for( x=sx; x<ex; x++ )
+ int x, x_index = x_index_base;
+ for( x=sx; x<ex; x++ )
+ {
+ int c = source[x_index>>16];
+ if( c != transparent_color )
{
- int c = source[x_index>>16];
- if( c != transparent_color )
- {
- if (((1 << pri[x]) & pri_mask) == 0)
- dest[x] = color + c;
- pri[x] = 31;
- }
- x_index += dx;
+ if (((1 << pri[x]) & pri_mask) == 0)
+ dest[x] = color + c;
+ pri[x] = 31;
}
-
- y_index += dy;
+ x_index += dx;
}
+
+ y_index += dy;
}
- else
+ }
+ else
+ {
+ for( y=sy; y<ey; y++ )
{
- for( y=sy; y<ey; y++ )
- {
- UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
- UINT32 *dest = BITMAP_ADDR32(dest_bmp, y, 0);
+ UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
+ UINT32 *dest = BITMAP_ADDR32(dest_bmp, y, 0);
- int x, x_index = x_index_base;
- for( x=sx; x<ex; x++ )
- {
- int c = source[x_index>>16];
- if( c != transparent_color ) dest[x] = color + c;
- x_index += dx;
- }
-
- y_index += dy;
+ int x, x_index = x_index_base;
+ for( x=sx; x<ex; x++ )
+ {
+ int c = source[x_index>>16];
+ if( c != transparent_color ) dest[x] = color + c;
+ x_index += dx;
}
+
+ y_index += dy;
}
}
+ }
- /* case 2: TRANSPARENCY_PENS */
- if (transparency == TRANSPARENCY_PENS)
+ /* case 2: TRANSPARENCY_PENS */
+ if (transparency == TRANSPARENCY_PENS)
+ {
+ if (pri_buffer)
{
- if (pri_buffer)
+ for( y=sy; y<ey; y++ )
{
- for( y=sy; y<ey; y++ )
- {
- UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
- UINT32 *dest = BITMAP_ADDR32(dest_bmp, y, 0);
- UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
+ UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
+ UINT32 *dest = BITMAP_ADDR32(dest_bmp, y, 0);
+ UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
- int x, x_index = x_index_base;
- for( x=sx; x<ex; x++ )
+ int x, x_index = x_index_base;
+ for( x=sx; x<ex; x++ )
+ {
+ int c = source[x_index>>16];
+ if (((1 << c) & transparent_color) == 0)
{
- int c = source[x_index>>16];
- if (((1 << c) & transparent_color) == 0)
- {
- if (((1 << pri[x]) & pri_mask) == 0)
- dest[x] = pal[c];
- pri[x] = 31;
- }
- x_index += dx;
+ if (((1 << pri[x]) & pri_mask) == 0)
+ dest[x] = pal[c];
+ pri[x] = 31;
}
-
- y_index += dy;
+ x_index += dx;
}
+
+ y_index += dy;
}
- else
+ }
+ else
+ {
+ for( y=sy; y<ey; y++ )
{
- for( y=sy; y<ey; y++ )
- {
- UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
- UINT32 *dest = BITMAP_ADDR32(dest_bmp, y, 0);
+ UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
+ UINT32 *dest = BITMAP_ADDR32(dest_bmp, y, 0);
- int x, x_index = x_index_base;
- for( x=sx; x<ex; x++ )
- {
- int c = source[x_index>>16];
- if (((1 << c) & transparent_color) == 0)
- dest[x] = pal[c];
- x_index += dx;
- }
-
- y_index += dy;
+ int x, x_index = x_index_base;
+ for( x=sx; x<ex; x++ )
+ {
+ int c = source[x_index>>16];
+ if (((1 << c) & transparent_color) == 0)
+ dest[x] = pal[c];
+ x_index += dx;
}
+
+ y_index += dy;
}
}
+ }
- /* case 3: TRANSPARENCY_PEN_TABLE */
- if (transparency == TRANSPARENCY_PEN_TABLE)
- {
- pen_t *palette_shadow_table = Machine->shadow_table;
- UINT8 *source, *pri;
- UINT32 *dest;
- int c, x, x_index;
+ /* case 3: TRANSPARENCY_PEN_TABLE */
+ if (transparency == TRANSPARENCY_PEN_TABLE)
+ {
+ pen_t *palette_shadow_table = Machine->shadow_table;
+ UINT8 *source, *pri;
+ UINT32 *dest;
+ int c, x, x_index;
+ UINT8 al, ah;
- if (pri_buffer)
+ if (pri_buffer)
+ {
+ for( y=sy; y<ey; y++ )
{
- for( y=sy; y<ey; y++ )
- {
- source = source_base + (y_index>>16) * gfx->line_modulo;
- y_index += dy;
- dest = BITMAP_ADDR32(dest_bmp, y, 0);
- pri = BITMAP_ADDR8(pri_buffer, y, 0);
- x_index = x_index_base;
+ source = source_base + (y_index>>16) * gfx->line_modulo;
+ y_index += dy;
+ dest = BITMAP_ADDR32(dest_bmp, y, 0);
+ pri = BITMAP_ADDR8(pri_buffer, y, 0);
+ x_index = x_index_base;
- for( x=sx; x<ex; x++ )
- {
- int ebx = x_index;
- x_index += dx;
- ebx >>= 16;
- al = pri[x];
- c = source[ebx];
- ah = al;
- al &= 0x1f;
+ for( x=sx; x<ex; x++ )
+ {
+ int ebx = x_index;
+ x_index += dx;
+ ebx >>= 16;
+ al = pri[x];
+ c = source[ebx];
+ ah = al;
+ al &= 0x1f;
- if (gfx_drawmode_table[c] == DRAWMODE_NONE) continue;
+ if (gfx_drawmode_table[c] == DRAWMODE_NONE) continue;
- if (!(1<<al & pri_mask))
+ if (!(1<<al & pri_mask))
+ {
+ if (gfx_drawmode_table[c] == DRAWMODE_SOURCE)
{
- if (gfx_drawmode_table[c] == DRAWMODE_SOURCE)
- {
- ah &= 0x7f;
- ebx = pal[c];
- ah |= 0x1f;
- dest[x] = ebx;
- pri[x] = ah;
- }
- else if (!(ah & 0x80))
- {
- ebx = SHADOW32(palette_shadow_table,dest[x]);
- pri[x] |= 0x80;
- dest[x] = ebx;
- }
+ ah &= 0x7f;
+ ebx = pal[c];
+ ah |= 0x1f;
+ dest[x] = ebx;
+ pri[x] = ah;
+ }
+ else if (!(ah & 0x80))
+ {
+ ebx = SHADOW32(palette_shadow_table,dest[x]);
+ pri[x] |= 0x80;
+ dest[x] = ebx;
}
}
}
}
- else
+ }
+ else
+ {
+ for( y=sy; y<ey; y++ )
{
- for( y=sy; y<ey; y++ )
- {
- source = source_base + (y_index>>16) * gfx->line_modulo;
- y_index += dy;
- dest = BITMAP_ADDR32(dest_bmp, y, 0);
- x_index = x_index_base;
-
- for( x=sx; x<ex; x++ )
- {
- c = source[x_index>>16];
- x_index += dx;
+ source = source_base + (y_index>>16) * gfx->line_modulo;
+ y_index += dy;
+ dest = BITMAP_ADDR32(dest_bmp, y, 0);
+ x_index = x_index_base;
- if (gfx_drawmode_table[c] == DRAWMODE_NONE) continue;
- if (gfx_drawmode_table[c] == DRAWMODE_SOURCE)
- dest[x] = pal[c];
- else
- dest[x] = SHADOW32(palette_shadow_table,dest[x]);
- }
+ for( x=sx; x<ex; x++ )
+ {
+ c = source[x_index>>16];
+ x_index += dx;
+
+ if (gfx_drawmode_table[c] == DRAWMODE_NONE) continue;
+ if (gfx_drawmode_table[c] == DRAWMODE_SOURCE)
+ dest[x] = pal[c];
+ else
+ dest[x] = SHADOW32(palette_shadow_table,dest[x]);
}
}
}
+ }
- /* case 6: TRANSPARENCY_ALPHA */
- if (transparency == TRANSPARENCY_ALPHA)
+ /* case 6: TRANSPARENCY_ALPHA */
+ if (transparency == TRANSPARENCY_ALPHA)
+ {
+ if (pri_buffer)
{
- if (pri_buffer)
+ for( y=sy; y<ey; y++ )
{
- for( y=sy; y<ey; y++ )
- {
- UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
- UINT32 *dest = BITMAP_ADDR32(dest_bmp, y, 0);
- UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
+ UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
+ UINT32 *dest = BITMAP_ADDR32(dest_bmp, y, 0);
+ UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
- int x, x_index = x_index_base;
- for( x=sx; x<ex; x++ )
+ int x, x_index = x_index_base;
+ for( x=sx; x<ex; x++ )
+ {
+ int c = source[x_index>>16];
+ if( c != transparent_color )
{
- int c = source[x_index>>16];
- if( c != transparent_color )
- {
- if (((1 << pri[x]) & pri_mask) == 0)
- dest[x] = alpha_blend32(dest[x], pal[c]);
- pri[x] = 31;
- }
- x_index += dx;
+ if (((1 << pri[x]) & pri_mask) == 0)
+ dest[x] = alpha_blend32(dest[x], pal[c]);
+ pri[x] = 31;
}
-
- y_index += dy;
+ x_index += dx;
}
+
+ y_index += dy;
}
- else
+ }
+ else
+ {
+ for( y=sy; y<ey; y++ )
{
- for( y=sy; y<ey; y++ )
- {
- UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
- UINT32 *dest = BITMAP_ADDR32(dest_bmp, y, 0);
-
- int x, x_index = x_index_base;
- for( x=sx; x<ex; x++ )
- {
- int c = source[x_index>>16];
- if( c != transparent_color ) dest[x] = alpha_blend32(dest[x], pal[c]);
- x_index += dx;
- }
+ UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
+ UINT32 *dest = BITMAP_ADDR32(dest_bmp, y, 0);
- y_index += dy;
+ int x, x_index = x_index_base;
+ for( x=sx; x<ex; x++ )
+ {
+ int c = source[x_index>>16];
+ if( c != transparent_color ) dest[x] = alpha_blend32(dest[x], pal[c]);
+ x_index += dx;
}
+
+ y_index += dy;
}
}
+ }
- /* pjp 31/5/02 */
- /* case 7: TRANSPARENCY_ALPHARANGE */
- if (transparency == TRANSPARENCY_ALPHARANGE)
+ /* pjp 31/5/02 */
+ /* case 7: TRANSPARENCY_ALPHARANGE */
+ if (transparency == TRANSPARENCY_ALPHARANGE)
+ {
+ if (pri_buffer)
{
- if (pri_buffer)
+ for( y=sy; y<ey; y++ )
{
- for( y=sy; y<ey; y++ )
- {
- UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
- UINT32 *dest = BITMAP_ADDR32(dest_bmp, y, 0);
- UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
+ UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
+ UINT32 *dest = BITMAP_ADDR32(dest_bmp, y, 0);
+ UINT8 *pri = BITMAP_ADDR8(pri_buffer, y, 0);
- int x, x_index = x_index_base;
- for( x=sx; x<ex; x++ )
- {
- int c = source[x_index>>16];
- if( c != transparent_color )
- {
- if (((1 << pri[x]) & pri_mask) == 0)
- {
- if( gfx_alpharange_table[c] == 0xff )
- dest[x] = pal[c];
- else
- dest[x] = alpha_blend_r32(dest[x], pal[c], gfx_alpharange_table[c]);
- }
- pri[x] = 31;
- }
- x_index += dx;
- }
-
- y_index += dy;
- }
- }
- else
- {
- for( y=sy; y<ey; y++ )
+ int x, x_index = x_index_base;
+ for( x=sx; x<ex; x++ )
{
- UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
- UINT32 *dest = BITMAP_ADDR32(dest_bmp, y, 0);
-
- int x, x_index = x_index_base;
- for( x=sx; x<ex; x++ )
+ int c = source[x_index>>16];
+ if( c != transparent_color )
{
- int c = source[x_index>>16];
- if( c != transparent_color )
+ if (((1 << pri[x]) & pri_mask) == 0)
{
if( gfx_alpharange_table[c] == 0xff )
dest[x] = pal[c];
else
dest[x] = alpha_blend_r32(dest[x], pal[c], gfx_alpharange_table[c]);
}
- x_index += dx;
+ pri[x] = 31;
}
+ x_index += dx;
+ }
- y_index += dy;
+ y_index += dy;
+ }
+ }
+ else
+ {
+ for( y=sy; y<ey; y++ )
+ {
+ UINT8 *source = source_base + (y_index>>16) * gfx->line_modulo;
+ UINT32 *dest = BITMAP_ADDR32(dest_bmp, y, 0);
+
+ int x, x_index = x_index_base;
+ for( x=sx; x<ex; x++ )
+ {
+ int c = source[x_index>>16];
+ if( c != transparent_color )
+ {
+ if( gfx_alpharange_table[c] == 0xff )
+ dest[x] = pal[c];
+ else
+ dest[x] = alpha_blend_r32(dest[x], pal[c], gfx_alpharange_table[c]);
+ }
+ x_index += dx;
}
+
+ y_index += dy;
}
}
}
@@ -3766,6 +3764,9 @@ DECLARE(drawgfx_core,(
int ex;
int ey;
+ /* verify arguments */
+ assert(dest != NULL);
+ assert(gfx != NULL);
/* check bounds */
ox = sx;