diff --git a/LICENSE.txt b/LICENSE.txt index a1db71aea..7d9e58083 100644 --- a/LICENSE.txt +++ b/LICENSE.txt @@ -1,4 +1,4 @@ -Copyright (c) 2018-2021 Igara Studio S.A. +Copyright (c) 2018-2022 Igara Studio S.A. Copyright (c) 2018 David Capello Permission is hereby granted, free of charge, to any person obtaining diff --git a/scripts/color.lua b/scripts/color.lua index f71eee379..ab2751837 100644 --- a/scripts/color.lua +++ b/scripts/color.lua @@ -1,3 +1,4 @@ +-- Copyright (C) 2022 Igara Studio S.A. -- Copyright (C) 2018 David Capello -- -- This file is released under the terms of the MIT license. @@ -41,3 +42,4 @@ assert(b.saturation == 0.4) assert(b.value == 0.5) assert(b.alpha == 200) assert(a == b) +assert(a ~= 1) -- Comparing with other type fails diff --git a/scripts/layers.lua b/scripts/layers.lua index 6fec6899f..a8e16dffc 100644 --- a/scripts/layers.lua +++ b/scripts/layers.lua @@ -1,4 +1,4 @@ --- Copyright (C) 2019 Igara Studio S.A. +-- Copyright (C) 2019-2022 Igara Studio S.A. -- Copyright (C) 2018 David Capello -- -- This file is released under the terms of the MIT license. @@ -204,3 +204,12 @@ do i = i + 1 end end + +-- Compare layers vs sprites (just return false) + +do + local s = Sprite(2, 2) + assert(s.layers[1].parent == s) + assert(s.layers[1] ~= s) -- Uses Layer_eq() to compare + assert(s ~= s.layers[1]) -- Uses Sprite_eq() to compare +end diff --git a/scripts/sprite.lua b/scripts/sprite.lua index 347509b82..16f52be5d 100644 --- a/scripts/sprite.lua +++ b/scripts/sprite.lua @@ -1,4 +1,4 @@ --- Copyright (C) 2019-2021 Igara Studio S.A. +-- Copyright (C) 2019-2022 Igara Studio S.A. -- Copyright (C) 2018 David Capello -- -- This file is released under the terms of the MIT license. @@ -197,3 +197,12 @@ do assert(s.cels[1].image:getPixel(0, 0) == 2) assert(s.cels[1].image:getPixel(1, 0) == 1) -- Get the color of the first layer end + +-- Compare sprite IDs + +do + local a = Sprite(1, 1) + local b = Sprite(1, 1) + assert(a == a) + assert(a ~= b) -- Compares IDs, not sprite size +end