mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-04 18:41:51 +00:00
add 'obj' format support to assets.parse_model
This commit is contained in:
parent
fc04284b34
commit
8c72e3ab4b
1 changed files with 8 additions and 2 deletions
|
|
@ -1,16 +1,17 @@
|
|||
#include "api_lua.hpp"
|
||||
|
||||
#include "../usertypes/lua_type_canvas.hpp"
|
||||
#include "assets/Assets.hpp"
|
||||
#include "assets/AssetsLoader.hpp"
|
||||
#include "coders/obj.hpp"
|
||||
#include "coders/png.hpp"
|
||||
#include "coders/vcm.hpp"
|
||||
#include "debug/Logger.hpp"
|
||||
#include "engine/Engine.hpp"
|
||||
#include "graphics/commons/Model.hpp"
|
||||
#include "graphics/core/Texture.hpp"
|
||||
#include "graphics/core/Atlas.hpp"
|
||||
#include "graphics/core/Texture.hpp"
|
||||
#include "util/Buffer.hpp"
|
||||
#include "../usertypes/lua_type_canvas.hpp"
|
||||
|
||||
using namespace scripting;
|
||||
|
||||
|
|
@ -76,6 +77,11 @@ static int l_parse_model(lua::State* L) {
|
|||
skeletonName = lua::require_string(L, 4);
|
||||
}
|
||||
|
||||
if (format == "obj") {
|
||||
assets.store(obj::parse(name, string), name);
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (format != "xml" && format != "vcm") {
|
||||
throw std::runtime_error(
|
||||
"unknown format " + util::quote(std::string(format))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue