Commit 846ed8f1 authored by PoroCYon's avatar PoroCYon

fix bugs. don't use the previous commit

parent 75bb4afc
......@@ -375,7 +375,7 @@ namespace Altar
public uint Name;
public uint Index;
public uint Unk1;
public uint Unk2;
public uint Depth;
fixed uint _pad1[4];
public uint Unk3;
public uint InstCount;
......
......@@ -186,7 +186,7 @@ namespace Altar
for (int i = 1; i < f.AudioGroups.Length; ++i)
{
WrAndGetC(DASH_ + f.AudioGroups[i] + O_PAREN + i +
SLASH + f.AudioGroups.Length + C_PAREN + SPACE_S,
SLASH + (f.AudioGroups.Length - 1) + C_PAREN + SPACE_S,
out cl, out ct);
var agrpfn = Path.GetDirectoryName(file) + Path.DirectorySeparatorChar
......@@ -199,10 +199,13 @@ namespace Altar
var infoTable = new Dictionary<int, SoundInfo>();
foreach (var s in f.Sound)
for (uint iii = 0; iii < f.Sound.Length; ++iii)
{
var s = f.Sound[iii];
if ((s.IsEmbedded || s.IsCompressed) && s.AudioID != -1
&& s.GroupID == i)
infoTable[s.AudioID] = s;
}
var odgrp = od + DIR_AGRP + f.AudioGroups[i];
if (!Directory.Exists(odgrp))
......
......@@ -136,9 +136,9 @@ namespace Altar.Repack
Index = (uint)j["index"],
Instances = DeserializeArray(j["instances"], i => (uint)i),
Name = (string)j["name"],
Unk1 = (uint)j["unk1"],
Unk2 = (uint)j["unk2"],
Unk3 = (uint)j["unk3"]
Unk1 = (uint)j["unk1" ],
Depth = (uint)j["depth"],
Unk3 = (uint)j["unk3" ]
};
}
......
......@@ -924,9 +924,9 @@ namespace Altar.Repack
data.Buffer.Write(new RoomObjInstEntry
{
Index = roi.Index,
Unk1 = roi.Unk1,
Unk2 = roi.Unk2,
Unk3 = roi.Unk3,
Unk1 = roi.Unk1 ,
Depth = roi.Depth,
Unk3 = roi.Unk3 ,
InstCount = (uint)roi.Instances.Length,
Name = strings.GetOffset(roi.Name)
});
......
......@@ -275,7 +275,7 @@ namespace Altar
public string Name;
public uint Index;
public uint Unk1;
public uint Unk2;
public uint Depth;
public uint Unk3;
public uint[] Instances;
}
......
......@@ -154,15 +154,15 @@ namespace Altar.Unpack
oi.Index = entry->Index;
oi.Name = StringFromOffset(content, entry->Name);
oi.Unk1 = entry->Unk1;
oi.Unk2 = entry->Unk2;
oi.Unk3 = entry->Unk3;
oi.Instances = new uint[entry->InstCount];
for (uint i = 0; i < oi.Instances.Length; i++)
{
oi.Unk1 = entry->Unk1 ;
oi.Depth = entry->Depth;
oi.Unk3 = entry->Unk3 ;
uint isn = entry->InstCount;
if (isn > 0x8000) isn = 0; // workaround for GM2
oi.Instances = new uint[isn];
for (uint i = 0; i < isn; i++)
oi.Instances[i] = (&entry->Instances)[i];
}
return oi;
}
......@@ -325,6 +325,7 @@ namespace Altar.Unpack
SpriteCollisionMask* masks =
(SpriteCollisionMask*)((ulong)&tex->Offsets + sizeof(uint) * tex->Count);
// TODO: store this in a different way. this is wasteful as fuck.
uint amt = ret.SeparateColMasks ? masks->MaskCount : 1;
//Console.WriteLine("amt="+amt.ToString(SR.HEX_FM8) + " at " + ((ulong)&masks->MaskCount - (ulong)content.RawData.BPtr).ToString(SR.HEX_FM8));
......
......@@ -231,9 +231,9 @@ namespace Altar.Unpack
var r = CreateObj();
r["name" ] = oi.Name;
r["index" ] = oi.Index;
r["unk1" ] = oi.Unk1;
r["unk2" ] = oi.Unk2;
r["unk3" ] = oi.Unk3;
r["unk1" ] = oi.Unk1 ;
r["depth" ] = oi.Depth;
r["unk3" ] = oi.Unk3 ;
r["instances"] = SerializeArray(oi.Instances, Utils.Identity);
return r;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment