model1: clear up some memory issues with very recent gcc (nw)

This commit is contained in:
Olivier Galibert 2018-03-15 11:22:27 +01:00
parent cb513bd46e
commit a1b2073b0d
2 changed files with 38 additions and 6 deletions

View File

@ -156,7 +156,39 @@ public:
class view_t
{
public:
view_t() { }
view_t() {
xc = 0;
yc = 0;
x1 = 0;
y1 = 0;
x2 = 0;
y2 = 0;
zoomx = 0;
zoomy = 0;
viewx = 0;
viewy = 0;
a_bottom = 0;
a_top = 0;
a_left = 0;
a_right = 0;
vxx = 0;
vyy = 0;
vzz = 0;
ayy = 0;
ayyc = 0;
ayys = 0;
for(unsigned int i=0; i != 12; i++)
translation[i] = 0;
light.x = 0;
light.y = 0;
light.z = 0;
for(unsigned int i=0; i != 32; i++) {
lightparams[i].a = 0;
lightparams[i].d = 0;
lightparams[i].s = 0;
lightparams[i].p = 0;
}
}
void init_translation_matrix();
@ -372,7 +404,7 @@ private:
std::function<void(view_t*, point_t*, point_t*, point_t*)> m_clip;
};
view_t *m_view;
std::unique_ptr<view_t> m_view;
point_t *m_pointdb;
point_t *m_pointpt;
quad_t *m_quaddb;

View File

@ -471,7 +471,7 @@ void model1_state::unsort_quads() const
void model1_state::draw_quads(bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
view_t *view = m_view;
view_t *view = m_view.get();
int count = m_quadpt - m_quaddb;
/* clip to the cliprect */
@ -598,7 +598,7 @@ void model1_state::fclip_push_quad_next(int level, quad_t& q, point_t *p1, point
void model1_state::fclip_push_quad(int level, quad_t& q)
{
view_t *view = m_view;
view_t *view = m_view.get();
if (level == 4)
{
@ -1564,7 +1564,7 @@ void model1_state::tgp_scan()
VIDEO_START_MEMBER(model1_state, model1)
{
m_view = auto_alloc_clear(machine(), <model1_state::view_t>());
m_view = std::make_unique<model1_state::view_t>();
m_poly_ram = make_unique_clear<uint32_t[]>(0x400000);
m_tgp_ram = make_unique_clear<uint16_t[]>(0x100000-0x40000);
@ -1592,7 +1592,7 @@ VIDEO_START_MEMBER(model1_state, model1)
uint32_t model1_state::screen_update_model1(screen_device &screen, bitmap_rgb32 &bitmap, const rectangle &cliprect)
{
model1_state::view_t *view = m_view;
model1_state::view_t *view = m_view.get();
#if 0
{
bool mod = false;