mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-30 15:32:38 +00:00
Add asserts to detect bugs adding cels w/pixel format != sprite's pixel format
This commit is contained in:
parent
5a5579973c
commit
8f891a4e25
@ -156,7 +156,11 @@ Cel* LayerImage::getLastCel() const
|
||||
|
||||
void LayerImage::addCel(Cel* cel)
|
||||
{
|
||||
ASSERT(cel);
|
||||
ASSERT(cel->data() && "The cel doesn't contain CelData");
|
||||
ASSERT(cel->image());
|
||||
ASSERT(sprite());
|
||||
ASSERT(cel->image()->pixelFormat() == sprite()->pixelFormat());
|
||||
|
||||
CelIterator it = getCelBegin();
|
||||
CelIterator end = getCelEnd();
|
||||
|
@ -134,6 +134,11 @@ static void compose_scaled_image_scale_up(
|
||||
gfx::Clip area,
|
||||
int opacity, BlendMode blend_mode, Zoom zoom)
|
||||
{
|
||||
ASSERT(dst);
|
||||
ASSERT(src);
|
||||
ASSERT(DstTraits::pixel_format == dst->pixelFormat());
|
||||
ASSERT(SrcTraits::pixel_format == src->pixelFormat());
|
||||
|
||||
BlenderHelper<DstTraits, SrcTraits> blender(src, pal, blend_mode);
|
||||
int px_x, px_y;
|
||||
|
||||
@ -261,6 +266,11 @@ static void compose_scaled_image_scale_down(
|
||||
gfx::Clip area,
|
||||
int opacity, BlendMode blend_mode, Zoom zoom)
|
||||
{
|
||||
ASSERT(dst);
|
||||
ASSERT(src);
|
||||
ASSERT(DstTraits::pixel_format == dst->pixelFormat());
|
||||
ASSERT(SrcTraits::pixel_format == src->pixelFormat());
|
||||
|
||||
BlenderHelper<DstTraits, SrcTraits> blender(src, pal, blend_mode);
|
||||
int unbox_w = zoom.remove(1);
|
||||
int unbox_h = zoom.remove(1);
|
||||
|
Loading…
x
Reference in New Issue
Block a user