mirror of
https://gitlab.com/Syroot/Worms.git
synced 2025-01-27 22:27:58 +03:00
Use new BinaryStream extensions.
This commit is contained in:
parent
9feea4313f
commit
fd53660c5e
@ -198,18 +198,18 @@ namespace Syroot.Worms.Armageddon
|
||||
{
|
||||
using (BinaryStream reader = new BinaryStream(stream, encoding: Encoding.ASCII, leaveOpen: true))
|
||||
{
|
||||
Name = reader.ReadFixedString(17);
|
||||
WormNames = reader.ReadFixedStrings(8, 17);
|
||||
Name = reader.ReadString(17);
|
||||
WormNames = reader.ReadStrings(8, 17);
|
||||
CpuLevel = reader.Read1Byte();
|
||||
SoundBankName = reader.ReadFixedString(0x20);
|
||||
SoundBankName = reader.ReadString(0x20);
|
||||
SoundBankLocation = reader.Read1Byte();
|
||||
FanfareName = reader.ReadFixedString(0x20);
|
||||
FanfareName = reader.ReadString(0x20);
|
||||
UseCustomFanfare = reader.Read1Byte();
|
||||
|
||||
GraveSprite = reader.ReadSByte();
|
||||
if (GraveSprite < 0)
|
||||
{
|
||||
GraveFileName = reader.ReadFixedString(0x20);
|
||||
GraveFileName = reader.ReadString(0x20);
|
||||
Grave = new RawBitmapData()
|
||||
{
|
||||
BitsPerPixel = 8,
|
||||
@ -232,7 +232,7 @@ namespace Syroot.Worms.Armageddon
|
||||
DeathmatchDeaths = reader.ReadInt32();
|
||||
MissionStatuses = reader.ReadStructs<TeamMissionStatus>(_missionCount);
|
||||
|
||||
FlagFileName = reader.ReadFixedString(0x20);
|
||||
FlagFileName = reader.ReadString(0x20);
|
||||
Flag = new RawBitmapData()
|
||||
{
|
||||
BitsPerPixel = 8,
|
||||
@ -259,19 +259,19 @@ namespace Syroot.Worms.Armageddon
|
||||
{
|
||||
using (BinaryStream writer = new BinaryStream(stream, encoding: Encoding.ASCII, leaveOpen: true))
|
||||
{
|
||||
writer.Write(Name, 17);
|
||||
writer.Write(WormNames, 17);
|
||||
writer.WriteString(Name, 17);
|
||||
writer.WriteStrings(WormNames, 17);
|
||||
writer.Write(CpuLevel);
|
||||
writer.Write(SoundBankName, 0x20);
|
||||
writer.WriteString(SoundBankName, 0x20);
|
||||
writer.Write(SoundBankLocation);
|
||||
writer.Write(FanfareName, 0x20);
|
||||
writer.WriteString(FanfareName, 0x20);
|
||||
writer.Write(UseCustomFanfare);
|
||||
|
||||
writer.Write(GraveSprite);
|
||||
if (GraveSprite < 0)
|
||||
{
|
||||
writer.Write(GraveFileName, 0x20);
|
||||
writer.Write(Grave.Palette);
|
||||
writer.WriteString(GraveFileName, 0x20);
|
||||
writer.WriteStructs(Grave.Palette);
|
||||
writer.Write(Grave.Data);
|
||||
}
|
||||
|
||||
@ -286,10 +286,10 @@ namespace Syroot.Worms.Armageddon
|
||||
writer.Write(DeathmatchKills);
|
||||
writer.Write(Deaths);
|
||||
writer.Write(DeathmatchDeaths);
|
||||
writer.Write(MissionStatuses);
|
||||
writer.WriteStructs(MissionStatuses);
|
||||
|
||||
writer.Write(FlagFileName, 0x20);
|
||||
writer.Write(Flag.Palette);
|
||||
writer.WriteString(FlagFileName, 0x20);
|
||||
writer.WriteStructs(Flag.Palette);
|
||||
writer.Write(Flag.Data);
|
||||
|
||||
writer.Write(DeathmatchRank);
|
||||
|
Loading…
x
Reference in New Issue
Block a user