Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ namespace action {

using SpriteAnimationTable = ::ugdk::structure::IndexableTable<SpriteAnimation>;

std::shared_ptr<const SpriteAnimationTable> LoadSpriteAnimationTableFromFile(const std::string& filepath);
const SpriteAnimationTable* LoadSpriteAnimationTableFromFile(const std::string& filepath);

} // namespace action
} // namespace ugdk
Expand Down
5 changes: 2 additions & 3 deletions modules/ugdk-core/src/action/json2spriteanimation.cc
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ namespace {
};
}

std::shared_ptr<const SpriteAnimationTable> LoadSpriteAnimationTableFromFile(const std::string& filepath) {
const SpriteAnimationTable* LoadSpriteAnimationTableFromFile(const std::string& filepath) {
auto file = filesystem::manager().OpenFile(filepath);
if (!file)
return nullptr;
Expand All @@ -81,7 +81,7 @@ std::shared_ptr<const SpriteAnimationTable> LoadSpriteAnimationTableFromFile(con
throw system::BaseException("Invalid json: %s\n", filepath.c_str());

auto json_node = libjson::parse(contents);
std::shared_ptr<SpriteAnimationTable> table(new SpriteAnimationTable(json_node.size()));
SpriteAnimationTable* table(new SpriteAnimationTable(json_node.size()));
for (const auto& animation_json : json_node) {
auto element = MakeUnique<SpriteAnimation>();

Expand All @@ -108,4 +108,3 @@ std::shared_ptr<const SpriteAnimationTable> LoadSpriteAnimationTableFromFile(con

} // namespace action
} // namespace ugdk