diff options
author | Aaron Giles <aaron@aarongiles.com> | 2011-12-31 21:48:36 +0000 |
---|---|---|
committer | Aaron Giles <aaron@aarongiles.com> | 2011-12-31 21:48:36 +0000 |
commit | fcc81b7c6dcc40a8ae944616501f90963ca2aa08 (patch) | |
tree | d0e4ab76c92ca711073e8dd3113103083896156f /src/mame/video/madalien.c | |
parent | 0fb2402169d60ebe944a741408cc7268fd22ca80 (diff) |
Bulk converted cliprect * to cliprect & across the system. This makes
cliprects mandatory everywhere. In general, cliprects were being
correctly passed through the video side of most drivers already, so
it is mostly a semantic change. Note that with my previous change,
bitmaps have cliprects, so if you just want to clip to the bitmap's
boundaries, pass bitmap->cliprect() instead of NULL (which is no
longer permitted). [Aaron Giles]
Diffstat (limited to 'src/mame/video/madalien.c')
-rw-r--r-- | src/mame/video/madalien.c | 32 |
1 files changed, 16 insertions, 16 deletions
diff --git a/src/mame/video/madalien.c b/src/mame/video/madalien.c index 6c86750ee19..2422be22362 100644 --- a/src/mame/video/madalien.c +++ b/src/mame/video/madalien.c @@ -155,19 +155,19 @@ static VIDEO_START( madalien ) gfx_element_set_source(machine.gfx[0], state->m_charram); - drawgfx_opaque(state->m_headlight_bitmap, NULL, machine.gfx[2], 0, 0, 0, 0, 0x00, 0x00); - drawgfx_opaque(state->m_headlight_bitmap, NULL, machine.gfx[2], 0, 0, 0, 1, 0x00, 0x40); + drawgfx_opaque(state->m_headlight_bitmap, state->m_headlight_bitmap->cliprect(), machine.gfx[2], 0, 0, 0, 0, 0x00, 0x00); + drawgfx_opaque(state->m_headlight_bitmap, state->m_headlight_bitmap->cliprect(), machine.gfx[2], 0, 0, 0, 1, 0x00, 0x40); } -static void draw_edges(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int flip, int scroll_mode) +static void draw_edges(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int flip, int scroll_mode) { madalien_state *state = machine.driver_data<madalien_state>(); rectangle clip_edge1; rectangle clip_edge2; - clip_edge1 = *cliprect; - clip_edge2 = *cliprect; + clip_edge1 = cliprect; + clip_edge2 = cliprect; if (flip) { @@ -180,8 +180,8 @@ static void draw_edges(running_machine &machine, bitmap_t *bitmap, const rectang clip_edge2.min_y = *state->m_edge2_pos | 0x80; } - clip_edge1 &= *cliprect; - clip_edge2 &= *cliprect; + clip_edge1 &= cliprect; + clip_edge2 &= cliprect; tilemap_mark_all_tiles_dirty(state->m_tilemap_edge1[scroll_mode]); tilemap_mark_all_tiles_dirty(state->m_tilemap_edge2[scroll_mode]); @@ -194,12 +194,12 @@ static void draw_edges(running_machine &machine, bitmap_t *bitmap, const rectang tilemap_set_scrollx(state->m_tilemap_edge2[scroll_mode], 0, -(*state->m_scroll & 0xfc)); tilemap_set_scrolly(state->m_tilemap_edge2[scroll_mode], 0, *state->m_edge2_pos & 0x7f); - tilemap_draw(bitmap, &clip_edge1, state->m_tilemap_edge1[scroll_mode], 0, 0); - tilemap_draw(bitmap, &clip_edge2, state->m_tilemap_edge2[scroll_mode], 0, 0); + tilemap_draw(bitmap, clip_edge1, state->m_tilemap_edge1[scroll_mode], 0, 0); + tilemap_draw(bitmap, clip_edge2, state->m_tilemap_edge2[scroll_mode], 0, 0); } -static void draw_headlight(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int flip) +static void draw_headlight(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int flip) { madalien_state *state = machine.driver_data<madalien_state>(); if (BIT(*state->m_video_flags, 0)) @@ -214,7 +214,7 @@ static void draw_headlight(running_machine &machine, bitmap_t *bitmap, const rec if (flip) hy = ~hy; - if ((hy < cliprect->min_y) || (hy > cliprect->max_y)) + if ((hy < cliprect.min_y) || (hy > cliprect.max_y)) continue; for (x = 0; x < 0x80; x++) @@ -224,7 +224,7 @@ static void draw_headlight(running_machine &machine, bitmap_t *bitmap, const rec if (flip) hx = ~hx; - if ((hx < cliprect->min_x) || (hx > cliprect->max_x)) + if ((hx < cliprect.min_x) || (hx > cliprect.max_x)) continue; if (state->m_headlight_bitmap->pix16(y, x) != 0) @@ -235,7 +235,7 @@ static void draw_headlight(running_machine &machine, bitmap_t *bitmap, const rec } -static void draw_foreground(running_machine &machine, bitmap_t *bitmap, const rectangle *cliprect, int flip) +static void draw_foreground(running_machine &machine, bitmap_t *bitmap, const rectangle &cliprect, int flip) { madalien_state *state = machine.driver_data<madalien_state>(); tilemap_set_flip(state->m_tilemap_fg, flip ? TILEMAP_FLIPX | TILEMAP_FLIPY : 0); @@ -265,7 +265,7 @@ static SCREEN_UPDATE( madalien ) // mode 3 - transition from A to B int scroll_mode = *state->m_scroll & 3; - bitmap->fill(0, *cliprect); + bitmap->fill(0, cliprect); draw_edges(screen.machine(), bitmap, cliprect, flip, scroll_mode); draw_foreground(screen.machine(), bitmap, cliprect, flip); @@ -295,9 +295,9 @@ static SCREEN_UPDATE( madalien ) min_x = 0xff - max_x_save; } - for (y = cliprect->min_y; y <= cliprect->max_y ; y++) + for (y = cliprect.min_y; y <= cliprect.max_y ; y++) for (x = min_x; x <= max_x; x++) - if ((x >= cliprect->min_x) && (x <= cliprect->max_x)) + if ((x >= cliprect.min_x) && (x <= cliprect.max_x)) bitmap->pix16(y, x) |= 8; } |