Skip to content

Commit

Permalink
add ALST
Browse files Browse the repository at this point in the history
  • Loading branch information
igorseabra4 committed Sep 27, 2018
1 parent bc857ce commit c2a192e
Show file tree
Hide file tree
Showing 5 changed files with 62 additions and 10 deletions.
18 changes: 9 additions & 9 deletions IndustrialPark/ArchiveEditor/ArchiveEditor.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions IndustrialPark/ArchiveEditor/ArchiveEditorFunctions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,12 @@ private void AddAssetToDictionary(Section_AHDR AHDR)
assetDictionary.Add(AHDR.assetID, newAsset);
}
break;
case AssetType.ALST:
{
AssetALST newAsset = new AssetALST(AHDR);
assetDictionary.Add(AHDR.assetID, newAsset);
}
break;
case AssetType.BSP:
case AssetType.JSP:
{
Expand Down
39 changes: 39 additions & 0 deletions IndustrialPark/Assets/Binary/AssetALST.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
using HipHopFile;
using System.Collections.Generic;
using System;
using System.Linq;
using static HipHopFile.Functions;

namespace IndustrialPark
{
public class AssetALST : Asset
{
public AssetALST(Section_AHDR AHDR) : base(AHDR) { }

public AssetID[] ANIM_AssetIDs
{
get
{
List<AssetID> assetIDs = new List<AssetID>();
for (int i = 0; i < AHDR.data.Length; i += 4)
assetIDs.Add(ReadUInt(i));

return assetIDs.ToArray();
}
set
{
List<byte> newData = new List<byte>();

foreach (AssetID i in value)
{
if (currentPlatform == Platform.GameCube)
newData.AddRange(BitConverter.GetBytes(i).Reverse());
else
newData.AddRange(BitConverter.GetBytes(i));
}

Data = newData.ToArray();
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
using System.Linq;
using System.ComponentModel;
using IndustrialPark.Models;
using static HipHopFile.Functions;

namespace IndustrialPark
{
Expand Down Expand Up @@ -232,7 +233,12 @@ public AssetID[] SiblingMVPTs
List<byte> restOfOldData = Data.Skip(0x28 + 4 * SiblingAmount).ToList();

foreach (AssetID i in value)
newData.AddRange(BitConverter.GetBytes(i).Reverse());
{
if (currentPlatform == Platform.GameCube)
newData.AddRange(BitConverter.GetBytes(i).Reverse());
else
newData.AddRange(BitConverter.GetBytes(i));
}

newData.AddRange(restOfOldData);

Expand Down
1 change: 1 addition & 0 deletions IndustrialPark/IndustrialPark.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@
<Compile Include="ArchiveEditor\AssetEditor\InternalTextEditor.designer.cs">
<DependentUpon>InternalTextEditor.cs</DependentUpon>
</Compile>
<Compile Include="Assets\Binary\AssetALST.cs" />
<Compile Include="Assets\Binary\AssetANIM.cs" />
<Compile Include="Assets\Binary\AssetMAPR.cs" />
<Compile Include="Assets\Binary\AssetPIPT.cs" />
Expand Down

0 comments on commit c2a192e

Please sign in to comment.