KarmaEngine
Game Engine for practical learning and research purposes
Loading...
Searching...
No Matches
GFrameworkMacros.h File Reference

This file contains some commonly used game code macros. More...

Go to the source code of this file.

Macros

#define DEFINE_DEFAULT_CONSTRUCTOR_CALL(TClass)
 Default constructor for Karma's gamecode class declaration.
#define DEFINE_DEFAULT_OBJECT_INITIALIZER_CONSTRUCTOR_CALL(TClass)
#define DECLARE_KARMA_CLASS(TClass, TSuperClass)
 Karma's gamecode object class declaration.

Typedefs

typedef void(* ClassConstructorType) (const Karma::FObjectInitializer &)

Enumerations

enum  EInternal { EC_InternalUseOnlyConstructor }

Detailed Description

This file contains some commonly used game code macros.

Author
Ravi Mohan (the_cowboy)
Version
1.0
Date
May 10, 2023

Macro Definition Documentation

◆ DECLARE_KARMA_CLASS

#define DECLARE_KARMA_CLASS ( TClass,
TSuperClass )

Karma's gamecode object class declaration.

Generates class hierarchy, defines base class and calls default constructor with placement new during UObjectAllocation (*InClass->m_ClassConstructor)(FObjectInitializer)

Also defines the routine to destroy (call class destructor) accessible from UObjectBase. See KarmaSmriti::ShutDown() for the application.

See also
StaticConstructObject_Internal() in UObjectGlobals.cpp
Remarks
In UE, this is done in ObjectMacros.h, #define DECLARE_CLASS

◆ DEFINE_DEFAULT_CONSTRUCTOR_CALL

#define DEFINE_DEFAULT_CONSTRUCTOR_CALL ( TClass)
Value:
static void __DefaultConstructor(const FObjectInitializer& X) { new((EInternal*)X.GetObj())TClass; }

Default constructor for Karma's gamecode class declaration.

Remarks
There is a placement new operator in the definition

◆ DEFINE_DEFAULT_OBJECT_INITIALIZER_CONSTRUCTOR_CALL

#define DEFINE_DEFAULT_OBJECT_INITIALIZER_CONSTRUCTOR_CALL ( TClass)
Value:
static void __DefaultConstructor(const FObjectInitializer& X) { new((EInternal*)X.GetObj())TClass(X); }