ZoneCodeGenerator: Call custom action on loading singlepointer and embedded

This commit is contained in:
Jan 2020-01-03 18:12:43 +01:00
parent 91327c57ce
commit 4971ec190d
3 changed files with 12 additions and 1 deletions

View File

@ -1,4 +1,8 @@
delimiters "$", "$" delimiters "$", "$"
// Loading common // Loading common
LoaderClassName(asset) ::= "Loader_$asset.Type.Name$" LoaderClassName(asset) ::= "Loader_$asset.Type.Name$"
CustomAction(action) ::= <<
m_actions.$action.ActionName$($first(action.ParameterTypes):{ param | $TypeVarName(param)$}$$rest(action.ParameterTypes):{ param | , $TypeVarName(param)$}$);
>>

View File

@ -14,6 +14,9 @@ LoadEmbedded_Load(context, structure, member, reference) ::= <<
$if(!member.IsLeaf)$ $if(!member.IsLeaf)$
$TypeVarName(member.Member.VariableType.Type)$ = &$TypeVarName(structure.Type)$->$member.Member.Name$$PrintArrayIndices(reference)$; $TypeVarName(member.Member.VariableType.Type)$ = &$TypeVarName(structure.Type)$->$member.Member.Name$$PrintArrayIndices(reference)$;
Load_$member.Member.VariableType.Type.Name$($if(member.Computations.IsAfterPartialLoad)$true$else$false$endif$);$\\$ Load_$member.Member.VariableType.Type.Name$($if(member.Computations.IsAfterPartialLoad)$true$else$false$endif$);$\\$
$if(member.StructureType.PostLoadAction)$
$CustomAction(member.StructureType.PostLoadAction)$
$endif$
$elseif(member.Computations.IsAfterPartialLoad)$ $elseif(member.Computations.IsAfterPartialLoad)$
m_stream->Load<$TypeDeclaration(member.Member.VariableType)$$PrintFollowingReferences(reference.FollowingReferences)$>(&$TypeVarName(structure.Type)$->$member.Member.Name$$PrintArrayIndices(reference)$);$\\$ m_stream->Load<$TypeDeclaration(member.Member.VariableType)$$PrintFollowingReferences(reference.FollowingReferences)$>(&$TypeVarName(structure.Type)$->$member.Member.Name$$PrintArrayIndices(reference)$);$\\$
$endif$ $endif$

View File

@ -22,6 +22,10 @@ $\\$
$if(member.StructureType && !member.StructureType.IsLeaf && !member.Computations.IsRuntimeBlock)$ $if(member.StructureType && !member.StructureType.IsLeaf && !member.Computations.IsRuntimeBlock)$
$TypeVarName(member.Member.VariableType.Type)$ = $TypeVarName(structure.Type)$->$member.Member.Name$$PrintArrayIndices(reference)$; $TypeVarName(member.Member.VariableType.Type)$ = $TypeVarName(structure.Type)$->$member.Member.Name$$PrintArrayIndices(reference)$;
Load_$member.Member.VariableType.Type.Name$(true);$\\$ Load_$member.Member.VariableType.Type.Name$(true);$\\$
$if(member.StructureType.PostLoadAction)$
$CustomAction(member.StructureType.PostLoadAction)$
$endif$
$else$ $else$
m_stream->Load<$TypeDeclaration(member.Member.VariableType)$$PrintFollowingReferences(reference.FollowingReferences)$>($TypeVarName(structure.Type)$->$member.Member.Name$$PrintArrayIndices(reference)$);$\\$ m_stream->Load<$TypeDeclaration(member.Member.VariableType)$$PrintFollowingReferences(reference.FollowingReferences)$>($TypeVarName(structure.Type)$->$member.Member.Name$$PrintArrayIndices(reference)$);$\\$
$endif$$\\$ $endif$$\\$