mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-06 11:31:49 +00:00
change: skeletons are assets now, not content units
This commit is contained in:
parent
587c140a6b
commit
42c4716be2
17 changed files with 144 additions and 120 deletions
|
|
@ -8,7 +8,6 @@
|
|||
#include "items/ItemDef.hpp"
|
||||
#include "logic/scripting/scripting.hpp"
|
||||
#include "objects/EntityDef.hpp"
|
||||
#include "objects/rigging.hpp"
|
||||
#include "voxels/Block.hpp"
|
||||
#include "world/generator/VoxelFragment.hpp"
|
||||
#include "world/generator/GeneratorDef.hpp"
|
||||
|
|
@ -33,7 +32,6 @@ Content::Content(
|
|||
ContentUnitDefs<GeneratorDef> generators,
|
||||
UptrsMap<std::string, ContentPackRuntime> packs,
|
||||
UptrsMap<std::string, BlockMaterial> blockMaterials,
|
||||
UptrsMap<std::string, rigging::SkeletonConfig> skeletons,
|
||||
ResourceIndicesSet resourceIndices,
|
||||
dv::value defaults,
|
||||
std::unordered_map<std::string, int> tags
|
||||
|
|
@ -41,7 +39,6 @@ Content::Content(
|
|||
: indices(std::move(indices)),
|
||||
packs(std::move(packs)),
|
||||
blockMaterials(std::move(blockMaterials)),
|
||||
skeletons(std::move(skeletons)),
|
||||
defaults(std::move(defaults)),
|
||||
tags(std::move(tags)),
|
||||
blocks(std::move(blocks)),
|
||||
|
|
@ -56,23 +53,6 @@ Content::Content(
|
|||
|
||||
Content::~Content() = default;
|
||||
|
||||
const rigging::SkeletonConfig* Content::getSkeleton(const std::string& id
|
||||
) const {
|
||||
auto found = skeletons.find(id);
|
||||
if (found == skeletons.end()) {
|
||||
return nullptr;
|
||||
}
|
||||
return found->second.get();
|
||||
}
|
||||
|
||||
const rigging::SkeletonConfig& Content::requireSkeleton(const std::string& id) const {
|
||||
auto skeleton = getSkeleton(id);
|
||||
if (skeleton == nullptr) {
|
||||
throw std::runtime_error("skeleton '" + id + "' not loaded");
|
||||
}
|
||||
return *skeleton;
|
||||
}
|
||||
|
||||
const BlockMaterial* Content::findBlockMaterial(const std::string& id) const {
|
||||
auto found = blockMaterials.find(id);
|
||||
if (found == blockMaterials.end()) {
|
||||
|
|
@ -104,8 +84,3 @@ const UptrsMap<std::string, BlockMaterial>& Content::getBlockMaterials() const {
|
|||
const UptrsMap<std::string, ContentPackRuntime>& Content::getPacks() const {
|
||||
return packs;
|
||||
}
|
||||
|
||||
const UptrsMap<std::string, rigging::SkeletonConfig>& Content::getSkeletons(
|
||||
) const {
|
||||
return skeletons;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue