mirror of
https://gitlab.com/Syroot/Worms.git
synced 2025-01-13 15:27:59 +03:00
Update repository
This commit is contained in:
parent
d57de03cf7
commit
f60a17bfca
@ -5,7 +5,7 @@ using Syroot.Worms.UnitTest.Common;
|
||||
namespace Syroot.Worms.UnitTest.Gen2
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents a collection of tests for the <see cref="Image"/> class.
|
||||
/// Represents a collection of tests for the <see cref="ImageData"/> class.
|
||||
/// </summary>
|
||||
[TestCategory("Gen2")]
|
||||
[TestClass]
|
||||
@ -19,7 +19,7 @@ namespace Syroot.Worms.UnitTest.Gen2
|
||||
[TestMethod]
|
||||
public void LoadImages()
|
||||
{
|
||||
TestHelpers.LoadFiles<Image>(Game.All, "*.img");
|
||||
TestHelpers.LoadFiles<ImageData>(Game.All, "*.img");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ namespace Syroot.Worms
|
||||
/// <summary>
|
||||
/// Represents a pixel-based 2D image in different color formats.
|
||||
/// </summary>
|
||||
public class ImageData
|
||||
public class BitmapData
|
||||
{
|
||||
// ---- PROPERTIES ---------------------------------------------------------------------------------------------
|
||||
|
@ -74,17 +74,17 @@ namespace Syroot.Worms.Gen2.Armageddon
|
||||
/// <summary>
|
||||
/// Gets or sets the visual foreground image.
|
||||
/// </summary>
|
||||
public Image Foreground { get; set; }
|
||||
public ImageData Foreground { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the collision mask of the landscape.
|
||||
/// </summary>
|
||||
public Image CollisionMask { get; set; }
|
||||
public ImageData CollisionMask { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the visual background image.
|
||||
/// </summary>
|
||||
public Image Background { get; set; }
|
||||
public ImageData Background { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the path to the land image file.
|
||||
@ -123,9 +123,9 @@ namespace Syroot.Worms.Gen2.Armageddon
|
||||
ObjectLocations = reader.ReadStructs<Vector2>(reader.ReadInt32());
|
||||
|
||||
// Read the image data.
|
||||
Foreground = reader.Load<Image>();
|
||||
CollisionMask = reader.Load<Image>();
|
||||
Background = reader.Load<Image>();
|
||||
Foreground = reader.Load<ImageData>();
|
||||
CollisionMask = reader.Load<ImageData>();
|
||||
Background = reader.Load<ImageData>();
|
||||
|
||||
// Read the file paths.
|
||||
LandTexturePath = reader.ReadString(BinaryStringFormat.ByteLengthPrefix);
|
||||
|
@ -81,7 +81,7 @@ namespace Syroot.Worms.Gen2.Armageddon
|
||||
/// <summary>
|
||||
/// Gets or sets the team grave bitmap if it uses a custom one.
|
||||
/// </summary>
|
||||
public ImageData Grave { get; set; }
|
||||
public BitmapData Grave { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the team's special weapon.
|
||||
@ -151,7 +151,7 @@ namespace Syroot.Worms.Gen2.Armageddon
|
||||
/// <summary>
|
||||
/// Gets or sets the bitmap of the team flag.
|
||||
/// </summary>
|
||||
public ImageData Flag { get; set; }
|
||||
public BitmapData Flag { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the deathmatch rank this team reached.
|
||||
@ -210,7 +210,7 @@ namespace Syroot.Worms.Gen2.Armageddon
|
||||
if (GraveSprite < 0)
|
||||
{
|
||||
GraveFileName = reader.ReadFixedString(0x20);
|
||||
Grave = new ImageData()
|
||||
Grave = new BitmapData()
|
||||
{
|
||||
BitsPerPixel = 8,
|
||||
Size = new Vector2(24, 32),
|
||||
@ -233,7 +233,7 @@ namespace Syroot.Worms.Gen2.Armageddon
|
||||
MissionStatuses = reader.ReadStructs<TeamMissionStatus>(_missionCount);
|
||||
|
||||
FlagFileName = reader.ReadFixedString(0x20);
|
||||
Flag = new ImageData()
|
||||
Flag = new BitmapData()
|
||||
{
|
||||
BitsPerPixel = 8,
|
||||
Size = new Vector2(20, 17),
|
||||
|
@ -11,7 +11,7 @@ namespace Syroot.Worms.Gen2
|
||||
/// Represents a (palettized) graphical image stored in an IMG file, possibly compressed.
|
||||
/// Used by W2, WA and WWP. S. https://worms2d.info/Image_file.
|
||||
/// </summary>
|
||||
public class Image : ImageData, ILoadableFile, ISaveableFile
|
||||
public class ImageData : BitmapData, ILoadableFile, ISaveableFile
|
||||
{
|
||||
// ---- CONSTANTS ----------------------------------------------------------------------------------------------
|
||||
|
||||
@ -20,38 +20,38 @@ namespace Syroot.Worms.Gen2
|
||||
// ---- CONSTRUCTORS & DESTRUCTOR ------------------------------------------------------------------------------
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Image"/> class.
|
||||
/// Initializes a new instance of the <see cref="ImageData"/> class.
|
||||
/// </summary>
|
||||
public Image()
|
||||
public ImageData()
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Image"/> class, loading the data from the given
|
||||
/// Initializes a new instance of the <see cref="ImageData"/> class, loading the data from the given
|
||||
/// <see cref="Stream"/>.
|
||||
/// </summary>
|
||||
/// <param name="stream">The <see cref="Stream"/> to load the data from.</param>
|
||||
public Image(Stream stream)
|
||||
public ImageData(Stream stream)
|
||||
{
|
||||
Load(stream);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Image"/> class, loading the data from the given file.
|
||||
/// Initializes a new instance of the <see cref="ImageData"/> class, loading the data from the given file.
|
||||
/// </summary>
|
||||
/// <param name="fileName">The name of the file to load the data from.</param>
|
||||
public Image(string fileName)
|
||||
public ImageData(string fileName)
|
||||
{
|
||||
Load(fileName);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="Image"/> class, loading the data from the given
|
||||
/// Initializes a new instance of the <see cref="ImageData"/> class, loading the data from the given
|
||||
/// <see cref="Stream"/>. The data block can be aligned to a 4-bte boundary.
|
||||
/// </summary>
|
||||
/// <param name="stream">The <see cref="Stream"/> to load the data from.</param>
|
||||
/// <param name="alignData"><c>true</c> to align the data array by 4 bytes.</param>
|
||||
internal Image(Stream stream, bool alignData)
|
||||
internal ImageData(Stream stream, bool alignData)
|
||||
{
|
||||
Load(stream, alignData);
|
||||
}
|
@ -70,17 +70,17 @@ namespace Syroot.Worms.Gen2.WorldParty
|
||||
/// <summary>
|
||||
/// Gets or sets the visual foreground image.
|
||||
/// </summary>
|
||||
public Image Foreground { get; set; }
|
||||
public ImageData Foreground { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the collision mask of the landscape.
|
||||
/// </summary>
|
||||
public Image CollisionMask { get; set; }
|
||||
public ImageData CollisionMask { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the visual background image.
|
||||
/// </summary>
|
||||
public Image Background { get; set; }
|
||||
public ImageData Background { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the path to the land image file.
|
||||
@ -118,9 +118,9 @@ namespace Syroot.Worms.Gen2.WorldParty
|
||||
ObjectLocations = reader.ReadStructs<Vector2>(reader.ReadInt32());
|
||||
|
||||
// Read the image data.
|
||||
Foreground = new Image(stream, true);
|
||||
CollisionMask = new Image(stream, true);
|
||||
Background = new Image(stream, true);
|
||||
Foreground = new ImageData(stream, true);
|
||||
CollisionMask = new ImageData(stream, true);
|
||||
Background = new ImageData(stream, true);
|
||||
|
||||
// Read the file paths.
|
||||
LandTexturePath = reader.ReadString(BinaryStringFormat.ByteLengthPrefix);
|
||||
|
@ -79,7 +79,7 @@ namespace Syroot.Worms.Gen2.WorldParty
|
||||
/// <summary>
|
||||
/// Gets or sets the team grave bitmap if it uses a custom one.
|
||||
/// </summary>
|
||||
public ImageData Grave { get; set; }
|
||||
public BitmapData Grave { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the team's special weapon.
|
||||
@ -149,7 +149,7 @@ namespace Syroot.Worms.Gen2.WorldParty
|
||||
/// <summary>
|
||||
/// Gets or sets the bitmap of the team flag.
|
||||
/// </summary>
|
||||
public ImageData Flag { get; set; }
|
||||
public BitmapData Flag { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets an unknown value.
|
||||
@ -209,7 +209,7 @@ namespace Syroot.Worms.Gen2.WorldParty
|
||||
if (GraveSprite < 0)
|
||||
{
|
||||
GraveFileName = reader.ReadFixedString(0x20);
|
||||
Grave = new ImageData()
|
||||
Grave = new BitmapData()
|
||||
{
|
||||
BitsPerPixel = 8,
|
||||
Size = new Vector2(24, 32),
|
||||
@ -232,7 +232,7 @@ namespace Syroot.Worms.Gen2.WorldParty
|
||||
MissionStatuses = reader.ReadStructs<TeamMissionStatus>(_missionCount);
|
||||
|
||||
FlagFileName = reader.ReadFixedString(0x20);
|
||||
Flag = new ImageData()
|
||||
Flag = new BitmapData()
|
||||
{
|
||||
BitsPerPixel = 8,
|
||||
Size = new Vector2(20, 17),
|
||||
|
@ -69,22 +69,22 @@ namespace Syroot.Worms.Gen2.Worms2
|
||||
/// <summary>
|
||||
/// Gets or sets the visual foreground image.
|
||||
/// </summary>
|
||||
public Image Foreground { get; set; }
|
||||
public ImageData Foreground { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the collision mask of the landscape.
|
||||
/// </summary>
|
||||
public Image CollisionMask { get; set; }
|
||||
public ImageData CollisionMask { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the visual background image.
|
||||
/// </summary>
|
||||
public Image Background { get; set; }
|
||||
public ImageData Background { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets an image of unknown use.
|
||||
/// </summary>
|
||||
public Image UnknownImage { get; set; }
|
||||
public ImageData UnknownImage { get; set; }
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets the path to the land image file.
|
||||
@ -122,10 +122,10 @@ namespace Syroot.Worms.Gen2.Worms2
|
||||
Unknown = reader.ReadInt32();
|
||||
|
||||
// Read the image data.
|
||||
Foreground = reader.Load<Image>();
|
||||
CollisionMask = reader.Load<Image>();
|
||||
Background = reader.Load<Image>();
|
||||
UnknownImage = reader.Load<Image>();
|
||||
Foreground = reader.Load<ImageData>();
|
||||
CollisionMask = reader.Load<ImageData>();
|
||||
Background = reader.Load<ImageData>();
|
||||
UnknownImage = reader.Load<ImageData>();
|
||||
|
||||
// Read the file paths.
|
||||
LandTexturePath = reader.ReadString(BinaryStringFormat.ByteLengthPrefix);
|
||||
|
@ -6,7 +6,7 @@
|
||||
<AssemblyName>Syroot.Worms</AssemblyName>
|
||||
<AssemblyTitle>Worms</AssemblyTitle>
|
||||
<Authors>Syroot</Authors>
|
||||
<VersionPrefix>1.0.0-alpha2</VersionPrefix>
|
||||
<VersionPrefix>1.0.0-alpha3</VersionPrefix>
|
||||
|
||||
<PackageId>Syroot.Worms</PackageId>
|
||||
<PackageTags>worms;team17</PackageTags>
|
||||
|
Loading…
x
Reference in New Issue
Block a user