Skip to content

Commit

Permalink
- fix : coredump endianness
Browse files Browse the repository at this point in the history
  • Loading branch information
kgersen@hotmail.com committed Mar 26, 2013
1 parent 4bd146b commit 3a0c7a1
Show file tree
Hide file tree
Showing 3 changed files with 40 additions and 2 deletions.
2 changes: 1 addition & 1 deletion ICE/CoreDump/CoreDump.csproj
Expand Up @@ -23,7 +23,7 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PlatformTarget>AnyCPU</PlatformTarget>
<PlatformTarget>x86</PlatformTarget>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
Expand Down
15 changes: 14 additions & 1 deletion ICE/CoreDump/ObjectDumper.cs
Expand Up @@ -142,10 +142,23 @@ private void WriteValue(object o)
else if (o is TechTreeBitMask)
{
TechTreeBitMask ttbm = (TechTreeBitMask)o;

// temporary fix.
BitArray bol = new BitArray(ttbm.bits.Length);
bol.SetAll(false);
int idx = 0;
foreach (bool b in ttbm.bits)
{
if (b) WriteValue(" "+idx);
if (b)
bol.Set(((idx / 8) * 8 + (7 - idx % 8)), true);
idx++;
}
// end of fix: to revert replace bol with ttbm.bits
idx = 0;
foreach (bool b in bol)
{
if (b)
WriteValue(" " + idx);
idx++;
}
}
Expand Down
25 changes: 25 additions & 0 deletions ICE/CoreDump/Program.cs
Expand Up @@ -59,6 +59,31 @@ static void Main(string[] args)
string pid = "Parts-" + p.name + "(" + p.partID + ")-";
ObjectDumper.Write(pid, p);
}
foreach (DataChaffTypeIGC m in core.m_chaffTypes)
{
string mid = "Chaffs-" + m.launcherDef.name + "(" + m.expendabletypeID + ")-";
ObjectDumper.Write(mid, m);
}
foreach (DataMineTypeIGC m in core.m_mineTypes)
{
string mid = "Mines-"+ m.launcherDef.name + "("+ m.expendabletypeID +")-";
ObjectDumper.Write(mid, m);
}
foreach (DataMissileTypeIGC m in core.m_missileTypes)
{
string mid = "Missiles-" + m.launcherDef.name + "(" + m.expendabletypeID + ")-";
ObjectDumper.Write(mid, m);
}
foreach (DataProbeTypeIGC m in core.m_probeTypes)
{
string mid = "Probes-" + m.launcherDef.name + "(" + m.expendabletypeID + ")-";
ObjectDumper.Write(mid, m);
}
foreach (DataLauncherTypeIGC l in core.m_launcherTypes)
{
string lid = "Launchers-" + l.partID + "-" + l.expendabletypeID+"-";
ObjectDumper.Write(lid, l);
}
foreach (DataTreasureSetIGC t in core.m_treasureSets)
{
string tid = "Treasures-" + t.name + "(" + t.treasureSetID + ")-";
Expand Down

0 comments on commit 3a0c7a1

Please sign in to comment.