Skip to content

Commit

Permalink
MainForm - Format code segments
Browse files Browse the repository at this point in the history
  • Loading branch information
NessieHax committed Jul 14, 2024
1 parent 978c136 commit 2dcc2c8
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions PCK-Studio/MainForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ private void HandleColourFile(PckAsset asset)
{
using COLEditor diag = new COLEditor(asset);
wasModified = diag.ShowDialog(this) == DialogResult.OK;
}
}

public void HandleSkinFile(PckAsset asset)
{
Expand Down Expand Up @@ -1687,8 +1687,10 @@ public bool CreateDataFolder()
if (!HasDataFolder())
{
DialogResult result = MessageBox.Show(this, "There is not a \"Data\" folder present in the pack folder. Would you like to create one?", "Folder missing", MessageBoxButtons.YesNo);
if (result == DialogResult.No) return false;
else Directory.CreateDirectory(GetDataPath());
if (result == DialogResult.No)
return false;
else
Directory.CreateDirectory(GetDataPath());
}
return true;
}
Expand Down Expand Up @@ -1926,7 +1928,7 @@ private void CheckSaveState()
{
if (currentPCK is not null &&
wasModified &&
MessageBox.Show(this, "Save PCK?", "Unsaved PCK", MessageBoxButtons.YesNo, MessageBoxIcon.Warning) == DialogResult.Yes)
MessageBox.Show(this, "Save PCK?", "Unsaved PCK", MessageBoxButtons.YesNo, MessageBoxIcon.Warning, MessageBoxDefaultButton.Button1) == DialogResult.Yes)
{
if (isTemplateFile || string.IsNullOrEmpty(saveLocation))
{
Expand Down Expand Up @@ -2125,13 +2127,12 @@ private void generateMipMapTextureToolStripMenuItem_Click(object sender, EventAr
currentPCK.RemoveAsset(currentPCK.GetAsset(mippedPath, PckAssetType.TextureFile));
PckAsset mipMappedAsset = new PckAsset(mippedPath, PckAssetType.TextureFile);


Image originalTexture = asset.GetTexture();
int NewWidth = Math.Max(originalTexture.Width / (int)Math.Pow(2, i - 1), 1);
int NewHeight = Math.Max(originalTexture.Height / (int)Math.Pow(2, i - 1), 1);
int newWidth = Math.Max(originalTexture.Width / (int)Math.Pow(2, i - 1), 1);
int newHeight = Math.Max(originalTexture.Height / (int)Math.Pow(2, i - 1), 1);

Rectangle tileArea = new Rectangle(0, 0, NewWidth, NewHeight);
Image mippedTexture = new Bitmap(NewWidth, NewHeight);
Rectangle tileArea = new Rectangle(0, 0, newWidth, newHeight);
Image mippedTexture = new Bitmap(newWidth, newHeight);
using (Graphics gfx = Graphics.FromImage(mippedTexture))
{
gfx.SmoothingMode = SmoothingMode.None;
Expand Down

0 comments on commit 2dcc2c8

Please sign in to comment.