private void readRotationOriginPoints(VAVAddr address, EndianBinaryReader s, MapDescriptor mapDescriptor, AddressMapper addressMapper) { mapDescriptor.SwitchRotationOriginPoints.Clear(); // Special case handling: in the original game these values are initialized at run time only. So we need to hardcode them: if (address == addressMapper.toVersionAgnosticAddress((BSVAddr)0x806b8df0)) // magmageddon { // no points } else if (address == addressMapper.toVersionAgnosticAddress((BSVAddr)0x8047d598)) // collosus { mapDescriptor.SwitchRotationOriginPoints[0] = new OriginPoint(-288, -32); mapDescriptor.SwitchRotationOriginPoints[1] = new OriginPoint(288, -32); } else if (address == addressMapper.toVersionAgnosticAddress((BSVAddr)0x8047d5b4)) // observatory { mapDescriptor.SwitchRotationOriginPoints[0] = new OriginPoint(0, 0); } else if (addressMapper.canConvertToFileAddress(address)) { s.Seek(addressMapper.toFileAddress(address), SeekOrigin.Begin); var originPointCount = s.ReadUInt32(); for (int i = 0; i < originPointCount; i++) { OriginPoint point = new OriginPoint(); point.X = s.ReadSingle(); var z = s.ReadSingle(); // ignore Z value point.Y = s.ReadSingle(); mapDescriptor.SwitchRotationOriginPoints[i] = point; } } }
private void readLoopingModeConfig(VAVAddr address, EndianBinaryReader s, MapDescriptor mapDescriptor, AddressMapper addressMapper) { if (addressMapper.canConvertToFileAddress(address)) { s.Seek(addressMapper.toFileAddress(address), SeekOrigin.Begin); mapDescriptor.LoopingModeRadius = s.ReadSingle(); mapDescriptor.LoopingModeHorizontalPadding = s.ReadSingle(); mapDescriptor.LoopingModeVerticalSquareCount = s.ReadSingle(); } }