summaryrefslogtreecommitdiffstats
path: root/scene/resources/material.cpp
diff options
context:
space:
mode:
authorkobewi <kobewi4e@gmail.com>2022-11-30 16:40:50 +0100
committerkobewi <kobewi4e@gmail.com>2022-11-30 18:36:57 +0100
commit9a3960daa59a728f2620f64ad182aa332059489c (patch)
tree3234e83a17d4a7f66e9b8b96265aa876652119d5 /scene/resources/material.cpp
parentcd491c6e47bb41ccf596189676c0c5d4a72226cc (diff)
downloadredot-engine-9a3960daa59a728f2620f64ad182aa332059489c.tar.gz
Simplify GDVIRTUAL_REQUIRED_CALL calls
Diffstat (limited to 'scene/resources/material.cpp')
-rw-r--r--scene/resources/material.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/scene/resources/material.cpp b/scene/resources/material.cpp
index 10d193f950..e457b2d377 100644
--- a/scene/resources/material.cpp
+++ b/scene/resources/material.cpp
@@ -92,18 +92,13 @@ void Material::inspect_native_shader_code() {
RID Material::get_shader_rid() const {
RID ret;
- if (GDVIRTUAL_REQUIRED_CALL(_get_shader_rid, ret)) {
- return ret;
- }
- return RID();
+ GDVIRTUAL_REQUIRED_CALL(_get_shader_rid, ret);
+ return ret;
}
Shader::Mode Material::get_shader_mode() const {
- Shader::Mode ret;
- if (GDVIRTUAL_REQUIRED_CALL(_get_shader_mode, ret)) {
- return ret;
- }
-
- return Shader::MODE_MAX;
+ Shader::Mode ret = Shader::MODE_MAX;
+ GDVIRTUAL_REQUIRED_CALL(_get_shader_mode, ret);
+ return ret;
}
bool Material::_can_do_next_pass() const {