remove pivot from samples

This commit is contained in:
BlackMATov
2020-04-24 21:47:53 +07:00
parent cd971c269d
commit 31288fafd6
14 changed files with 88 additions and 58 deletions

View File

@@ -2,11 +2,9 @@
"texture" : "image.png",
"sprites" : [{
"name" : "sprite",
"pivot" : { "x" : 1, "y" : 2 },
"texrect" : { "x" : 5, "y" : 6, "w" : 7, "h" : 8 }
},{
"name" : "sprite2",
"pivot" : { "x" : 1, "y" : 2 },
"inner_texrect" : { "x" : 1, "y" : 2, "w" : 3, "h" : 4 },
"outer_texrect" : { "x" : 5, "y" : 6, "w" : 7, "h" : 8 }
}]

View File

@@ -1,5 +1,4 @@
{
"texture" : "image.png",
"pivot" : { "x" : 1, "y" : 2 },
"texrect" : { "x" : 5, "y" : 6, "w" : 7, "h" : 8 }
}

View File

@@ -1,6 +1,5 @@
{
"texture" : "image.png",
"pivot" : { "x" : 1, "y" : 2 },
"inner_texrect" : { "x" : 1, "y" : 2, "w" : 3, "h" : 4 },
"outer_texrect" : { "x" : 5, "y" : 6, "w" : 7, "h" : 8 }
}

View File

@@ -192,14 +192,12 @@ TEST_CASE("library"){
sprite_asset::ptr spr = atlas_res->find_nested_asset<sprite_asset>("sprite");
REQUIRE(spr);
REQUIRE(spr->content().pivot() == v2f(1.f,2.f));
REQUIRE(spr->content().inner_texrect() == b2f(5.f,6.f,7.f,8.f));
REQUIRE(spr->content().outer_texrect() == b2f(5.f,6.f,7.f,8.f));
REQUIRE(spr->content().texture()== texture_res);
sprite_asset::ptr spr2 = atlas_res->find_nested_asset<sprite_asset>("sprite2");
REQUIRE(spr2);
REQUIRE(spr2->content().pivot() == v2f(1.f,2.f));
REQUIRE(spr2->content().inner_texrect() == b2f(1.f,2.f,3.f,4.f));
REQUIRE(spr2->content().outer_texrect() == b2f(5.f,6.f,7.f,8.f));
REQUIRE(spr2->content().texture()== texture_res);
@@ -208,14 +206,12 @@ TEST_CASE("library"){
{
auto sprite_res = l.load_asset<sprite_asset>("sprite.json");
REQUIRE(sprite_res);
REQUIRE(sprite_res->content().pivot() == v2f(1.f, 2.f));
REQUIRE(sprite_res->content().inner_texrect() == b2f(5.f, 6.f, 7.f, 8.f));
REQUIRE(sprite_res->content().outer_texrect() == b2f(5.f, 6.f, 7.f, 8.f));
REQUIRE(sprite_res->content().texture() == texture_res);
auto sprite2_res = l.load_asset<sprite_asset>("sprite2.json");
REQUIRE(sprite2_res);
REQUIRE(sprite2_res->content().pivot() == v2f(1.f, 2.f));
REQUIRE(sprite2_res->content().inner_texrect() == b2f(1.f, 2.f, 3.f, 4.f));
REQUIRE(sprite2_res->content().outer_texrect() == b2f(5.f, 6.f, 7.f, 8.f));
REQUIRE(sprite2_res->content().texture() == texture_res);