Ah, I see, lol.
Well, essentially the script rescursively goes through every *.h file in the source directory, and essentially generates one file per *.h that has at least 1 line which contains the macro "REGISTER_...". From there, it parses information about the rest of the class, and generates a .cpp in a subfolder off the root source directory, which contain static functions to initialize the class information, as well as one static member function inside the program's main class that calls the entire set of initialization functions.
For example, this, in "Source/CaeBackdrop.h"
class Backdrop : public Base {
REGISTER_CLASS(Backdrop, Base);
Sky* Parent;
float3 Position;
bool Visible;
float Scale;
Texture* Image;
float4 Color;
Backdrop(Sky* Parent);
virtual ~Backdrop();
virtual void Draw(const Camera* Eye) const;
virtual void Step(float Delta);
};
Must generate this, in "Source/Generated/CaeBackdropGenerated.cpp"
void Backdrop::InitializeClassAttributes()
{
if (Properties)
return;
ClassProperties* ParentProperties = Super::GetClassProperties();
Properties = &Base::RuntimeDatabase->Classes["Backdrop"];
if (ParentProperties)
Properties->Inherit(ParentProperties);
Properties->Variables["Parent"] = BaseProperty("Parent", TYPE_BASE, __builtin_offsetof(Backdrop, Parent), BaseProperty::FLAG_NONE);
Properties->Variables["Position"] = BaseProperty("Position", TYPE_FLOAT3, __builtin_offsetof(Backdrop, Position), BaseProperty::FLAG_NONE);
Properties->Variables["Visible"] = BaseProperty("Visible", TYPE_BOOL, __builtin_offsetof(Backdrop, Visible), BaseProperty::FLAG_NONE);
Properties->Variables["Scale"] = BaseProperty("Scale", TYPE_FLOAT, __builtin_offsetof(Backdrop, Scale), BaseProperty::FLAG_NONE);
Properties->Variables["Image"] = BaseProperty("Image", TYPE_ASSET, __builtin_offsetof(Backdrop, Image), BaseProperty::FLAG_NONE);
Properties->Variables["Color"] = BaseProperty("Color", TYPE_FLOAT4, __builtin_offsetof(Backdrop, Color), BaseProperty::FLAG_NONE);
InitializeClassMacro();
}
IMPLEMENT_CLASS(Backdrop);
My issue is that if I create a new class in a new header with a REGISTER_... macro, or delete an old header which has a macro in it, the generated folder will be updated to reflect this, but the actual C::B project will not be; this is where the problem really stems from. I can't quite think of another way to really add this generated code in any other way into the build list, without inducing somewhat more severe and unparallelizable recompile times (as would be the case in some sort of #include scheme), beyond actually using a custom makefile and putting in something to the effect of 'compile every cpp in this folder.'
I hope that makes things somewhat more clear; sorry.