Game Development Reference
In-Depth Information
else
{
pComponent = VCreateComponent(pNode);
if (pComponent)
{
pActor->AddComponent(pComponent);
pComponent->SetOwner(pActor);
}
}
}
}
The trick here is that a component doesn
'
t need a complete XML description to be
initialized
just the members that are either different from the default values
defined in the C++ component class or those members that have been recently
modified.
For the previous XML snippet, the code would find the TranformComponent of the
Grid actor and call VInit() , which would save the new orientation of the actor.
The last function that modifies actors is simply one that destroys an actor given its
ID.
void DestroyActor( ActorId actorId )
{
g_pApp->m_pGame->VDestroyActor(actorId);
}
With all the accessor functions defined, it is time to create the DLL.
Creating the DLL
When you create a DLL, you usually want to expose functions to any consumer of
that DLL. This is done with the _declspec keyword in a C++ header file. Here ' s
how this looks:
#include
Editor.h
#define DllExport _declspec(DLLexport)
// Editor Framework Functions
extern
DllExport int EditorMain(
int *instancePtrAddress,
int *hPrevInstancePtrAddress,
int *hWndPtrAddress,
C
 
 
Search WWH ::




Custom Search