mirror of
https://github.com/NoelFB/tiny_link.git
synced 2024-11-25 18:18:56 +08:00
pulled latest blah fixes
This commit is contained in:
parent
be0000ab4c
commit
eefc0547eb
|
@ -1 +1 @@
|
||||||
Subproject commit d8930f15ac4583206855e03c5f246187072a8526
|
Subproject commit cc5e222be5545d3fd02e61cf0a0afb50407c2578
|
|
@ -117,29 +117,34 @@ void Content::load()
|
||||||
// add sprites
|
// add sprites
|
||||||
for (auto& info : sprite_info)
|
for (auto& info : sprite_info)
|
||||||
{
|
{
|
||||||
Sprite* sprite = sprites.expand();
|
Sprite sprite;
|
||||||
sprite->name = info.name;
|
sprite.name = info.name;
|
||||||
sprite->origin = Vec2::zero;
|
sprite.origin = Vec2::zero;
|
||||||
|
|
||||||
if (info.aseprite.slices.size() > 0 && info.aseprite.slices[0].has_pivot)
|
if (info.aseprite.slices.size() > 0 && info.aseprite.slices[0].has_pivot)
|
||||||
{
|
{
|
||||||
sprite->origin = Vec2(
|
sprite.origin = Vec2(
|
||||||
info.aseprite.slices[0].pivot.x,
|
info.aseprite.slices[0].pivot.x,
|
||||||
info.aseprite.slices[0].pivot.y);
|
info.aseprite.slices[0].pivot.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
for (auto& tag : info.aseprite.tags)
|
for (auto& tag : info.aseprite.tags)
|
||||||
{
|
{
|
||||||
Sprite::Animation* anim = sprite->animations.expand();
|
Sprite::Animation anim;
|
||||||
anim->name = tag.name;
|
anim.name = tag.name;
|
||||||
|
|
||||||
for (int i = tag.from; i <= tag.to; i++)
|
for (int i = tag.from; i <= tag.to; i++)
|
||||||
{
|
{
|
||||||
Sprite::Frame* frame = anim->frames.expand();
|
Sprite::Frame frame;
|
||||||
frame->duration = info.aseprite.frames[i].duration / 1000.0f;
|
frame.duration = info.aseprite.frames[i].duration / 1000.0f;
|
||||||
frame->image = subtextures[info.pack_index + i];
|
frame.image = subtextures[info.pack_index + i];
|
||||||
|
anim.frames.push_back(frame);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sprite.animations.push_back(anim);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sprites.push_back(sprite);
|
||||||
}
|
}
|
||||||
|
|
||||||
// add tilesets
|
// add tilesets
|
||||||
|
|
Loading…
Reference in New Issue
Block a user