diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2022-10-31 11:55:56 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2022-10-31 11:55:56 +0100 |
commit | be126d42d44bfc3ca4133ff6c3c12fcfe849f0c2 (patch) | |
tree | d7bcb97c48e7cef1a234ab13ad9eeb9e65afa50b /modules | |
parent | 33c7c8020a7c1b4103642ff5124b2b76ecdeea14 (diff) | |
parent | d06a8320e5d5117f8a057da16d33443f410a5d9f (diff) |
Merge pull request #67588 from KoBeWi/if(!GDVIRTUAL_CALL)don't
Simplify GDVIRTUAL_CALL calls
Diffstat (limited to 'modules')
-rw-r--r-- | modules/gltf/gltf_document_extension.cpp | 42 |
1 files changed, 14 insertions, 28 deletions
diff --git a/modules/gltf/gltf_document_extension.cpp b/modules/gltf/gltf_document_extension.cpp index 3b952f8246..713779712c 100644 --- a/modules/gltf/gltf_document_extension.cpp +++ b/modules/gltf/gltf_document_extension.cpp @@ -51,45 +51,35 @@ Error GLTFDocumentExtension::import_post(Ref<GLTFState> p_state, Node *p_root) { ERR_FAIL_NULL_V(p_root, ERR_INVALID_PARAMETER); ERR_FAIL_NULL_V(p_state, ERR_INVALID_PARAMETER); int err = OK; - if (GDVIRTUAL_CALL(_import_post, p_state, p_root, err)) { - return Error(err); - } - return OK; + GDVIRTUAL_CALL(_import_post, p_state, p_root, err); + return Error(err); } Error GLTFDocumentExtension::import_preflight(Ref<GLTFState> p_state) { ERR_FAIL_NULL_V(p_state, ERR_INVALID_PARAMETER); int err = OK; - if (GDVIRTUAL_CALL(_import_preflight, p_state, err)) { - return Error(err); - } - return OK; + GDVIRTUAL_CALL(_import_preflight, p_state, err); + return Error(err); } Error GLTFDocumentExtension::import_post_parse(Ref<GLTFState> p_state) { ERR_FAIL_NULL_V(p_state, ERR_INVALID_PARAMETER); int err = OK; - if (GDVIRTUAL_CALL(_import_post_parse, p_state, err)) { - return Error(err); - } - return OK; + GDVIRTUAL_CALL(_import_post_parse, p_state, err); + return Error(err); } Error GLTFDocumentExtension::export_post(Ref<GLTFState> p_state) { ERR_FAIL_NULL_V(p_state, ERR_INVALID_PARAMETER); int err = OK; - if (GDVIRTUAL_CALL(_export_post, p_state, err)) { - return Error(err); - } - return OK; + GDVIRTUAL_CALL(_export_post, p_state, err); + return Error(err); } Error GLTFDocumentExtension::export_preflight(Node *p_root) { ERR_FAIL_NULL_V(p_root, ERR_INVALID_PARAMETER); int err = OK; - if (GDVIRTUAL_CALL(_export_preflight, p_root, err)) { - return Error(err); - } - return OK; + GDVIRTUAL_CALL(_export_preflight, p_root, err); + return Error(err); } Error GLTFDocumentExtension::import_node(Ref<GLTFState> p_state, Ref<GLTFNode> p_gltf_node, Dictionary &r_dict, Node *p_node) { @@ -97,10 +87,8 @@ Error GLTFDocumentExtension::import_node(Ref<GLTFState> p_state, Ref<GLTFNode> p ERR_FAIL_NULL_V(p_gltf_node, ERR_INVALID_PARAMETER); ERR_FAIL_NULL_V(p_node, ERR_INVALID_PARAMETER); int err = OK; - if (GDVIRTUAL_CALL(_import_node, p_state, p_gltf_node, r_dict, p_node, err)) { - return Error(err); - } - return OK; + GDVIRTUAL_CALL(_import_node, p_state, p_gltf_node, r_dict, p_node, err); + return Error(err); } Error GLTFDocumentExtension::export_node(Ref<GLTFState> p_state, Ref<GLTFNode> p_gltf_node, Dictionary &r_dict, Node *p_node) { @@ -108,8 +96,6 @@ Error GLTFDocumentExtension::export_node(Ref<GLTFState> p_state, Ref<GLTFNode> p ERR_FAIL_NULL_V(p_gltf_node, ERR_INVALID_PARAMETER); ERR_FAIL_NULL_V(p_node, ERR_INVALID_PARAMETER); int err = OK; - if (GDVIRTUAL_CALL(_export_node, p_state, p_gltf_node, r_dict, p_node, err)) { - return Error(err); - } - return OK; + GDVIRTUAL_CALL(_export_node, p_state, p_gltf_node, r_dict, p_node, err); + return Error(err); } |