Skip to content

Commit

Permalink
Move nullcheck to C++
Browse files Browse the repository at this point in the history
  • Loading branch information
ACrazyTown committed Dec 12, 2024
1 parent 0703202 commit 6253252
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
10 changes: 9 additions & 1 deletion project/src/ExternalInterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2052,7 +2052,15 @@ namespace lime {

} else {

ImageDataUtil::CopyPixels (image, sourceImage, sourceRect, destPoint, alphaImage, alphaPoint, mergeAlpha);
Vector2* _alphaPoint = alphaPoint ? alphaPoint : new Vector2(0, 0);

ImageDataUtil::CopyPixels (image, sourceImage, sourceRect, destPoint, alphaImage, _alphaPoint, mergeAlpha);

if (!alphaPoint) {

delete _alphaPoint;

}

}

Expand Down
7 changes: 0 additions & 7 deletions src/lime/_internal/graphics/ImageDataUtil.hx
Original file line number Diff line number Diff line change
Expand Up @@ -311,13 +311,6 @@ class ImageDataUtil
else
{
#if (lime_cffi && !disable_cffi && !macro)
#if hl
if (alphaPoint == null)
{
alphaPoint = new Vector2();
}
#end

if (CFFI.enabled) NativeCFFI.lime_image_data_util_copy_pixels(image, sourceImage, sourceRect, destPoint, alphaImage, alphaPoint, mergeAlpha);
else
#end
Expand Down

0 comments on commit 6253252

Please sign in to comment.