Skip to content

Commit

Permalink
Migrate all GDVIRTUAL_REQUIRED_CALL instances
Browse files Browse the repository at this point in the history
  • Loading branch information
TitanNano committed Jul 4, 2024
1 parent 591f8fe commit e07dbec
Show file tree
Hide file tree
Showing 29 changed files with 360 additions and 360 deletions.
12 changes: 6 additions & 6 deletions editor/editor_file_system.h
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ class EditorFileSystemImportFormatSupportQuery : public RefCounted {
GDCLASS(EditorFileSystemImportFormatSupportQuery, RefCounted);

protected:
GDVIRTUAL0RC(bool, _is_active)
GDVIRTUAL0RC(Vector<String>, _get_file_extensions)
GDVIRTUAL0RC(bool, _query)
GDVIRTUAL0RC_REQUIRED(bool, _is_active)
GDVIRTUAL0RC_REQUIRED(Vector<String>, _get_file_extensions)
GDVIRTUAL0RC_REQUIRED(bool, _query)
static void _bind_methods() {
GDVIRTUAL_BIND(_is_active);
GDVIRTUAL_BIND(_get_file_extensions);
Expand All @@ -119,17 +119,17 @@ class EditorFileSystemImportFormatSupportQuery : public RefCounted {
public:
virtual bool is_active() const {
bool ret = false;
GDVIRTUAL_REQUIRED_CALL(_is_active, ret);
GDVIRTUAL_CALL(_is_active, ret);
return ret;
}
virtual Vector<String> get_file_extensions() const {
Vector<String> ret;
GDVIRTUAL_REQUIRED_CALL(_get_file_extensions, ret);
GDVIRTUAL_CALL(_get_file_extensions, ret);
return ret;
}
virtual bool query() {
bool ret = false;
GDVIRTUAL_REQUIRED_CALL(_query, ret);
GDVIRTUAL_CALL(_query, ret);
return ret;
}
};
Expand Down
2 changes: 1 addition & 1 deletion editor/editor_script.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ EditorInterface *EditorScript::get_editor_interface() const {
}

void EditorScript::run() {
GDVIRTUAL_REQUIRED_CALL(_run);
GDVIRTUAL_CALL(_run);
}

void EditorScript::_bind_methods() {
Expand Down
2 changes: 1 addition & 1 deletion editor/editor_script.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ class EditorScript : public RefCounted {
protected:
static void _bind_methods();

GDVIRTUAL0(_run)
GDVIRTUAL0_REQUIRED(_run)

public:
void add_root_node(Node *p_node);
Expand Down
46 changes: 23 additions & 23 deletions editor/editor_vcs_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,17 +41,17 @@ void EditorVCSInterface::popup_error(const String &p_msg) {

bool EditorVCSInterface::initialize(const String &p_project_path) {
bool result = false;
GDVIRTUAL_REQUIRED_CALL(_initialize, p_project_path, result);
GDVIRTUAL_CALL(_initialize, p_project_path, result);
return result;
}

void EditorVCSInterface::set_credentials(const String &p_username, const String &p_password, const String &p_ssh_public_key, const String &p_ssh_private_key, const String &p_ssh_passphrase) {
GDVIRTUAL_REQUIRED_CALL(_set_credentials, p_username, p_password, p_ssh_public_key, p_ssh_private_key, p_ssh_passphrase);
GDVIRTUAL_CALL(_set_credentials, p_username, p_password, p_ssh_public_key, p_ssh_private_key, p_ssh_passphrase);
}

List<String> EditorVCSInterface::get_remotes() {
TypedArray<String> result;
if (!GDVIRTUAL_REQUIRED_CALL(_get_remotes, result)) {
if (!GDVIRTUAL_CALL(_get_remotes, result)) {
return {};
}

Expand All @@ -64,7 +64,7 @@ List<String> EditorVCSInterface::get_remotes() {

List<EditorVCSInterface::StatusFile> EditorVCSInterface::get_modified_files_data() {
TypedArray<Dictionary> result;
if (!GDVIRTUAL_REQUIRED_CALL(_get_modified_files_data, result)) {
if (!GDVIRTUAL_CALL(_get_modified_files_data, result)) {
return {};
}

Expand All @@ -76,24 +76,24 @@ List<EditorVCSInterface::StatusFile> EditorVCSInterface::get_modified_files_data
}

void EditorVCSInterface::stage_file(const String &p_file_path) {
GDVIRTUAL_REQUIRED_CALL(_stage_file, p_file_path);
GDVIRTUAL_CALL(_stage_file, p_file_path);
}

void EditorVCSInterface::unstage_file(const String &p_file_path) {
GDVIRTUAL_REQUIRED_CALL(_unstage_file, p_file_path);
GDVIRTUAL_CALL(_unstage_file, p_file_path);
}

void EditorVCSInterface::discard_file(const String &p_file_path) {
GDVIRTUAL_REQUIRED_CALL(_discard_file, p_file_path);
GDVIRTUAL_CALL(_discard_file, p_file_path);
}

void EditorVCSInterface::commit(const String &p_msg) {
GDVIRTUAL_REQUIRED_CALL(_commit, p_msg);
GDVIRTUAL_CALL(_commit, p_msg);
}

List<EditorVCSInterface::DiffFile> EditorVCSInterface::get_diff(const String &p_identifier, TreeArea p_area) {
TypedArray<Dictionary> result;
if (!GDVIRTUAL_REQUIRED_CALL(_get_diff, p_identifier, int(p_area), result)) {
if (!GDVIRTUAL_CALL(_get_diff, p_identifier, int(p_area), result)) {
return {};
}

Expand All @@ -106,7 +106,7 @@ List<EditorVCSInterface::DiffFile> EditorVCSInterface::get_diff(const String &p_

List<EditorVCSInterface::Commit> EditorVCSInterface::get_previous_commits(int p_max_commits) {
TypedArray<Dictionary> result;
if (!GDVIRTUAL_REQUIRED_CALL(_get_previous_commits, p_max_commits, result)) {
if (!GDVIRTUAL_CALL(_get_previous_commits, p_max_commits, result)) {
return {};
}

Expand All @@ -119,7 +119,7 @@ List<EditorVCSInterface::Commit> EditorVCSInterface::get_previous_commits(int p_

List<String> EditorVCSInterface::get_branch_list() {
TypedArray<String> result;
if (!GDVIRTUAL_REQUIRED_CALL(_get_branch_list, result)) {
if (!GDVIRTUAL_CALL(_get_branch_list, result)) {
return {};
}

Expand All @@ -131,48 +131,48 @@ List<String> EditorVCSInterface::get_branch_list() {
}

void EditorVCSInterface::create_branch(const String &p_branch_name) {
GDVIRTUAL_REQUIRED_CALL(_create_branch, p_branch_name);
GDVIRTUAL_CALL(_create_branch, p_branch_name);
}

void EditorVCSInterface::create_remote(const String &p_remote_name, const String &p_remote_url) {
GDVIRTUAL_REQUIRED_CALL(_create_remote, p_remote_name, p_remote_url);
GDVIRTUAL_CALL(_create_remote, p_remote_name, p_remote_url);
}

void EditorVCSInterface::remove_branch(const String &p_branch_name) {
GDVIRTUAL_REQUIRED_CALL(_remove_branch, p_branch_name);
GDVIRTUAL_CALL(_remove_branch, p_branch_name);
}

void EditorVCSInterface::remove_remote(const String &p_remote_name) {
GDVIRTUAL_REQUIRED_CALL(_remove_remote, p_remote_name);
GDVIRTUAL_CALL(_remove_remote, p_remote_name);
}

String EditorVCSInterface::get_current_branch_name() {
String result;
GDVIRTUAL_REQUIRED_CALL(_get_current_branch_name, result);
GDVIRTUAL_CALL(_get_current_branch_name, result);
return result;
}

bool EditorVCSInterface::checkout_branch(const String &p_branch_name) {
bool result = false;
GDVIRTUAL_REQUIRED_CALL(_checkout_branch, p_branch_name, result);
GDVIRTUAL_CALL(_checkout_branch, p_branch_name, result);
return result;
}

void EditorVCSInterface::pull(const String &p_remote) {
GDVIRTUAL_REQUIRED_CALL(_pull, p_remote);
GDVIRTUAL_CALL(_pull, p_remote);
}

void EditorVCSInterface::push(const String &p_remote, bool p_force) {
GDVIRTUAL_REQUIRED_CALL(_push, p_remote, p_force);
GDVIRTUAL_CALL(_push, p_remote, p_force);
}

void EditorVCSInterface::fetch(const String &p_remote) {
GDVIRTUAL_REQUIRED_CALL(_fetch, p_remote);
GDVIRTUAL_CALL(_fetch, p_remote);
}

List<EditorVCSInterface::DiffHunk> EditorVCSInterface::get_line_diff(const String &p_file_path, const String &p_text) {
TypedArray<Dictionary> result;
if (!GDVIRTUAL_REQUIRED_CALL(_get_line_diff, p_file_path, p_text, result)) {
if (!GDVIRTUAL_CALL(_get_line_diff, p_file_path, p_text, result)) {
return {};
}

Expand All @@ -185,13 +185,13 @@ List<EditorVCSInterface::DiffHunk> EditorVCSInterface::get_line_diff(const Strin

bool EditorVCSInterface::shut_down() {
bool result = false;
GDVIRTUAL_REQUIRED_CALL(_shut_down, result);
GDVIRTUAL_CALL(_shut_down, result);
return result;
}

String EditorVCSInterface::get_vcs_name() {
String result;
GDVIRTUAL_REQUIRED_CALL(_get_vcs_name, result);
GDVIRTUAL_CALL(_get_vcs_name, result);
return result;
}

Expand Down
46 changes: 23 additions & 23 deletions editor/editor_vcs_interface.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,29 +106,29 @@ class EditorVCSInterface : public Object {
StatusFile _convert_status_file(const Dictionary &p_status_file);

// Proxy endpoints for extensions to implement
GDVIRTUAL1R(bool, _initialize, String);
GDVIRTUAL5(_set_credentials, String, String, String, String, String);
GDVIRTUAL0R(TypedArray<Dictionary>, _get_modified_files_data);
GDVIRTUAL1(_stage_file, String);
GDVIRTUAL1(_unstage_file, String);
GDVIRTUAL1(_discard_file, String);
GDVIRTUAL1(_commit, String);
GDVIRTUAL2R(TypedArray<Dictionary>, _get_diff, String, int);
GDVIRTUAL0R(bool, _shut_down);
GDVIRTUAL0R(String, _get_vcs_name);
GDVIRTUAL1R(TypedArray<Dictionary>, _get_previous_commits, int);
GDVIRTUAL0R(TypedArray<String>, _get_branch_list);
GDVIRTUAL0R(TypedArray<String>, _get_remotes);
GDVIRTUAL1(_create_branch, String);
GDVIRTUAL1(_remove_branch, String);
GDVIRTUAL2(_create_remote, String, String);
GDVIRTUAL1(_remove_remote, String);
GDVIRTUAL0R(String, _get_current_branch_name);
GDVIRTUAL1R(bool, _checkout_branch, String);
GDVIRTUAL1(_pull, String);
GDVIRTUAL2(_push, String, bool);
GDVIRTUAL1(_fetch, String);
GDVIRTUAL2R(TypedArray<Dictionary>, _get_line_diff, String, String);
GDVIRTUAL1R_REQUIRED(bool, _initialize, String);
GDVIRTUAL5_REQUIRED(_set_credentials, String, String, String, String, String);
GDVIRTUAL0R_REQUIRED(TypedArray<Dictionary>, _get_modified_files_data);
GDVIRTUAL1_REQUIRED(_stage_file, String);
GDVIRTUAL1_REQUIRED(_unstage_file, String);
GDVIRTUAL1_REQUIRED(_discard_file, String);
GDVIRTUAL1_REQUIRED(_commit, String);
GDVIRTUAL2R_REQUIRED(TypedArray<Dictionary>, _get_diff, String, int);
GDVIRTUAL0R_REQUIRED(bool, _shut_down);
GDVIRTUAL0R_REQUIRED(String, _get_vcs_name);
GDVIRTUAL1R_REQUIRED(TypedArray<Dictionary>, _get_previous_commits, int);
GDVIRTUAL0R_REQUIRED(TypedArray<String>, _get_branch_list);
GDVIRTUAL0R_REQUIRED(TypedArray<String>, _get_remotes);
GDVIRTUAL1_REQUIRED(_create_branch, String);
GDVIRTUAL1_REQUIRED(_remove_branch, String);
GDVIRTUAL2_REQUIRED(_create_remote, String, String);
GDVIRTUAL1_REQUIRED(_remove_remote, String);
GDVIRTUAL0R_REQUIRED(String, _get_current_branch_name);
GDVIRTUAL1R_REQUIRED(bool, _checkout_branch, String);
GDVIRTUAL1_REQUIRED(_pull, String);
GDVIRTUAL2_REQUIRED(_push, String, bool);
GDVIRTUAL1_REQUIRED(_fetch, String);
GDVIRTUAL2R_REQUIRED(TypedArray<Dictionary>, _get_line_diff, String, String);

public:
static EditorVCSInterface *get_singleton();
Expand Down
8 changes: 4 additions & 4 deletions editor/export/editor_export_plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ bool EditorExportPlugin::_begin_customize_resources(const Ref<EditorExportPlatfo

Ref<Resource> EditorExportPlugin::_customize_resource(const Ref<Resource> &p_resource, const String &p_path) {
Ref<Resource> ret;
GDVIRTUAL_REQUIRED_CALL(_customize_resource, p_resource, p_path, ret);
GDVIRTUAL_CALL(_customize_resource, p_resource, p_path, ret);
return ret;
}

Expand All @@ -191,13 +191,13 @@ bool EditorExportPlugin::_begin_customize_scenes(const Ref<EditorExportPlatform>

Node *EditorExportPlugin::_customize_scene(Node *p_root, const String &p_path) {
Node *ret = nullptr;
GDVIRTUAL_REQUIRED_CALL(_customize_scene, p_root, p_path, ret);
GDVIRTUAL_CALL(_customize_scene, p_root, p_path, ret);
return ret;
}

uint64_t EditorExportPlugin::_get_customization_configuration_hash() const {
uint64_t ret = 0;
GDVIRTUAL_REQUIRED_CALL(_get_customization_configuration_hash, ret);
GDVIRTUAL_CALL(_get_customization_configuration_hash, ret);
return ret;
}

Expand All @@ -211,7 +211,7 @@ void EditorExportPlugin::_end_customize_resources() {

String EditorExportPlugin::get_name() const {
String ret;
GDVIRTUAL_REQUIRED_CALL(_get_name, ret);
GDVIRTUAL_CALL(_get_name, ret);
return ret;
}

Expand Down
8 changes: 4 additions & 4 deletions editor/export/editor_export_plugin.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,11 +118,11 @@ class EditorExportPlugin : public RefCounted {
GDVIRTUAL0(_export_end)

GDVIRTUAL2RC(bool, _begin_customize_resources, const Ref<EditorExportPlatform> &, const Vector<String> &)
GDVIRTUAL2R(Ref<Resource>, _customize_resource, const Ref<Resource> &, String)
GDVIRTUAL2R_REQUIRED(Ref<Resource>, _customize_resource, const Ref<Resource> &, String)

GDVIRTUAL2RC(bool, _begin_customize_scenes, const Ref<EditorExportPlatform> &, const Vector<String> &)
GDVIRTUAL2R(Node *, _customize_scene, Node *, String)
GDVIRTUAL0RC(uint64_t, _get_customization_configuration_hash)
GDVIRTUAL2R_REQUIRED(Node *, _customize_scene, Node *, String)
GDVIRTUAL0RC_REQUIRED(uint64_t, _get_customization_configuration_hash)

GDVIRTUAL0(_end_customize_scenes)
GDVIRTUAL0(_end_customize_resources)
Expand All @@ -133,7 +133,7 @@ class EditorExportPlugin : public RefCounted {
GDVIRTUAL1RC(bool, _should_update_export_options, const Ref<EditorExportPlatform> &);
GDVIRTUAL2RC(String, _get_export_option_warning, const Ref<EditorExportPlatform> &, String);

GDVIRTUAL0RC(String, _get_name)
GDVIRTUAL0RC_REQUIRED(String, _get_name)

GDVIRTUAL1RC(bool, _supports_platform, const Ref<EditorExportPlatform> &);

Expand Down
4 changes: 2 additions & 2 deletions scene/resources/material.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,12 @@ void Material::inspect_native_shader_code() {

RID Material::get_shader_rid() const {
RID ret;
GDVIRTUAL_REQUIRED_CALL(_get_shader_rid, ret);
GDVIRTUAL_CALL(_get_shader_rid, ret);
return ret;
}
Shader::Mode Material::get_shader_mode() const {
Shader::Mode ret = Shader::MODE_MAX;
GDVIRTUAL_REQUIRED_CALL(_get_shader_mode, ret);
GDVIRTUAL_CALL(_get_shader_mode, ret);
return ret;
}

Expand Down
4 changes: 2 additions & 2 deletions scene/resources/material.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ class Material : public Resource {
void _mark_initialized(const Callable &p_add_to_dirty_list, const Callable &p_update_shader);
bool _is_initialized() { return init_state == INIT_STATE_READY; }

GDVIRTUAL0RC(RID, _get_shader_rid)
GDVIRTUAL0RC(Shader::Mode, _get_shader_mode)
GDVIRTUAL0RC_REQUIRED(RID, _get_shader_rid)
GDVIRTUAL0RC_REQUIRED(Shader::Mode, _get_shader_mode)
GDVIRTUAL0RC(bool, _can_do_next_pass)
GDVIRTUAL0RC(bool, _can_use_render_priority)
public:
Expand Down
Loading

0 comments on commit e07dbec

Please sign in to comment.