mirror of
https://git.do.srb2.org/STJr/UltimateZoneBuilder.git
synced 2024-11-27 06:02:11 +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;
|
height = bitmap.Size.Height;
|
||||||
scaledwidth = (float)bitmap.Size.Width;
|
scaledwidth = (float)bitmap.Size.Width;
|
||||||
scaledheight = (float)bitmap.Size.Height;
|
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
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -85,8 +85,8 @@ namespace CodeImp.DoomBuilder.IO
|
||||||
// Returns null on failure
|
// Returns null on failure
|
||||||
public Bitmap ReadAsBitmap(Stream stream, out int offsetx, out int offsety)
|
public Bitmap ReadAsBitmap(Stream stream, out int offsetx, out int offsety)
|
||||||
{
|
{
|
||||||
offsetx = 0;
|
offsetx = int.MinValue;
|
||||||
offsety = 0;
|
offsety = int.MinValue;
|
||||||
return ReadAsBitmap(stream);
|
return ReadAsBitmap(stream);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -52,8 +52,8 @@ namespace CodeImp.DoomBuilder.IO
|
||||||
// Returns null on failure
|
// Returns null on failure
|
||||||
public Bitmap ReadAsBitmap(Stream stream, out int offsetx, out int offsety)
|
public Bitmap ReadAsBitmap(Stream stream, out int offsetx, out int offsety)
|
||||||
{
|
{
|
||||||
offsetx = 0;
|
offsetx = int.MinValue;
|
||||||
offsety = 0;
|
offsety = int.MinValue;
|
||||||
return ReadAsBitmap(stream);
|
return ReadAsBitmap(stream);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -52,8 +52,8 @@ namespace CodeImp.DoomBuilder.IO
|
||||||
// Returns null on failure
|
// Returns null on failure
|
||||||
public Bitmap ReadAsBitmap(Stream stream, out int offsetx, out int offsety)
|
public Bitmap ReadAsBitmap(Stream stream, out int offsetx, out int offsety)
|
||||||
{
|
{
|
||||||
offsetx = 0;
|
offsetx = int.MinValue;
|
||||||
offsety = 0;
|
offsety = int.MinValue;
|
||||||
return ReadAsBitmap(stream);
|
return ReadAsBitmap(stream);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue