mirror of
https://github.com/Laupetin/OpenAssetTools.git
synced 2025-04-20 08:05:45 +00:00
ZoneCodeGenerator: Call custom action on loading singlepointer and embedded
This commit is contained in:
parent
91327c57ce
commit
4971ec190d
@ -2,3 +2,7 @@ delimiters "$", "$"
|
||||
|
||||
// Loading common
|
||||
LoaderClassName(asset) ::= "Loader_$asset.Type.Name$"
|
||||
|
||||
CustomAction(action) ::= <<
|
||||
m_actions.$action.ActionName$($first(action.ParameterTypes):{ param | $TypeVarName(param)$}$$rest(action.ParameterTypes):{ param | , $TypeVarName(param)$}$);
|
||||
>>
|
@ -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$
|
||||
|
@ -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$$\\$
|
||||
|
Loading…
x
Reference in New Issue
Block a user