Browse Source

Use `GDREGISTER` defines in example

(cherry picked from commit a537b4af4ded29ee715a950f47887cb5367b9825)
Thaddeus Crews 1 year ago
parent
commit
fc5366c026
2 changed files with 9 additions and 9 deletions
  1. 1 1
      README.md
  2. 8 8
      test/src/register_types.cpp

+ 1 - 1
README.md

@@ -132,7 +132,7 @@ void initialize_example_module(ModuleInitializationLevel p_level) {
 	if (p_level != MODULE_INITIALIZATION_LEVEL_SCENE) {
 		return;
 	}
-	ClassDB::register_class<Example>();
+	GDREGISTER_CLASS(Example);
 }
 ```
 

+ 8 - 8
test/src/register_types.cpp

@@ -21,14 +21,14 @@ void initialize_example_module(ModuleInitializationLevel p_level) {
 		return;
 	}
 
-	ClassDB::register_class<ExampleRef>();
-	ClassDB::register_class<ExampleMin>();
-	ClassDB::register_class<Example>();
-	ClassDB::register_class<ExampleVirtual>(true);
-	ClassDB::register_abstract_class<ExampleAbstractBase>();
-	ClassDB::register_class<ExampleConcrete>();
-	ClassDB::register_class<ExampleBase>();
-	ClassDB::register_class<ExampleChild>();
+	GDREGISTER_CLASS(ExampleRef);
+	GDREGISTER_CLASS(ExampleMin);
+	GDREGISTER_CLASS(Example);
+	GDREGISTER_VIRTUAL_CLASS(ExampleVirtual);
+	GDREGISTER_ABSTRACT_CLASS(ExampleAbstractBase);
+	GDREGISTER_CLASS(ExampleConcrete);
+	GDREGISTER_CLASS(ExampleBase);
+	GDREGISTER_CLASS(ExampleChild);
 }
 
 void uninitialize_example_module(ModuleInitializationLevel p_level) {