AAMP: Difference between revisions

m
formatting
imported>Leoetlino
imported>Leoetlino
m (formatting)
Line 2: Line 2:
'''AAMP'''s are parameter files (officially: binary resource parameter archives).
'''AAMP'''s are parameter files (officially: binary resource parameter archives).
</onlyinclude>
</onlyinclude>
== Structure ==
== Structure ==
{{expand section}}
{{expand section}}
Line 10: Line 11:
The following parameter type and class names are ''official'' and come from Nintendo's AAMP library.
The following parameter type and class names are ''official'' and come from Nintendo's AAMP library.


{|class="wikitable"
{| class="wikitable"
! ID !! Type !! Parameter type
! ID  
! Type  
! Parameter type
|-
|-
| 0  || bool || <code>agl::utl::Parameter<bool></code>
| 0   
| bool  
| <code>agl::utl::Parameter<bool></code>
|-
|-
| 1  || f32  || <code>agl::utl::Parameter<float></code>
| 1   
| f32   
| <code>agl::utl::Parameter<float></code>
|-
|-
| 2  || int  || <code>agl::utl::Parameter<int></code>
| 2   
| int   
| <code>agl::utl::Parameter<int></code>
|-
|-
| 3  || vec2 || <code>agl::utl::Parameter<sead::Vector2<float>></code>
| 3   
| vec2  
| <code>agl::utl::Parameter<sead::Vector2<float>></code>
|-
|-
| 4  || vec3 || <code>agl::utl::Parameter<sead::Vector3<float>></code>
| 4   
| vec3  
| <code>agl::utl::Parameter<sead::Vector3<float>></code>
|-
|-
| 5  || vec4 || <code>agl::utl::Parameter<sead::Vector4<float>></code>
| 5   
| vec4  
| <code>agl::utl::Parameter<sead::Vector4<float>></code>
|-
|-
| 6  || color || <code>agl::utl::Parameter<sead::Color4f></code>
| 6   
| color  
| <code>agl::utl::Parameter<sead::Color4f></code>
|-
|-
| 7  || string32 || <code>agl::utl::Parameter<sead::FixedSafeString<32>></code>
| 7   
| string32  
| <code>agl::utl::Parameter<sead::FixedSafeString<32>></code>
|-
|-
| 8  || string64 || <code>agl::utl::Parameter<sead::FixedSafeString<64>></code>
| 8   
| string64  
| <code>agl::utl::Parameter<sead::FixedSafeString<64>></code>
|-
|-
| 9  || curve1 || <code>agl::utl::ParameterCurve<1u></code>
| 9   
| curve1  
| <code>agl::utl::ParameterCurve<1u></code>
|-
|-
| 10 || curve2 || <code>agl::utl::ParameterCurve<2u></code>
| 10  
| curve2  
| <code>agl::utl::ParameterCurve<2u></code>
|-
|-
| 11 || curve3 || <code>agl::utl::ParameterCurve<3u></code> (unused in BotW?)
| 11  
| curve3  
| <code>agl::utl::ParameterCurve<3u></code> (unused in BotW?)
|-
|-
| 12 || curve4 || <code>agl::utl::ParameterCurve<4u></code>
| 12  
| curve4  
| <code>agl::utl::ParameterCurve<4u></code>
|-
|-
| 13 || buffer_int || <code>agl::utl::ParameterBuffer<int></code>
| 13  
| buffer_int  
| <code>agl::utl::ParameterBuffer<int></code>
|-
|-
| 14 || buffer_f32 || <code>agl::utl::ParameterBuffer<float></code>
| 14  
| buffer_f32  
| <code>agl::utl::ParameterBuffer<float></code>
|-
|-
| 15 || string256 || <code>agl::utl::Parameter<sead::FixedSafeString<256>></code>
| 15  
| string256  
| <code>agl::utl::Parameter<sead::FixedSafeString<256>></code>
|-
|-
| 16 || quat || <code>agl::utl::Parameter<sead::Quat<float>></code>
| 16  
| quat  
| <code>agl::utl::Parameter<sead::Quat<float>></code>
|-
|-
| 17 || u32 || <code>agl::utl::Parameter<uint></code>
| 17  
| u32  
| <code>agl::utl::Parameter<uint></code>
|-
|-
| 18 || buffer_u32 || <code>agl::utl::ParameterBuffer<unsigned int></code>
| 18  
| buffer_u32  
| <code>agl::utl::ParameterBuffer<unsigned int></code>
|-
|-
| 19 || buffer_binary || <code>agl::utl::ParameterBuffer<unsigned char></code>
| 19  
| buffer_binary  
| <code>agl::utl::ParameterBuffer<unsigned char></code>
|-
|-
| 20 || stringRef || <code>agl::utl::Parameter<sead::SafeStringBase<char>></code>
| 20  
| stringRef  
| <code>agl::utl::Parameter<sead::SafeStringBase<char>></code>
|-
|-
| 21 || (none, special) || <code>agl::utl::Parameter<int *></code>, <code>agl::utl::Parameter<float *></code>, <code>agl::utl::Parameter<unsigned int *></code>, <code>agl::utl::Parameter<unsigned char *></code>
| 21  
| (none, special)  
| <code>agl::utl::Parameter<int *></code>, <code>agl::utl::Parameter<float *></code>, <code>agl::utl::Parameter<unsigned int *></code>, <code>agl::utl::Parameter<unsigned char *></code>
|}
|}


