mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2024-11-23 12:22:35 +00:00
Fixed sprite offsets (for PNGs we just use zero offset)
This commit is contained in:
parent
cb5a6234cc
commit
0cef612562
4 changed files with 13 additions and 6 deletions
|
@ -113,6 +113,13 @@ namespace CodeImp.DoomBuilder.Data
|
|||
height = bitmap.Size.Height;
|
||||
scaledwidth = (float)bitmap.Size.Width;
|
||||
scaledheight = (float)bitmap.Size.Height;
|
||||
|
||||
// Make offset corrections if the offset was not given
|
||||
if((offsetx == int.MinValue) || (offsety == int.MinValue))
|
||||
{
|
||||
offsetx = (int)(scaledwidth * 0.5f);
|
||||
offsety = (int)scaledheight;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -85,8 +85,8 @@ namespace CodeImp.DoomBuilder.IO
|
|||
// Returns null on failure
|
||||
public Bitmap ReadAsBitmap(Stream stream, out int offsetx, out int offsety)
|
||||
{
|
||||
offsetx = 0;
|
||||
offsety = 0;
|
||||
offsetx = int.MinValue;
|
||||
offsety = int.MinValue;
|
||||
return ReadAsBitmap(stream);
|
||||
}
|
||||
|
||||
|
|
|
@ -52,8 +52,8 @@ namespace CodeImp.DoomBuilder.IO
|
|||
// Returns null on failure
|
||||
public Bitmap ReadAsBitmap(Stream stream, out int offsetx, out int offsety)
|
||||
{
|
||||
offsetx = 0;
|
||||
offsety = 0;
|
||||
offsetx = int.MinValue;
|
||||
offsety = int.MinValue;
|
||||
return ReadAsBitmap(stream);
|
||||
}
|
||||
|
||||
|
|
|
@ -52,8 +52,8 @@ namespace CodeImp.DoomBuilder.IO
|
|||
// Returns null on failure
|
||||
public Bitmap ReadAsBitmap(Stream stream, out int offsetx, out int offsety)
|
||||
{
|
||||
offsetx = 0;
|
||||
offsety = 0;
|
||||
offsetx = int.MinValue;
|
||||
offsety = int.MinValue;
|
||||
return ReadAsBitmap(stream);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue