Discern between virtual and abstract class bindings

* Previous "virtual" classes (which can't be instantiated) are not corretly named "abstract".
* Added a new "virtual" category for classes, they can't be instantiated from the editor, but can be inherited from script and extensions.
* Converted a large amount of classes from "abstract" to "virtual" where it makes sense.

Most classes that make sense have been converted. Missing:

* Physics servers
* VideoStream
* Script* classes.

which will go in a separate PR due to the complexity involved.
This commit is contained in:
reduz 2022-03-10 08:17:38 +01:00
parent 741bbb9d7c
commit 6f51eca1e3
90 changed files with 1075 additions and 272 deletions

View file

@ -88,6 +88,37 @@ 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();
}
Shader::Mode Material::get_shader_mode() const {
Shader::Mode ret;
if (GDVIRTUAL_REQUIRED_CALL(_get_shader_mode, ret)) {
return ret;
}
return Shader::MODE_MAX;
}
bool Material::_can_do_next_pass() const {
bool ret;
if (GDVIRTUAL_CALL(_can_do_next_pass, ret)) {
return ret;
}
return false;
}
bool Material::_can_use_render_priority() const {
bool ret;
if (GDVIRTUAL_CALL(_can_use_render_priority, ret)) {
return ret;
}
return false;
}
void Material::_bind_methods() {
ClassDB::bind_method(D_METHOD("set_next_pass", "next_pass"), &Material::set_next_pass);
ClassDB::bind_method(D_METHOD("get_next_pass"), &Material::get_next_pass);
@ -103,6 +134,11 @@ void Material::_bind_methods() {
BIND_CONSTANT(RENDER_PRIORITY_MAX);
BIND_CONSTANT(RENDER_PRIORITY_MIN);
GDVIRTUAL_BIND(_get_shader_rid)
GDVIRTUAL_BIND(_get_shader_mode)
GDVIRTUAL_BIND(_can_do_next_pass)
GDVIRTUAL_BIND(_can_use_render_priority)
}
Material::Material() {