summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--editor/editor_fonts.cpp2
-rw-r--r--main/main.cpp26
-rw-r--r--scene/main/window.cpp2
-rw-r--r--servers/display_server.cpp7
-rw-r--r--servers/display_server.h10
5 files changed, 30 insertions, 17 deletions
diff --git a/editor/editor_fonts.cpp b/editor/editor_fonts.cpp
index 171b7a2176..8aadf02ea6 100644
--- a/editor/editor_fonts.cpp
+++ b/editor/editor_fonts.cpp
@@ -231,7 +231,7 @@ void editor_register_fonts(Ref<Theme> p_theme) {
// Default font
MAKE_DEFAULT_FONT(df, default_font_size);
- p_theme->set_default_theme_font(df);
+ p_theme->set_font("font", "Node", df); // Default theme font
p_theme->set_font("main", "EditorFonts", df);
// Bold font
diff --git a/main/main.cpp b/main/main.cpp
index bc97f9f8c5..9e7e0e8842 100644
--- a/main/main.cpp
+++ b/main/main.cpp
@@ -271,16 +271,22 @@ void Main::print_help(const char *p_binary) {
OS::get_singleton()->print(" --render-thread <mode> Render thread mode ('unsafe', 'safe', 'separate').\n");
OS::get_singleton()->print(" --remote-fs <address> Remote filesystem (<host/IP>[:<port>] address).\n");
OS::get_singleton()->print(" --remote-fs-password <password> Password for remote filesystem.\n");
- OS::get_singleton()->print(" --audio-driver <driver> Audio driver (");
+
+ OS::get_singleton()->print(" --audio-driver <driver> Audio driver [");
for (int i = 0; i < AudioDriverManager::get_driver_count(); i++) {
- if (i != 0)
+ if (i > 0) {
OS::get_singleton()->print(", ");
+ }
OS::get_singleton()->print("'%s'", AudioDriverManager::get_driver(i)->get_name());
}
- OS::get_singleton()->print(").\n");
- OS::get_singleton()->print(" --display-driver <driver> Display driver (and rendering driver):\n");
+ OS::get_singleton()->print("].\n");
+
+ OS::get_singleton()->print(" --display-driver <driver> Display driver (and rendering driver) [");
for (int i = 0; i < DisplayServer::get_create_function_count(); i++) {
- OS::get_singleton()->print("\t\t'%s' (", DisplayServer::get_create_function_name(i));
+ if (i > 0) {
+ OS::get_singleton()->print(", ");
+ }
+ OS::get_singleton()->print("'%s' (", DisplayServer::get_create_function_name(i));
Vector<String> rd = DisplayServer::get_create_function_rendering_drivers(i);
for (int j = 0; j < rd.size(); j++) {
if (j > 0) {
@@ -288,9 +294,11 @@ void Main::print_help(const char *p_binary) {
}
OS::get_singleton()->print("'%s'", rd[j].utf8().get_data());
}
- OS::get_singleton()->print(")\n");
+ OS::get_singleton()->print(")");
}
- OS::get_singleton()->print(" --rendering-driver <driver> Rendering driver (depends on display driver).\n");
+ OS::get_singleton()->print("].\n");
+ OS::get_singleton()->print(" --rendering-driver <driver> Rendering driver (depends on display driver).\n");
+ OS::get_singleton()->print("\n");
#ifndef SERVER_ENABLED
OS::get_singleton()->print("Display options:\n");
@@ -340,7 +348,7 @@ void Main::print_help(const char *p_binary) {
#ifdef DEBUG_METHODS_ENABLED
OS::get_singleton()->print(" --gdnative-generate-json-api Generate JSON dump of the Godot API for GDNative bindings.\n");
#endif
- OS::get_singleton()->print(" --test <test> Run a unit test (");
+ OS::get_singleton()->print(" --test <test> Run a unit test [");
const char **test_names = tests_get_names();
const char *comma = "";
while (*test_names) {
@@ -348,7 +356,7 @@ void Main::print_help(const char *p_binary) {
test_names++;
comma = ", ";
}
- OS::get_singleton()->print(").\n");
+ OS::get_singleton()->print("].\n");
#endif
}
diff --git a/scene/main/window.cpp b/scene/main/window.cpp
index a2a49aea75..b22b99c50c 100644
--- a/scene/main/window.cpp
+++ b/scene/main/window.cpp
@@ -1331,7 +1331,7 @@ void Window::_bind_methods() {
ClassDB::bind_method(D_METHOD("popup_on_parent", "parent_rect"), &Window::popup_on_parent);
ClassDB::bind_method(D_METHOD("popup_centered_ratio", "ratio"), &Window::popup_centered_ratio, DEFVAL(0.8));
ClassDB::bind_method(D_METHOD("popup_centered", "minsize"), &Window::popup_centered, DEFVAL(Size2i()));
- ClassDB::bind_method(D_METHOD("popup_centered_clamped", "minsize", "fallback_ratio"), &Window::popup_centered, DEFVAL(Size2i()), DEFVAL(0.75));
+ ClassDB::bind_method(D_METHOD("popup_centered_clamped", "minsize", "fallback_ratio"), &Window::popup_centered_clamped, DEFVAL(Size2i()), DEFVAL(0.75));
ADD_PROPERTY(PropertyInfo(Variant::STRING, "title"), "set_title", "get_title");
ADD_PROPERTY(PropertyInfo(Variant::VECTOR2I, "position"), "set_position", "get_position");
diff --git a/servers/display_server.cpp b/servers/display_server.cpp
index 1685328cbe..9798c57707 100644
--- a/servers/display_server.cpp
+++ b/servers/display_server.cpp
@@ -540,15 +540,18 @@ void DisplayServer::_bind_methods() {
BIND_ENUM_CONSTANT(WINDOW_EVENT_DPI_CHANGE);
}
-void DisplayServer::register_create_function(const char *p_name, CreateFunction p_function, GetVideoDriversFunction p_get_drivers) {
+void DisplayServer::register_create_function(const char *p_name, CreateFunction p_function, GetRenderingDriversFunction p_get_drivers) {
ERR_FAIL_COND(server_create_count == MAX_SERVERS);
- server_create_functions[server_create_count].create_function = p_function;
server_create_functions[server_create_count].name = p_name;
+ server_create_functions[server_create_count].create_function = p_function;
+ server_create_functions[server_create_count].get_rendering_drivers_function = p_get_drivers;
server_create_count++;
}
+
int DisplayServer::get_create_function_count() {
return server_create_count;
}
+
const char *DisplayServer::get_create_function_name(int p_index) {
ERR_FAIL_INDEX_V(p_index, server_create_count, nullptr);
return server_create_functions[p_index].name;
diff --git a/servers/display_server.h b/servers/display_server.h
index 8ed0b11d03..4803eeb084 100644
--- a/servers/display_server.h
+++ b/servers/display_server.h
@@ -57,8 +57,9 @@ public:
WINDOW_MODE_FULLSCREEN
};
- typedef DisplayServer *(*CreateFunction)(const String &, WindowMode, uint32_t, const Size2i &, Error &r_error); //video driver, window mode, resolution
- typedef Vector<String> (*GetVideoDriversFunction)(); //video driver, window mode, resolution
+ typedef DisplayServer *(*CreateFunction)(const String &, WindowMode, uint32_t, const Size2i &, Error &r_error);
+ typedef Vector<String> (*GetRenderingDriversFunction)();
+
private:
static void _input_set_mouse_mode(InputFilter::MouseMode p_mode);
static InputFilter::MouseMode _input_get_mouse_mode();
@@ -68,14 +69,15 @@ private:
protected:
static void _bind_methods();
+
enum {
MAX_SERVERS = 64
};
struct DisplayServerCreate {
const char *name;
- GetVideoDriversFunction get_rendering_drivers_function;
CreateFunction create_function;
+ GetRenderingDriversFunction get_rendering_drivers_function;
};
static DisplayServerCreate server_create_functions[MAX_SERVERS];
@@ -361,7 +363,7 @@ public:
virtual void set_context(Context p_context);
- static void register_create_function(const char *p_name, CreateFunction p_function, GetVideoDriversFunction p_get_drivers);
+ static void register_create_function(const char *p_name, CreateFunction p_function, GetRenderingDriversFunction p_get_drivers);
static int get_create_function_count();
static const char *get_create_function_name(int p_index);
static Vector<String> get_create_function_rendering_drivers(int p_index);