clut.data = 0;
if (!data)
- data = malloc(y * stride);
+ data = new unsigned char [y * stride];
type = 1;
}
if (data_phys)
gAccel::getInstance()->accelFree(data_phys);
else
- free(data);
+ delete [] (unsigned char*)data;
- delete[] clut.data;
+ delete [] clut.data;
}
}
dstptr+=surface->stride;
}
} else
- eFatal("cannot blit %dbpp from %dbpp", surface->bpp, src.surface->bpp);
+ eWarning("cannot blit %dbpp from %dbpp", surface->bpp, src.surface->bpp);
}
}
gPixmap::~gPixmap()
{
+ if (must_delete_surface)
+ delete surface;
}
-gPixmap::gPixmap(gSurface *surface): surface(surface)
+gPixmap::gPixmap(gSurface *surface)
+ :surface(surface), must_delete_surface(false)
{
}
gPixmap::gPixmap(eSize size, int bpp, int accel)
+ :must_delete_surface(true)
{
surface = new gSurface(size, bpp, accel);
}