rename spine_model to spine

This commit is contained in:
2019-09-05 14:09:55 +07:00
parent 2507753ac6
commit b965094d14
12 changed files with 135 additions and 132 deletions

View File

@@ -21,7 +21,7 @@
#include "assets/shader_asset.hpp"
#include "assets/shape_asset.hpp"
#include "assets/sound_asset.hpp"
#include "assets/spine_model_asset.hpp"
#include "assets/spine_asset.hpp"
#include "assets/sprite_asset.hpp"
#include "assets/text_asset.hpp"
#include "assets/texture_asset.hpp"
@@ -59,6 +59,7 @@
#include "node.hpp"
#include "node.inl"
#include "prefab.hpp"
#include "spine.hpp"
#include "sprite.hpp"
#include "starter.hpp"
#include "world.hpp"

View File

@@ -33,7 +33,7 @@ namespace e2d
class shader_asset;
class shape_asset;
class sound_asset;
class spine_model_asset;
class spine_asset;
class sprite_asset;
class text_asset;
class texture_asset;
@@ -74,6 +74,7 @@ namespace e2d
class model;
class node;
class prefab;
class spine;
class sprite;
class starter;
class world;

View File

@@ -9,13 +9,13 @@
#include "../_high.hpp"
#include "../library.hpp"
#include "../spine_model.hpp"
#include "../spine.hpp"
namespace e2d
{
class spine_model_asset final : public content_asset<spine_model_asset, spine_model> {
class spine_asset final : public content_asset<spine_asset, spine> {
public:
static const char* type_name() noexcept { return "spine_model_asset"; }
static const char* type_name() noexcept { return "spine_asset"; }
static load_async_result load_async(const library& library, str_view address);
};
}

View File

@@ -9,8 +9,8 @@
#include "../_high.hpp"
#include "../factory.hpp"
#include "../assets/spine_asset.hpp"
#include "../assets/material_asset.hpp"
#include "../assets/spine_model_asset.hpp"
struct spSkeleton;
struct spSkeletonClipping;
@@ -32,13 +32,14 @@ namespace e2d
using animation_ptr = std::shared_ptr<spAnimationState>;
public:
spine_player() = default;
spine_player(const spine_model_asset::ptr& model);
spine_player& model(
const spine_model_asset::ptr& value);
spine_player(const spine_asset::ptr& spine);
spine_player& spine(
const spine_asset::ptr& value);
spine_player& materials(
flat_map<str_hash, material_asset::ptr>&& value) noexcept;
spine_player& materials(
const flat_map<str_hash, material_asset::ptr>& value);
@@ -48,18 +49,18 @@ namespace e2d
bool has_skin(const str& name) const noexcept;
bool has_animation(const str& name) const noexcept;
const spine_asset::ptr& spine() const noexcept;
const clipping_ptr& clipper() const noexcept;
const skeleton_ptr& skeleton() const noexcept;
const animation_ptr& animation() const noexcept;
const spine_model_asset::ptr& model() const noexcept;
material_asset::ptr find_material(str_hash name) const noexcept;
const flat_map<str_hash, material_asset::ptr>& materials() const noexcept;
private:
spine_asset::ptr spine_;
clipping_ptr clipping_;
skeleton_ptr skeleton_;
animation_ptr animation_;
spine_model_asset::ptr model_;
flat_map<str_hash, material_asset::ptr> materials_;
};
@@ -71,7 +72,7 @@ namespace e2d
bool operator()(
spine_player& component,
const fill_context& ctx) const;
bool operator()(
asset_dependencies& dependencies,
const collect_context& ctx) const;

View File

@@ -14,39 +14,39 @@ struct spAnimationStateData;
namespace e2d
{
class bad_spine_model_access final : public exception {
class bad_spine_access final : public exception {
public:
const char* what() const noexcept final {
return "bad spine model access";
return "bad spine access";
}
};
class spine_model final {
class spine final {
public:
using atlas_ptr = std::shared_ptr<spAtlas>;
using skeleton_data_ptr = std::shared_ptr<spSkeletonData>;
using animation_data_ptr = std::shared_ptr<spAnimationStateData>;
public:
spine_model() = default;
~spine_model() noexcept = default;
spine() = default;
~spine() noexcept = default;
spine_model(spine_model&& other) noexcept;
spine_model& operator=(spine_model&& other) noexcept;
spine_model(const spine_model& other);
spine_model& operator=(const spine_model& other);
spine(spine&& other) noexcept;
spine& operator=(spine&& other) noexcept;
spine(const spine& other);
spine& operator=(const spine& other);
void clear() noexcept;
void swap(spine_model& other) noexcept;
void swap(spine& other) noexcept;
spine_model& assign(spine_model&& other) noexcept;
spine_model& assign(const spine_model& other);
spine& assign(spine&& other) noexcept;
spine& assign(const spine& other);
spine_model& set_atlas(atlas_ptr atlas);
spine_model& set_skeleton(skeleton_data_ptr skeleton);
spine& set_atlas(atlas_ptr atlas);
spine& set_skeleton(skeleton_data_ptr skeleton);
spine_model& set_default_mix(secf duration);
spine_model& set_animation_mix(
spine& set_default_mix(secf duration);
spine& set_animation_mix(
const str& from,
const str& to,
secf duration);
@@ -60,7 +60,7 @@ namespace e2d
animation_data_ptr animation_;
};
void swap(spine_model& l, spine_model& r) noexcept;
bool operator==(const spine_model& l, const spine_model& r) noexcept;
bool operator!=(const spine_model& l, const spine_model& r) noexcept;
void swap(spine& l, spine& r) noexcept;
bool operator==(const spine& l, const spine& r) noexcept;
bool operator!=(const spine& l, const spine& r) noexcept;
}