Resize width/height to fit proper 3ds texture limits
This commit is contained in:
parent
e3c1525cfe
commit
e39eec97cb
@ -389,6 +389,7 @@ namespace FirstPlugin
|
||||
else
|
||||
{
|
||||
settings.LoadBitMap(FileName);
|
||||
settings.Format = CTR_3DS.ConvertToPICAFormat(Format);
|
||||
importer.LoadSettings(new List<CTR_3DSImporterSettings>() { settings, });
|
||||
|
||||
if (importer.ShowDialog() == DialogResult.OK)
|
||||
|
@ -34,14 +34,27 @@ namespace Toolbox.Library.Forms
|
||||
public uint TexWidth
|
||||
{
|
||||
get { return _width; }
|
||||
set { _width = Pow2RoundDown(value); }
|
||||
set {
|
||||
//3DS Limitations
|
||||
_width = Pow2RoundDown(value);
|
||||
if (_width > 1024)
|
||||
_width = 1024;
|
||||
if (_width < 8)
|
||||
_width = 8;
|
||||
}
|
||||
}
|
||||
|
||||
private uint _height;
|
||||
public uint TexHeight
|
||||
{
|
||||
get { return _height; }
|
||||
set { _height = Pow2RoundDown(value); }
|
||||
set {
|
||||
_height = Pow2RoundDown(value);
|
||||
if (_height > 1024)
|
||||
_height = 1024;
|
||||
if (_height < 8)
|
||||
_height = 8;
|
||||
}
|
||||
}
|
||||
|
||||
public TEX_FORMAT GenericFormat
|
||||
|
@ -325,7 +325,6 @@ namespace Toolbox.Library
|
||||
}
|
||||
else if (PicaFormat == PICASurfaceFormat.A4)
|
||||
{
|
||||
//Todo this has issues
|
||||
byte A1 = (byte)(Input[IOffs + 3] >> 4);
|
||||
byte A2 = (byte)(Input[IOffs + 7] & 0xF0);
|
||||
writer.Write((byte)(A1 | A2));
|
||||
|
Loading…
Reference in New Issue
Block a user