summaryrefslogtreecommitdiffstats
path: root/modules/mono/editor/bindings_generator.h
diff options
context:
space:
mode:
authorIgnacio Etcheverry <ignalfonsore@gmail.com>2019-04-25 15:45:12 +0200
committerIgnacio Etcheverry <ignalfonsore@gmail.com>2019-04-25 20:34:28 +0200
commitc20a3823a2eafdb40a9db3519e503269689bac14 (patch)
tree72bd6a9fabb451a5af0939c6ede9e9496c9b3394 /modules/mono/editor/bindings_generator.h
parentbf1fe11143241446dc0d8b841f46ac5b9ff4e574 (diff)
downloadredot-engine-c20a3823a2eafdb40a9db3519e503269689bac14.tar.gz
C# bindings generator cleanup
- Normal log messages are no longer warnings. - BindingsGenerator is no longer a singleton. - Added a log function.
Diffstat (limited to 'modules/mono/editor/bindings_generator.h')
-rw-r--r--modules/mono/editor/bindings_generator.h33
1 files changed, 13 insertions, 20 deletions
diff --git a/modules/mono/editor/bindings_generator.h b/modules/mono/editor/bindings_generator.h
index a073c09910..7599c6edee 100644
--- a/modules/mono/editor/bindings_generator.h
+++ b/modules/mono/editor/bindings_generator.h
@@ -164,7 +164,6 @@ class BindingsGenerator {
}
MethodInterface() {
- return_type.cname = BindingsGenerator::get_singleton()->name_cache.type_void;
is_vararg = false;
is_virtual = false;
requires_object_call = false;
@@ -469,7 +468,7 @@ class BindingsGenerator {
}
};
- static bool verbose_output;
+ bool log_print_enabled;
OrderedHashMap<StringName, TypeInterface> obj_types;
@@ -515,6 +514,7 @@ class BindingsGenerator {
enum_Error = StaticCString::create("Error");
}
+ private:
NameCache(const NameCache &);
NameCache &operator=(const NameCache &);
};
@@ -578,33 +578,26 @@ class BindingsGenerator {
Error _save_file(const String &p_path, const StringBuilder &p_content);
- BindingsGenerator() {}
-
- BindingsGenerator(const BindingsGenerator &);
- BindingsGenerator &operator=(const BindingsGenerator &);
+ void _log(const char *p_format, ...) _PRINTF_FORMAT_ATTRIBUTE_2_3;
- friend class CSharpLanguage;
- static BindingsGenerator *singleton;
+ void _initialize();
public:
- Error generate_cs_core_project(const String &p_solution_dir, DotNetSolution &r_solution, bool p_verbose_output = true);
- Error generate_cs_editor_project(const String &p_solution_dir, DotNetSolution &r_solution, bool p_verbose_output = true);
- Error generate_cs_api(const String &p_output_dir, bool p_verbose_output = true);
+ Error generate_cs_core_project(const String &p_solution_dir, DotNetSolution &r_solution);
+ Error generate_cs_editor_project(const String &p_solution_dir, DotNetSolution &r_solution);
+ Error generate_cs_api(const String &p_output_dir);
Error generate_glue(const String &p_output_dir);
+ void set_log_print_enabled(bool p_enabled) { log_print_enabled = p_enabled; }
+
static uint32_t get_version();
- void initialize();
+ static void handle_cmdline_args(const List<String> &p_cmdline_args);
- _FORCE_INLINE_ static BindingsGenerator *get_singleton() {
- if (!singleton) {
- singleton = memnew(BindingsGenerator);
- singleton->initialize();
- }
- return singleton;
+ BindingsGenerator() :
+ log_print_enabled(true) {
+ _initialize();
}
-
- static void handle_cmdline_args(const List<String> &p_cmdline_args);
};
#endif