public MTransitionActor(byte[] record) { SwitchToFrontRoom = record[0]; SwitchToFrontCamera = record[1]; SwitchToBackRoom = record[2]; SwitchToBackCamera = record[3]; Endian.Convert(out ushort actor, record, 4); Actor = actor; //ActorDataA = (byte)(Actor >> 12); Actor &= 0xFFF; Endian.Convert(out Vector3 <short> coords, record, 6); Coords = coords; Endian.Convert(out ushort ry, record, 12); Rotation = new Vector3 <ushort>(0, ry, 0); Endian.Convert(out ushort variable, record, 14); Variable = variable; //DayFlags = (ushort)(((ushort)record[9] << 7) + record[11]); //rotation.x = (ushort)(record[8] * 2); //rotation.y = (ushort)(record[10] * 2); //rotation.z = (ushort)(record[12] * 2); //DataC = record[13]; //Endian.Convert(out Variable, record, 6); }
private void InitializeHeader(byte[] data) { UInt32 temp; Endian.Convert(out MinCollision.x, data, 0); Endian.Convert(out MinCollision.y, data, 2); Endian.Convert(out MinCollision.z, data, 4); Endian.Convert(out MaxCollision.x, data, 6); Endian.Convert(out MaxCollision.y, data, 8); Endian.Convert(out MaxCollision.z, data, 10); Endian.Convert(out Vertices, data, 12); Endian.Convert(out temp, data, 16); VerticesOffset = SceneOffset + (temp & 0xFFFFFF); Endian.Convert(out Polygons, data, 20); Endian.Convert(out temp, data, 24); PolygonOffset = SceneOffset + (temp & 0xFFFFFF); Endian.Convert(out temp, data, 28); PolygonTypesOffset = SceneOffset + (temp & 0xFFFFFF); Endian.Convert(out temp, data, 32); hasCameraData = ((temp & 0xFF000000) > 0); CameraDataOffset = SceneOffset + (temp & 0xFFFFFF); Endian.Convert(out WaterBoxes, data, 36); Endian.Convert(out temp, data, 40); hasWaterBoxesData = ((temp & 0xFF000000) > 0); WaterBoxesOffset = SceneOffset + (temp & 0xFFFFFF); }
public MActorRecord(byte[] record) { Endian.Convert(out Actor, record, 0); RotationFlags = new Vector3 <bool> ( (Actor & 0x8000) > 0, (Actor & 0x4000) > 0, (Actor & 0x2000) > 0 ); Actor &= 0xFFF; Endian.Convert(out coords.x, record, 2); Endian.Convert(out coords.y, record, 4); Endian.Convert(out coords.z, record, 6); DayFlags = (ushort)((record[9] << 7) + (record[13] & 0x7F)); rotation.x = (ushort)(record[08] * 2 + Shift.AsByte(record[09], 0x80)); rotation.y = (ushort)(record[10] * 2 + Shift.AsByte(record[11], 0x80)); rotation.z = (ushort)(record[12] * 2 + Shift.AsByte(record[13], 0x80)); Scene_0x1B = Shift.AsByte(record[13], 0x7F); Endian.Convert(out Variable, record, 6); }
public MTransitionActor(byte[] record) { SwitchToFrontRoom = record[0]; SwitchToFrontCamera = record[1]; SwitchToBackRoom = record[2]; SwitchToBackCamera = record[3]; Endian.Convert(out Actor, record, 4); //ActorDataA = (byte)(Actor >> 12); Actor &= 0xFFF; Endian.Convert(out coords.x, record, 6); Endian.Convert(out coords.y, record, 8); Endian.Convert(out coords.z, record, 10); rotation.x = 0; Endian.Convert(out rotation.y, record, 12); rotation.z = 0; Endian.Convert(out Variable, record, 14); //DayFlags = (ushort)(((ushort)record[9] << 7) + record[11]); //rotation.x = (ushort)(record[8] * 2); //rotation.y = (ushort)(record[10] * 2); //rotation.z = (ushort)(record[12] * 2); //DataC = record[13]; //Endian.Convert(out Variable, record, 6); }
public static MTransitionActor New(byte[] record) { ushort actor; Endian.Convert(out actor, record, 4); switch (actor) { //case 0x0009: return new StandardDoorActor(record); //case 0x0023: return new TransitionPlaneActor(record); //case 0x002E: return new LiftingDoorActor(record); default: return(new MTransitionActor(record)); } }
public CollisionPolygon(byte[] data) { Endian.Convert(out type, data, 0); Endian.Convert(out Vertex.x, data, 2); Endian.Convert(out Vertex.y, data, 4); Endian.Convert(out Vertex.z, data, 6); Endian.Convert(out Normals.x, data, 8); Endian.Convert(out Normals.y, data, 10); Endian.Convert(out Normals.z, data, 12); Endian.Convert(out distanceFromOrigin, data, 14); }
private void Load(BinaryReader br) { byte[] arr; arr = br.ReadBytes(12); Endian.Convert(out a, arr, 0); Endian.Convert(out Transition, arr, 4); Endian.Convert(out short startFrame, arr, 6); Endian.Convert(out short endFrame, arr, 8); Endian.Convert(out EndFrameD, arr, 10); StartFrame = startFrame; EndFrame = endFrame; }
private void Load(BinaryReader br) { byte[] arr = br.ReadBytes(LENGTH); /* 0x00 */ Endian.Convert(out Action, arr, 0x00); /* 0x02 */ Endian.Convert(out short startFrame, arr, 0x02); /* 0x04 */ Endian.Convert(out short endFrame, arr, 0x04); /* 0x06 */ Endian.Convert(out Rotation, arr, 0x06); /* 0x0C */ Endian.Convert(out StartPosition, arr, 0x0C); /* 0x18 */ Endian.Convert(out EndPosition, arr, 0x18); /* 0x24 */ Endian.Convert(out Normal, arr, 0x24); StartFrame = startFrame; EndFrame = endFrame; }
public ActorRecord(byte[] record, params int[] p) { Endian.Convert(out Actor, record, 0); Endian.Convert(out coords.x, record, 2); Endian.Convert(out coords.y, record, 4); Endian.Convert(out coords.z, record, 6); Endian.Convert(out rotation.x, record, 8); Endian.Convert(out rotation.y, record, 10); Endian.Convert(out rotation.z, record, 12); Endian.Convert(out Variable, record, 14); objectDependencies = p; }
internal void Load(CutsceneCommand cmd, BinaryReader br) { byte[] arr; arr = br.ReadBytes(sizeof(short) * 6); Endian.Convert(out TextId, arr, 0); Endian.Convert(out short startFrame, arr, 2); Endian.Convert(out short endFrame, arr, 4); Endian.Convert(out Option, arr, 6); Endian.Convert(out TextIdChoiceA, arr, 8); Endian.Convert(out TextIdChoiceB, arr, 10); RootCommand = cmd; StartFrame = startFrame; EndFrame = endFrame; }
public TransitionActor(byte[] record) { SwitchToFrontRoom = record[0]; SwitchToFrontCamera = record[1]; SwitchToBackRoom = record[2]; SwitchToBackCamera = record[3]; Endian.Convert(out Actor, record, 4); Endian.Convert(out coords.x, record, 6); Endian.Convert(out coords.y, record, 8); Endian.Convert(out coords.z, record, 10); rotation.x = 0; Endian.Convert(out rotation.y, record, 12); rotation.z = 0; Endian.Convert(out Variable, record, 14); }
public void Load(short startFrame, BinaryReader br) { byte[] arr = br.ReadBytes(0x10); Terminator = arr[0]; Rotation = (sbyte)arr[1]; Endian.Convert(out Frames, arr, 2); Endian.Convert(out AngleOfView, arr, 4); Endian.Convert(out Coordinates, arr, 8); Endian.Convert(out d, arr, 14); //IFrameData StartFrame = startFrame; EndFrame = (short)(startFrame + Frames); }
public void Load(CutsceneCommand cmd, short startFrame, BinaryReader br) { byte[] arr; arr = br.ReadBytes(sizeof(uint) * 4); Terminator = arr[0]; Rotation = (sbyte)arr[1]; Endian.Convert(out Frames, arr, 2); Endian.Convert(out AngleOfView, arr, 4); Endian.Convert(Coordinates, arr, 8); Endian.Convert(out d, arr, 14); //IFrameData StartFrame = startFrame; EndFrame = (short)(startFrame + Frames); RootCommand = cmd; }
public CollisionPolygon(byte[] data) { Normal = new Vector3 <short>(); Endian.Convert(out Type, data, 0x00); Endian.Convert(out ushort vA, data, 0x02); Endian.Convert(out ushort vB, data, 0x04); Endian.Convert(out ushort vC, data, 0x06); Endian.Convert(out Normal, data, 0x08); Endian.Convert(out D, data, 0x0E); VertexA = (short)(vA & 0x1FFF); VertexB = (short)(vB & 0x1FFF); VertexC = (short)(vC & 0x1FFF); VertexFlagsA = Shift.AsByte(vA, 0xE000); VertexFlagsB = Shift.AsByte(vB, 0xE000); VertexFlagsC = Shift.AsByte(vC, 0xE000); }
public TransitionActor(byte[] record) { SwitchToFrontRoom = record[0]; SwitchToFrontCamera = record[1]; SwitchToBackRoom = record[2]; SwitchToBackCamera = record[3]; Endian.Convert(out ushort actor, record, 4); Actor = actor; Endian.Convert(out Vector3 <short> coords, record, 6); Coords = coords; Endian.Convert(out ushort ry, record, 12); Rotation = new Vector3 <ushort>(0, ry, 0); Endian.Convert(out ushort variable, record, 14); Variable = variable; }
public void Initialize(System.IO.BinaryReader br) { long count; ushort index; if (EndOffset != 0) { count = (EndOffset - ExitListAddress) / 2; if (count > 0x20) { throw new ArgumentOutOfRangeException(); } br.BaseStream.Position = ExitListAddress; for (int i = 0; i < count; i++) { Endian.Convert(out index, br.ReadBytes(2)); ExitList.Add(index); } } }
private void InitializeHeader(byte[] data) { Endian.Convert(out BoundsMin, data, 0x00); Endian.Convert(out BoundsMax, data, 0x06); Endian.Convert(out Vertices, data, 0x0C); Endian.Convert(out int temp, data, 0x10); VertexArray = new SegmentAddress(temp); Endian.Convert(out Polys, data, 0x14); Endian.Convert(out temp, data, 0x18); PolyArray = new SegmentAddress(temp); Endian.Convert(out temp, data, 0x1C); PolyTypeArray = new SegmentAddress(temp); Endian.Convert(out temp, data, 0x20); CameraDataArray = new SegmentAddress(temp); Endian.Convert(out WaterBoxes, data, 0x24); Endian.Convert(out temp, data, 0x28); WaterBoxesArray = new SegmentAddress(temp); }
private void Load(CutsceneCommand cmd, BinaryReader br) { byte[] arr; short startFrame; short endFrame; arr = br.ReadBytes(LENGTH); Endian.Convert(out Action, arr, 0); Endian.Convert(out startFrame, arr, 2); Endian.Convert(out endFrame, arr, 4); Endian.Convert(out d, arr, 6); Endian.Convert(out e, arr, 8); Endian.Convert(out f, arr, 10); Endian.Convert(StartVertex, arr, 12); Endian.Convert(EndVertex, arr, 24); Endian.Convert(VertexNormal, arr, 36); RootCommand = cmd; StartFrame = startFrame; EndFrame = endFrame; }