Skip to content

Commit deac808

Browse files
committed
Update register_types.h and register_types.cpp in binding_to_external_libraries.rst
Based in godotengine/godot#84456 Change register_tts_types() to initialize_tts_module() Change unregister_tts_types() to uninitialize_tts_module() Add parameter ModuleInitializationLevel p_level to uninitialize_tts_module and initialize_tts_module
1 parent d8a2cf9 commit deac808

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

contributing/development/core_and_modules/binding_to_external_libraries.rst

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,8 @@ These files should contain the following:
8585
8686
/* register_types.h */
8787
88-
void register_tts_types();
89-
void unregister_tts_types();
88+
void initialize_tts_module(ModuleInitializationLevel p_level);
89+
void uninitialize_tts_module(ModuleInitializationLevel p_level);
9090
/* yes, the word in the middle must be the same as the module folder name */
9191
9292
.. code-block:: cpp
@@ -98,11 +98,14 @@ These files should contain the following:
9898
#include "core/object/class_db.h"
9999
#include "tts.h"
100100
101-
void register_tts_types() {
101+
void initialize_tts_module(ModuleInitializationLevel p_level) {
102+
if (p_level != MODULE_INITIALIZATION_LEVEL_SCENE) {
103+
return;
104+
}
102105
ClassDB::register_class<TTS>();
103106
}
104107
105-
void unregister_tts_types() {
108+
void uninitialize_tts_module(ModuleInitializationLevel p_level) {
106109
// Nothing to do here in this example.
107110
}
108111

0 commit comments

Comments
 (0)