mirror of
https://github.com/godotengine/godot.git
synced 2026-01-03 18:11:19 +03:00
Refactor module initialization
* Changed to use the same stages as extensions. * Makes the initialization more coherent, helping solve problems due to lack of stages. * Makes it easier to port between module and extension. * removed the DRIVER initialization level (no longer needed).
This commit is contained in:
@@ -266,7 +266,11 @@ static Ref<Image> basis_universal_unpacker(const Vector<uint8_t> &p_buffer) {
|
||||
return basis_universal_unpacker_ptr(r, size);
|
||||
}
|
||||
|
||||
void register_basis_universal_types() {
|
||||
void initialize_basis_universal_module(ModuleInitializationLevel p_level) {
|
||||
if (p_level != MODULE_INITIALIZATION_LEVEL_SCENE) {
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef TOOLS_ENABLED
|
||||
using namespace basisu;
|
||||
using namespace basist;
|
||||
@@ -277,7 +281,11 @@ void register_basis_universal_types() {
|
||||
Image::basis_universal_unpacker_ptr = basis_universal_unpacker_ptr;
|
||||
}
|
||||
|
||||
void unregister_basis_universal_types() {
|
||||
void uninitialize_basis_universal_module(ModuleInitializationLevel p_level) {
|
||||
if (p_level != MODULE_INITIALIZATION_LEVEL_SCENE) {
|
||||
return;
|
||||
}
|
||||
|
||||
#ifdef TOOLS_ENABLED
|
||||
Image::basis_universal_packer = nullptr;
|
||||
#endif
|
||||
|
||||
@@ -31,7 +31,9 @@
|
||||
#ifndef BASIS_UNIVERSAL_REGISTER_TYPES_H
|
||||
#define BASIS_UNIVERSAL_REGISTER_TYPES_H
|
||||
|
||||
void register_basis_universal_types();
|
||||
void unregister_basis_universal_types();
|
||||
#include "modules/register_module_types.h"
|
||||
|
||||
void initialize_basis_universal_module(ModuleInitializationLevel p_level);
|
||||
void uninitialize_basis_universal_module(ModuleInitializationLevel p_level);
|
||||
|
||||
#endif // BASIS_UNIVERSAL_REGISTER_TYPES_H
|
||||
|
||||
Reference in New Issue
Block a user