fixed component loading

This commit is contained in:
andrey.zhirnov
2019-08-26 18:33:35 +03:00
parent ca9f57f7d4
commit a53060f423
2 changed files with 7 additions and 16 deletions

View File

@@ -120,14 +120,10 @@ namespace e2d
"model" : { "$ref": "#/common_definitions/address" },
"animations" : {
"type" : "array",
"items" : { "$ref": "#/definitions/spine_animation_array" }
"items" : { "$ref": "#/definitions/spine_animation" }
}
},
"definitions" : {
"spine_animation_array" : {
"type" : "array",
"items" : { "$ref": "#/definitions/spine_animation" }
},
"spine_animation" : {
"type" : "object",
"required" : [ "track", "name" ],
@@ -151,8 +147,8 @@ namespace e2d
path::combine(ctx.parent_address, ctx.root["model"].GetString()));
if ( !model ) {
the<debug>().error("SPINE_PLAYER: Dependency 'model' is not found:\n"
"--> Parent address: %s\n"
"--> Dependency address: $s",
"--> Parent address: %0\n"
"--> Dependency address: %1",
ctx.parent_address,
ctx.root["model"].GetString());
return false;

View File

@@ -97,8 +97,8 @@ namespace e2d
path::combine(ctx.parent_address, ctx.root["model"].GetString()));
if ( !model ) {
the<debug>().error("SPINE RENDERER: Dependency 'model' is not found:\n"
"--> Parent address: %s\n"
"--> Dependency address: $s",
"--> Parent address: %0\n"
"--> Dependency address: %1",
ctx.parent_address,
ctx.root["model"].GetString());
return false;
@@ -115,7 +115,7 @@ namespace e2d
component.skin(skin);
}
return false;
return true;
}
bool factory_loader<spine_renderer>::operator()(
@@ -126,12 +126,7 @@ namespace e2d
dependencies.add_dependency<spine_model_asset>(
path::combine(ctx.parent_address, ctx.root["model"].GetString()));
}
if ( ctx.root.HasMember("skin") ) {
dependencies.add_dependency<spine_model_asset>(
path::combine(ctx.parent_address, ctx.root["skin"].GetString()));
}
return false;
return true;
}
}