diff --git a/src/ZoneCodeGenerator/Generating/Templates/Loading/Common.stg b/src/ZoneCodeGenerator/Generating/Templates/Loading/Common.stg index 1a3cc6ea..0b353249 100644 --- a/src/ZoneCodeGenerator/Generating/Templates/Loading/Common.stg +++ b/src/ZoneCodeGenerator/Generating/Templates/Loading/Common.stg @@ -1,4 +1,8 @@ delimiters "$", "$" // Loading common -LoaderClassName(asset) ::= "Loader_$asset.Type.Name$" \ No newline at end of file +LoaderClassName(asset) ::= "Loader_$asset.Type.Name$" + +CustomAction(action) ::= << +m_actions.$action.ActionName$($first(action.ParameterTypes):{ param | $TypeVarName(param)$}$$rest(action.ParameterTypes):{ param | , $TypeVarName(param)$}$); +>> \ No newline at end of file diff --git a/src/ZoneCodeGenerator/Generating/Templates/Loading/Embedded.stg b/src/ZoneCodeGenerator/Generating/Templates/Loading/Embedded.stg index 991133af..c3032eb2 100644 --- a/src/ZoneCodeGenerator/Generating/Templates/Loading/Embedded.stg +++ b/src/ZoneCodeGenerator/Generating/Templates/Loading/Embedded.stg @@ -14,6 +14,9 @@ LoadEmbedded_Load(context, structure, member, reference) ::= << $if(!member.IsLeaf)$ $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$);$\\$ +$if(member.StructureType.PostLoadAction)$ +$CustomAction(member.StructureType.PostLoadAction)$ +$endif$ $elseif(member.Computations.IsAfterPartialLoad)$ m_stream->Load<$TypeDeclaration(member.Member.VariableType)$$PrintFollowingReferences(reference.FollowingReferences)$>(&$TypeVarName(structure.Type)$->$member.Member.Name$$PrintArrayIndices(reference)$);$\\$ $endif$ diff --git a/src/ZoneCodeGenerator/Generating/Templates/Loading/SinglePointer.stg b/src/ZoneCodeGenerator/Generating/Templates/Loading/SinglePointer.stg index aee93e64..9111bbcf 100644 --- a/src/ZoneCodeGenerator/Generating/Templates/Loading/SinglePointer.stg +++ b/src/ZoneCodeGenerator/Generating/Templates/Loading/SinglePointer.stg @@ -22,6 +22,10 @@ $\\$ $if(member.StructureType && !member.StructureType.IsLeaf && !member.Computations.IsRuntimeBlock)$ $TypeVarName(member.Member.VariableType.Type)$ = $TypeVarName(structure.Type)$->$member.Member.Name$$PrintArrayIndices(reference)$; Load_$member.Member.VariableType.Type.Name$(true);$\\$ +$if(member.StructureType.PostLoadAction)$ + +$CustomAction(member.StructureType.PostLoadAction)$ +$endif$ $else$ m_stream->Load<$TypeDeclaration(member.Member.VariableType)$$PrintFollowingReferences(reference.FollowingReferences)$>($TypeVarName(structure.Type)$->$member.Member.Name$$PrintArrayIndices(reference)$);$\\$ $endif$$\\$