Commit 4e2e712c authored by PoroCYon's avatar PoroCYon

fix #42 (shotgun debugging)

parent e4c1c7ce
Pipeline #44239910 passed with stages
in 1 minute and 48 seconds
......@@ -891,7 +891,7 @@ namespace Altar.Repack
{
data.Buffer.Write(new RoomObjEntry
{
DefIndex = ro.DefIndex,
DefIndex = ro.DefIndex ?? 0xFFFFFFFF,
Position = ro.Position,
Scale = ro.Scale,
Colour = ro.Colour,
......@@ -907,7 +907,7 @@ namespace Altar.Repack
{
data.Buffer.Write(new RoomTileEntry
{
DefIndex = rt.DefIndex,
DefIndex = rt.DefIndex ?? 0xFFFFFFFF,
Position = rt.Position,
SourcePos = rt.SourcePosition,
Size = rt.Size,
......
......@@ -250,7 +250,7 @@ namespace Altar
public struct RoomObject
{
public Point Position;
public uint DefIndex;
public uint? DefIndex;
public uint InstanceID;
public uint CreateCodeID; // gml_RoomCC_<name>_<CreateCodeID>_Create
public PointF Scale;
......@@ -261,7 +261,7 @@ namespace Altar
public struct RoomTile
{
public Point Position;
public uint DefIndex;
public uint? DefIndex;
public Point SourcePosition;
public Point Size;
public uint Depth;
......
......@@ -117,7 +117,6 @@ namespace Altar.Unpack
var o = new RoomObject();
o.DefIndex = entry->DefIndex;
o.Position = entry->Position;
o.Scale = entry->Scale ;
o.Colour = entry->Colour ;
......@@ -126,6 +125,8 @@ namespace Altar.Unpack
o.InstanceID = entry->InstanceID ;
o.CreateCodeID = entry->CreateCodeID;
o.DefIndex = entry->DefIndex == 0xFFFFFFFF ? null : (uint?)entry->DefIndex;
return o;
}
static RoomTile ReadRoomTile(GMFileContent content, IntPtr p)
......@@ -134,7 +135,6 @@ namespace Altar.Unpack
var t = new RoomTile();
t.DefIndex = entry->DefIndex;
t.Position = entry->Position;
t.SourcePosition = entry->SourcePos;
t.Size = entry->Size;
......@@ -144,6 +144,8 @@ namespace Altar.Unpack
t.Depth = entry->TileDepth ;
t.InstanceID = entry->InstanceID;
t.DefIndex = entry->DefIndex == 0xFFFFFFFF ? null : (uint?)entry->DefIndex;
return t;
}
static RoomObjInst ReadRoomObjInst(GMFileContent content, IntPtr p)
......
......@@ -199,7 +199,6 @@ namespace Altar.Unpack
var r = CreateObj();
r["pos" ] = SerializePoint(obj.Position);
r["obj" ] = objs[obj.DefIndex].Name;
r["scale" ] = SerializePoint(obj.Scale);
r["colour" ] = obj.Colour.ToHexString();
r["rotation"] = obj.Rotation;
......@@ -207,6 +206,9 @@ namespace Altar.Unpack
r["instanceid" ] = obj.InstanceID ;
r["createcodeid"] = obj.CreateCodeID;
if (obj.DefIndex.HasValue)
r["obj"] = objs[obj.DefIndex.Value].Name;
return r;
}
static JsonData SerializeRoomTile(RoomTile tile, LazyArray<BackgroundInfo> bgs )
......@@ -214,7 +216,6 @@ namespace Altar.Unpack
var r = CreateObj();
r["pos" ] = SerializePoint(tile.Position);
r["bg" ] = bgs[tile.DefIndex].Name;
r["sourcepos"] = SerializePoint(tile.SourcePosition);
r["size" ] = SerializeSize (tile.Size);
r["scale" ] = SerializePoint(tile.Scale);
......@@ -223,6 +224,9 @@ namespace Altar.Unpack
r["tiledepth" ] = tile.Depth ;
r["instanceid"] = tile.InstanceID;
if (tile.DefIndex.HasValue)
r["bg"] = bgs[tile.DefIndex.Value].Name;
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