Line 82: Line 129:
Parameter classes (e.g. Bdmgparam) inherit from agl::utl::IParameterIO -> agl::utl::IParameterList.
Parameter classes (e.g. Bdmgparam) inherit from agl::utl::IParameterIO -> agl::utl::IParameterList.


In their constructors or in an init function, agl::utl::Parameter objects are created and initialised by passing the key name, the description and help strings (see agl::utl::ParameterBase::initializeListNode). The CRC32 for the keys are stored and then the Parameter object is added to a agl::utl::IParameterObj list.
In their constructors or in an init function, agl::utl::Parameter objects are created and initialised by passing the key name, the description and help strings (see <code>agl::utl::ParameterBase::initializeListNode</code>). The CRC32 for the keys are stored and then the Parameter object is added to a agl::utl::IParameterObj list.


Finally, to actually load the AAMP binary data into all the parameter objects, the game constructs a agl::utl::ResParameterArchive::ResParameterArchive and then passes it to applyResParameterArchive().
Finally, to actually load the AAMP binary data into all the parameter objects, the game constructs a agl::utl::ResParameterArchive::ResParameterArchive and then passes it to <code>applyResParameterArchive()</code>.


==== Structures ====
==== Structures ====
agl::utl::ResParameterArchive holds a pointer to agl::utl::ResParameterArchiveData (which is the AAMP header structure).
agl::utl::ResParameterArchive holds a pointer to agl::utl::ResParameterArchiveData (which is the AAMP header structure).


Elements like param_root are parameter lists (agl::utl::IParameterList, tag: param_list). The binary structure for lists is agl::utl::ResParameterList.
Elements like param_root are parameter lists (agl::utl::IParameterList, tag: <code>param_list</code>). The binary structure for lists is agl::utl::ResParameterList.


A param list holds parameter objects (agl::utl::IParameterObj, tag: param_array) or other parameter lists. The binary structure for objects is agl::utl::ResParameterObj.
A param list holds parameter objects (agl::utl::IParameterObj, tag: <code>param_array</code>) or other parameter lists. The binary structure for objects is agl::utl::ResParameterObj.


Param objects store parameters (agl::utl::ParameterBase, tag: param). The binary structure for parameters is agl::utl::ResParameter.
Param objects store parameters (agl::utl::ParameterBase, tag: <code>param</code>). The binary structure for parameters is agl::utl::ResParameter.


=== Parameter list name ===
=== Parameter list name ===
agl::utl::IParameterIO (in Nintendo's AAMP library) automatically sets the 'parameter list name' / tag name to param_root.
agl::utl::IParameterIO (in Nintendo's AAMP library) automatically sets the 'parameter list name' / tag name to <code>param_root</code>.


== al::Parameter ==
== al::Parameter ==
Anonymous user