change rigs role from assets to content units
This commit is contained in:
@@ -31,7 +31,6 @@ AssetsLoader::AssetsLoader(Assets* assets, const ResPaths* paths)
|
||||
addLoader(AssetType::LAYOUT, assetload::layout);
|
||||
addLoader(AssetType::SOUND, assetload::sound);
|
||||
addLoader(AssetType::MODEL, assetload::model);
|
||||
addLoader(AssetType::RIG, assetload::rig);
|
||||
}
|
||||
|
||||
void AssetsLoader::addLoader(AssetType tag, aloader_func func) {
|
||||
@@ -102,7 +101,6 @@ static std::string assets_def_folder(AssetType tag) {
|
||||
case AssetType::LAYOUT: return LAYOUTS_FOLDER;
|
||||
case AssetType::SOUND: return SOUNDS_FOLDER;
|
||||
case AssetType::MODEL: return MODELS_FOLDER;
|
||||
case AssetType::RIG: return RIGS_FOLDER;
|
||||
}
|
||||
return "<error>";
|
||||
}
|
||||
@@ -160,7 +158,6 @@ void AssetsLoader::processPreloadConfig(const fs::path& file) {
|
||||
processPreloadList(AssetType::TEXTURE, root->list("textures"));
|
||||
processPreloadList(AssetType::SOUND, root->list("sounds"));
|
||||
processPreloadList(AssetType::MODEL, root->list("models"));
|
||||
processPreloadList(AssetType::RIG, root->list("rigs"));
|
||||
// layouts are loaded automatically
|
||||
}
|
||||
|
||||
|
||||
@@ -26,8 +26,7 @@ enum class AssetType {
|
||||
ATLAS,
|
||||
LAYOUT,
|
||||
SOUND,
|
||||
MODEL,
|
||||
RIG,
|
||||
MODEL
|
||||
};
|
||||
|
||||
class ResPaths;
|
||||
|
||||
@@ -228,27 +228,6 @@ assetload::postfunc assetload::model(
|
||||
}
|
||||
}
|
||||
|
||||
assetload::postfunc assetload::rig(
|
||||
AssetsLoader* loader,
|
||||
const ResPaths* paths,
|
||||
const std::string& file,
|
||||
const std::string& name,
|
||||
const std::shared_ptr<AssetCfg>&
|
||||
) {
|
||||
auto path = paths->find(file+".json");
|
||||
auto text = files::read_string(path);
|
||||
try {
|
||||
auto rig = rigging::RigConfig::parse(text, path.u8string(), name).release();
|
||||
return [=](Assets* assets) {
|
||||
// TODO: add models loading
|
||||
assets->store(std::unique_ptr<rigging::RigConfig>(rig), name);
|
||||
};
|
||||
} catch (const parsing_error& err) {
|
||||
std::cerr << err.errorLog() << std::endl;
|
||||
throw;
|
||||
}
|
||||
}
|
||||
|
||||
static void read_anim_file(
|
||||
const std::string& animFile,
|
||||
std::vector<std::pair<std::string, int>>& frameList
|
||||
|
||||
@@ -63,13 +63,6 @@ namespace assetload {
|
||||
const std::string& name,
|
||||
const std::shared_ptr<AssetCfg>& settings
|
||||
);
|
||||
postfunc rig(
|
||||
AssetsLoader*,
|
||||
const ResPaths* paths,
|
||||
const std::string& file,
|
||||
const std::string& name,
|
||||
const std::shared_ptr<AssetCfg>& settings
|
||||
);
|
||||
}
|
||||
|
||||
#endif // ASSETS_ASSET_LOADERS_HPP_
|
||||
|
||||
Reference in New Issue
Block a user