mirror of
https://github.com/Relintai/texture_packer.git
synced 2024-11-12 10:15:16 +01:00
Updated register_types.h and cpp to the current godot 4 style.
This commit is contained in:
parent
ae4d222fba
commit
eb5cd105fb
@ -22,6 +22,8 @@ SOFTWARE.
|
|||||||
|
|
||||||
#include "register_types.h"
|
#include "register_types.h"
|
||||||
|
|
||||||
|
#include "core/object/class_db.h"
|
||||||
|
|
||||||
#include "texture_merger.h"
|
#include "texture_merger.h"
|
||||||
#include "texture_packer.h"
|
#include "texture_packer.h"
|
||||||
|
|
||||||
@ -35,18 +37,22 @@ SOFTWARE.
|
|||||||
#include "texture_resource/editor_plugin_packer_image_resource.h"
|
#include "texture_resource/editor_plugin_packer_image_resource.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void register_texture_packer_types() {
|
void register_texture_packer_types(ModuleInitializationLevel p_level) {
|
||||||
ClassDB::register_class<TexturePacker>();
|
if (p_level == MODULE_INITIALIZATION_LEVEL_SCENE) {
|
||||||
ClassDB::register_class<TextureMerger>();
|
GDREGISTER_CLASS(TexturePacker);
|
||||||
|
GDREGISTER_CLASS(TextureMerger);
|
||||||
|
|
||||||
ClassDB::register_class<PackerImageResource>();
|
GDREGISTER_CLASS(PackerImageResource);
|
||||||
|
|
||||||
ClassDB::register_class<TextureLayerMerger>();
|
GDREGISTER_CLASS(TextureLayerMerger);
|
||||||
|
}
|
||||||
|
|
||||||
#ifdef TOOLS_ENABLED
|
#ifdef TOOLS_ENABLED
|
||||||
EditorPlugins::add_by_type<EditorPluginPackerImageResource>();
|
if (p_level == MODULE_INITIALIZATION_LEVEL_EDITOR) {
|
||||||
|
EditorPlugins::add_by_type<EditorPluginPackerImageResource>();
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
void unregister_texture_packer_types() {
|
void unregister_texture_packer_types(ModuleInitializationLevel p_level) {
|
||||||
}
|
}
|
||||||
|
@ -20,5 +20,12 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|||||||
SOFTWARE.
|
SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void register_texture_packer_types();
|
#ifndef TEXTURE_PACKER_REGISTER_TYPES_H
|
||||||
void unregister_texture_packer_types();
|
#define TEXTURE_PACKER_REGISTER_TYPES_H
|
||||||
|
|
||||||
|
#include "modules/register_module_types.h"
|
||||||
|
|
||||||
|
void initialize_texture_packer_module(ModuleInitializationLevel p_level);
|
||||||
|
void uninitialize_texture_packer_module(ModuleInitializationLevel p_level);
|
||||||
|
|
||||||
|
#endif
|
Loading…
Reference in New Issue
Block a user