mirror of
https://github.com/holub/mame
synced 2025-10-07 01:16:22 +03:00
namcos23: fix the polynew conversion [O. Galibert]
This commit is contained in:
parent
0063655812
commit
3575436b96
@ -1286,6 +1286,7 @@ struct namcos23_render_data
|
|||||||
{
|
{
|
||||||
running_machine *machine;
|
running_machine *machine;
|
||||||
const pen_t *pens;
|
const pen_t *pens;
|
||||||
|
bitmap_rgb32 *bitmap;
|
||||||
UINT32 (*texture_lookup)(running_machine &machine, const pen_t *pens, float x, float y);
|
UINT32 (*texture_lookup)(running_machine &machine, const pen_t *pens, float x, float y);
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -1301,7 +1302,6 @@ public:
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
namcos23_state& m_state;
|
namcos23_state& m_state;
|
||||||
bitmap_rgb32 m_bitmap;
|
|
||||||
float* m_zBuffer;
|
float* m_zBuffer;
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -1584,8 +1584,7 @@ UINT16 namcos23_state::nthword(const UINT32 *pSource, int offs)
|
|||||||
|
|
||||||
namcos23_renderer::namcos23_renderer(namcos23_state &state)
|
namcos23_renderer::namcos23_renderer(namcos23_state &state)
|
||||||
: poly_manager<float, namcos23_render_data, 5, POLY_MAX_ENTRIES>(state.machine()),
|
: poly_manager<float, namcos23_render_data, 5, POLY_MAX_ENTRIES>(state.machine()),
|
||||||
m_state(state),
|
m_state(state)
|
||||||
m_bitmap(state.m_screen->width(), state.m_screen->height())
|
|
||||||
{
|
{
|
||||||
const INT32 bufferSize = state.m_screen->visible_area().width() * state.m_screen->visible_area().height();
|
const INT32 bufferSize = state.m_screen->visible_area().width() * state.m_screen->visible_area().height();
|
||||||
m_zBuffer = auto_alloc_array(state.machine(), float, bufferSize);
|
m_zBuffer = auto_alloc_array(state.machine(), float, bufferSize);
|
||||||
@ -1896,7 +1895,7 @@ void namcos23_renderer::render_scanline(INT32 scanline, const extent_t& extent,
|
|||||||
float dv = extent.param[3].dpdx;
|
float dv = extent.param[3].dpdx;
|
||||||
float dl = extent.param[4].dpdx;
|
float dl = extent.param[4].dpdx;
|
||||||
|
|
||||||
UINT32 *img = &m_bitmap.pix32(scanline, extent.startx);
|
UINT32 *img = &object.bitmap->pix32(scanline, extent.startx);
|
||||||
float* zBuffer = &m_zBuffer[(scanline * m_state.m_screen->visible_area().width()) + extent.startx];
|
float* zBuffer = &m_zBuffer[(scanline * m_state.m_screen->visible_area().width()) + extent.startx];
|
||||||
|
|
||||||
for(int x = extent.startx; x < extent.stopx; x++) {
|
for(int x = extent.startx; x < extent.stopx; x++) {
|
||||||
@ -2131,6 +2130,7 @@ void namcos23_renderer::render_flush(bitmap_rgb32& bitmap)
|
|||||||
const namcos23_poly_entry *p = &render.polys[i];
|
const namcos23_poly_entry *p = &render.polys[i];
|
||||||
namcos23_render_data& extra = render.polymgr->object_data_alloc();
|
namcos23_render_data& extra = render.polymgr->object_data_alloc();
|
||||||
extra = p->rd;
|
extra = p->rd;
|
||||||
|
extra.bitmap = &bitmap;
|
||||||
|
|
||||||
// We should probably split the polygons into triangles ourselves to insure everything is being rendered properly
|
// We should probably split the polygons into triangles ourselves to insure everything is being rendered properly
|
||||||
if (p->vertex_count == 3)
|
if (p->vertex_count == 3)
|
||||||
@ -2143,8 +2143,7 @@ void namcos23_renderer::render_flush(bitmap_rgb32& bitmap)
|
|||||||
render_polygon<6>(scissor, render_delegate(FUNC(namcos23_renderer::render_scanline), this), 5, p->pv);
|
render_polygon<6>(scissor, render_delegate(FUNC(namcos23_renderer::render_scanline), this), 5, p->pv);
|
||||||
}
|
}
|
||||||
render.poly_count = 0;
|
render.poly_count = 0;
|
||||||
|
render.polymgr->wait();
|
||||||
copybitmap(bitmap, m_bitmap, 0, 0, 0, 0, scissor);
|
|
||||||
|
|
||||||
// Reset the buffers
|
// Reset the buffers
|
||||||
for (int i = 0; i < (m_state.m_screen->visible_area().width())*(m_state.m_screen->visible_area().height()); i++)
|
for (int i = 0; i < (m_state.m_screen->visible_area().width())*(m_state.m_screen->visible_area().height()); i++)
|
||||||
@ -2171,7 +2170,6 @@ void namcos23_state::render_run(bitmap_rgb32 &bitmap)
|
|||||||
re++;
|
re++;
|
||||||
}
|
}
|
||||||
render.polymgr->render_flush(bitmap);
|
render.polymgr->render_flush(bitmap);
|
||||||
render.polymgr->wait();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user