summaryrefslogtreecommitdiffstatshomepage
path: root/src/mame/drivers/fcrash.c
diff options
context:
space:
mode:
author Aaron Giles <aaron@aarongiles.com>2013-07-26 08:15:05 +0000
committer Aaron Giles <aaron@aarongiles.com>2013-07-26 08:15:05 +0000
commitec07fb10225293829c870f2ce1ffd05732f671ca (patch)
tree5fed58d5c5d4ecf690475e91f3546036a14abdd8 /src/mame/drivers/fcrash.c
parentb5e744c477c41c28d1cefb88c622ae3a1cd4eb4e (diff)
Fix long-standing architectural wart: the priority bitmap is no longer owned
by the tilemap system, and no longer exists globally in the machine. Instead it is allocated per-screen for all systems. This has several side-effects: 1. Previously, the pdrawgfx* functions were already changed to take the priority bitmap as a parameter. Now all other hand-crafted functions that mess with the priority bitmap generally must do so as well, and have been updated. 2. Calls to the tilemap system now need to provide a screen_device. This is not just for the priority_bitmap, but also for screen flipping, which previously always assumed the "primary screen" when doing flipping calculations. 3. All devices that implemented tilemap-like functionality have been updated to follow the same pattern, since they largely tend to call through to the core tilemap system at some point.
Diffstat (limited to 'src/mame/drivers/fcrash.c')
-rw-r--r--src/mame/drivers/fcrash.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/mame/drivers/fcrash.c b/src/mame/drivers/fcrash.c
index ed36b255fc8..da89b3e3f26 100644
--- a/src/mame/drivers/fcrash.c
+++ b/src/mame/drivers/fcrash.c
@@ -492,7 +492,7 @@ void cps_state::fcrash_update_transmasks()
}
}
-void cps_state::fcrash_render_sprites( bitmap_ind16 &bitmap, const rectangle &cliprect )
+void cps_state::fcrash_render_sprites( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect )
{
int pos;
int base = m_sprite_base / 2;
@@ -523,27 +523,27 @@ void cps_state::fcrash_render_sprites( bitmap_ind16 &bitmap, const rectangle &cl
ypos = 256 - ypos - 16;
xpos = xpos + m_sprite_x_offset + 49;
- pdrawgfx_transpen(bitmap, cliprect, machine().gfx[2], tileno, colour, flipx, flipy, xpos, ypos, machine().priority_bitmap, 0x02, 15);
+ pdrawgfx_transpen(bitmap, cliprect, machine().gfx[2], tileno, colour, flipx, flipy, xpos, ypos, screen.priority(), 0x02, 15);
}
}
}
-void cps_state::fcrash_render_layer( bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int primask )
+void cps_state::fcrash_render_layer( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer, int primask )
{
switch (layer)
{
case 0:
- fcrash_render_sprites(bitmap, cliprect);
+ fcrash_render_sprites(screen, bitmap, cliprect);
break;
case 1:
case 2:
case 3:
- m_bg_tilemap[layer - 1]->draw(bitmap, cliprect, TILEMAP_DRAW_LAYER1, primask);
+ m_bg_tilemap[layer - 1]->draw(screen, bitmap, cliprect, TILEMAP_DRAW_LAYER1, primask);
break;
}
}
-void cps_state::fcrash_render_high_layer( bitmap_ind16 &bitmap, const rectangle &cliprect, int layer )
+void cps_state::fcrash_render_high_layer( screen_device &screen, bitmap_ind16 &bitmap, const rectangle &cliprect, int layer )
{
bitmap_ind16 dummy_bitmap;
@@ -555,7 +555,7 @@ void cps_state::fcrash_render_high_layer( bitmap_ind16 &bitmap, const rectangle
case 1:
case 2:
case 3:
- m_bg_tilemap[layer - 1]->draw(dummy_bitmap, cliprect, TILEMAP_DRAW_LAYER0, 1);
+ m_bg_tilemap[layer - 1]->draw(screen, dummy_bitmap, cliprect, TILEMAP_DRAW_LAYER0, 1);
break;
}
}
@@ -637,28 +637,28 @@ UINT32 cps_state::screen_update_fcrash(screen_device &screen, bitmap_ind16 &bitm
/* Blank screen */
bitmap.fill(0xbff, cliprect);
- machine().priority_bitmap.fill(0, cliprect);
+ screen.priority().fill(0, cliprect);
l0 = (layercontrol >> 0x06) & 03;
l1 = (layercontrol >> 0x08) & 03;
l2 = (layercontrol >> 0x0a) & 03;
l3 = (layercontrol >> 0x0c) & 03;
- fcrash_render_layer(bitmap, cliprect, l0, 0);
+ fcrash_render_layer(screen, bitmap, cliprect, l0, 0);
if (l1 == 0)
- fcrash_render_high_layer(bitmap, cliprect, l0);
+ fcrash_render_high_layer(screen, bitmap, cliprect, l0);
- fcrash_render_layer(bitmap, cliprect, l1, 0);
+ fcrash_render_layer(screen, bitmap, cliprect, l1, 0);
if (l2 == 0)
- fcrash_render_high_layer(bitmap, cliprect, l1);
+ fcrash_render_high_layer(screen, bitmap, cliprect, l1);
- fcrash_render_layer(bitmap, cliprect, l2, 0);
+ fcrash_render_layer(screen, bitmap, cliprect, l2, 0);
if (l3 == 0)
- fcrash_render_high_layer(bitmap, cliprect, l2);
+ fcrash_render_high_layer(screen, bitmap, cliprect, l2);
- fcrash_render_layer(bitmap, cliprect, l3, 0);
+ fcrash_render_layer(screen, bitmap, cliprect, l3, 0);
return 0;
}