Skip to content

Commit

Permalink
Merge pull request godotengine#76331 from clayjohn/PM-crash
Browse files Browse the repository at this point in the history
Validate renderer selection in project manager and change default renderer editor setting to expose an enum to users
  • Loading branch information
akien-mga committed Apr 22, 2023
2 parents 220d44e + 48ebae7 commit 24cb43a
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 3 additions & 3 deletions editor/editor_settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -756,12 +756,12 @@ void EditorSettings::_load_defaults(Ref<ConfigFile> p_extra_config) {

#if defined(WEB_ENABLED)
// Web platform only supports `gl_compatibility`.
EDITOR_SETTING(Variant::STRING, PROPERTY_HINT_NONE, "project_manager/default_renderer", "gl_compatibility", "forward_plus,mobile,gl_compatibility")
EDITOR_SETTING(Variant::STRING, PROPERTY_HINT_ENUM, "project_manager/default_renderer", "gl_compatibility", "forward_plus,mobile,gl_compatibility")
#elif defined(ANDROID_ENABLED)
// Use more suitable rendering method by default.
EDITOR_SETTING(Variant::STRING, PROPERTY_HINT_NONE, "project_manager/default_renderer", "mobile", "forward_plus,mobile,gl_compatibility")
EDITOR_SETTING(Variant::STRING, PROPERTY_HINT_ENUM, "project_manager/default_renderer", "mobile", "forward_plus,mobile,gl_compatibility")
#else
EDITOR_SETTING(Variant::STRING, PROPERTY_HINT_NONE, "project_manager/default_renderer", "forward_plus", "forward_plus,mobile,gl_compatibility")
EDITOR_SETTING(Variant::STRING, PROPERTY_HINT_ENUM, "project_manager/default_renderer", "forward_plus", "forward_plus,mobile,gl_compatibility")
#endif

if (p_extra_config.is_valid()) {
Expand Down
2 changes: 2 additions & 0 deletions editor/project_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,8 @@ void ProjectDialog::_nonempty_confirmation_ok_pressed() {
}

void ProjectDialog::_renderer_selected() {
ERR_FAIL_COND(!renderer_button_group->get_pressed_button());

String renderer_type = renderer_button_group->get_pressed_button()->get_meta(SNAME("rendering_method"));

if (renderer_type == "forward_plus") {
Expand Down

0 comments on commit 24cb43a

Please sign in to comment.