forked from LostArtefacts/TR-Rando
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement model hierarchy (LostArtefacts#628)
Part of LostArtefacts#619.
- Loading branch information
Showing
44 changed files
with
795 additions
and
292 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
namespace TRLevelControl.Model; | ||
|
||
public enum TR1FX : short | ||
{ | ||
Turn180 = 0, | ||
FloorShake = 1, | ||
LaraNormal = 2, | ||
LaraBubbles = 3, | ||
EndLevel = 4, | ||
Earthquake = 5, | ||
Flood = 6, | ||
RaisingBlock = 7, | ||
StairsToSlope = 8, | ||
Sand = 9, | ||
PowerUp = 10, | ||
Explosion = 11, | ||
LaraHandsFree = 12, | ||
FlipMap = 13, | ||
DrawRightGun = 14, | ||
Chainblock = 15, | ||
Flicker = 16, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,25 @@ | ||
using TRLevelControl.Serialization; | ||
namespace TRLevelControl.Model; | ||
|
||
namespace TRLevelControl.Model; | ||
|
||
public class TRAnimFrame : ISerializableCompact | ||
public class TRAnimFrame : ICloneable | ||
{ | ||
public TRBoundingBox Box { get; set; } | ||
|
||
public TRBoundingBox Bounds { get; set; } | ||
public short OffsetX { get; set; } | ||
|
||
public short OffsetY { get; set; } | ||
|
||
public short OffsetZ { get; set; } | ||
public List<TRAnimFrameRotation> Rotations { get; set; } | ||
|
||
public short NumValues { get; set; } | ||
|
||
public ushort[] AngleSets { get; set; } | ||
|
||
public byte[] Serialize() | ||
public TRAnimFrame Clone() | ||
{ | ||
using MemoryStream stream = new(); | ||
using (BinaryWriter writer = new(stream)) | ||
return new() | ||
{ | ||
writer.Write(Box.Serialize()); | ||
writer.Write(OffsetX); | ||
writer.Write(OffsetY); | ||
writer.Write(OffsetZ); | ||
writer.Write(NumValues); | ||
|
||
foreach (ushort val in AngleSets) | ||
{ | ||
writer.Write(val); | ||
} | ||
} | ||
|
||
return stream.ToArray(); | ||
Bounds = Bounds.Clone(), | ||
OffsetX = OffsetX, | ||
OffsetY = OffsetY, | ||
OffsetZ = OffsetZ, | ||
Rotations = new(Rotations.Select(r => r.Clone())) | ||
}; | ||
} | ||
|
||
object ICloneable.Clone() | ||
=> Clone(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
TRLevelControl/Model/Common/AnimCommands/TREmptyHandsCommand.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace TRLevelControl.Model; | ||
|
||
public class TREmptyHandsCommand : TRAnimCommand | ||
{ | ||
public override TRAnimCommandType Type => TRAnimCommandType.EmptyHands; | ||
|
||
public override TRAnimCommand Clone() | ||
=> (TREmptyHandsCommand)MemberwiseClone(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
namespace TRLevelControl.Model; | ||
|
||
public class TRFXCommand : TRAnimCommand | ||
{ | ||
public override TRAnimCommandType Type => TRAnimCommandType.FlipEffect; | ||
public short FrameNumber { get; set; } | ||
public short EffectID { get; set; } | ||
|
||
public override TRAnimCommand Clone() | ||
=> (TRFXCommand)MemberwiseClone(); | ||
} |
11 changes: 11 additions & 0 deletions
11
TRLevelControl/Model/Common/AnimCommands/TRFootprintCommand.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
namespace TRLevelControl.Model; | ||
|
||
public class TRFootprintCommand : TRAnimCommand | ||
{ | ||
public override TRAnimCommandType Type => TRAnimCommandType.FlipEffect; | ||
public short FrameNumber { get; set; } | ||
public TRFootprint Foot { get; set; } | ||
|
||
public override TRAnimCommand Clone() | ||
=> (TRFootprintCommand)MemberwiseClone(); | ||
} |
11 changes: 11 additions & 0 deletions
11
TRLevelControl/Model/Common/AnimCommands/TRJumpDistanceCommand.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
namespace TRLevelControl.Model; | ||
|
||
public class TRJumpDistanceCommand : TRAnimCommand | ||
{ | ||
public override TRAnimCommandType Type => TRAnimCommandType.JumpDistance; | ||
public short VerticalSpeed { get; set; } | ||
public short HorizontalSpeed { get; set; } | ||
|
||
public override TRAnimCommand Clone() | ||
=> (TRJumpDistanceCommand)MemberwiseClone(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace TRLevelControl.Model; | ||
|
||
public class TRKillCommand : TRAnimCommand | ||
{ | ||
public override TRAnimCommandType Type => TRAnimCommandType.Kill; | ||
|
||
public override TRAnimCommand Clone() | ||
=> (TRKillCommand)MemberwiseClone(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
namespace TRLevelControl.Model; | ||
|
||
public class TRNullCommand : TRAnimCommand | ||
{ | ||
public override TRAnimCommandType Type => TRAnimCommandType.Null; | ||
public short Value { get; set; } | ||
|
||
public override TRAnimCommand Clone() | ||
=> (TRNullCommand)MemberwiseClone(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
namespace TRLevelControl.Model; | ||
|
||
public class TRSFXCommand : TRAnimCommand | ||
{ | ||
public override TRAnimCommandType Type => TRAnimCommandType.PlaySound; | ||
public TRSFXEnvironment Environment { get; set; } | ||
public short FrameNumber { get; set; } | ||
public short SoundID { get; set; } | ||
|
||
public override TRAnimCommand Clone() | ||
=> (TRSFXCommand)MemberwiseClone(); | ||
} |
12 changes: 12 additions & 0 deletions
12
TRLevelControl/Model/Common/AnimCommands/TRSetPositionCommand.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
namespace TRLevelControl.Model; | ||
|
||
public class TRSetPositionCommand : TRAnimCommand | ||
{ | ||
public override TRAnimCommandType Type => TRAnimCommandType.SetPosition; | ||
public short X { get; set; } | ||
public short Y { get; set; } | ||
public short Z { get; set; } | ||
|
||
public override TRAnimCommand Clone() | ||
=> (TRSetPositionCommand)MemberwiseClone(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
namespace TRLevelControl.Model; | ||
|
||
public enum TRAngleMode | ||
{ | ||
All = 0, | ||
X = 0x4000, | ||
Y = 0x8000, | ||
Z = 0xC000, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
namespace TRLevelControl.Model; | ||
|
||
public enum TRFootprint | ||
{ | ||
Left = 0x4000, | ||
Right = 0x8000, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
namespace TRLevelControl.Model; | ||
|
||
public enum TRSFXEnvironment | ||
{ | ||
Any = 0, | ||
Land = 0x4000, | ||
Water = 0x8000, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
namespace TRLevelControl.Model; | ||
|
||
public class TRAnimFrameRotation : ICloneable | ||
{ | ||
public short X { get; set; } | ||
public short Y { get; set; } | ||
public short Z { get; set; } | ||
|
||
public TRAnimFrameRotation Clone() | ||
=> (TRAnimFrameRotation)MemberwiseClone(); | ||
|
||
object ICloneable.Clone() | ||
=> Clone(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
namespace TRLevelControl.Model; | ||
|
||
public enum TR2FX : short | ||
{ | ||
Turn180 = 0, | ||
FloorShake = 1, | ||
LaraNormal = 2, | ||
LaraBubbles = 3, | ||
EndLevel = 4, | ||
Flood = 5, | ||
Chandelier = 6, | ||
Rumble = 7, | ||
Pistons = 8, | ||
Curtains = 9, | ||
SetChange = 10, | ||
Explosion = 11, | ||
LaraHandsFree = 12, | ||
FlipMap = 13, | ||
DrawRightGun = 14, | ||
DrawLeftGun = 15, | ||
MeshSwap1 = 18, | ||
MeshSwap2 = 19, | ||
MeshSwap3 = 20, | ||
HideItem = 21, | ||
ShowItem = 22, | ||
DynamicLightsOn = 23, | ||
DynamicLightsOff = 24, | ||
Statue = 25, | ||
ResetHair = 26, | ||
Boiler = 27, | ||
AssaultReset = 28, | ||
AssaultStop = 29, | ||
AssaultStart = 30, | ||
AssaultEnd = 31, | ||
} |
Oops, something went wrong.