From e03d880e021dc7f325d3f367a2a56dca442d7dd9 Mon Sep 17 00:00:00 2001 From: Kurt Date: Sun, 14 Jun 2015 23:43:03 -0700 Subject: [PATCH] Remove unnecessary casts --- pk3DS/Util.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pk3DS/Util.cs b/pk3DS/Util.cs index fc28851..98ef711 100644 --- a/pk3DS/Util.cs +++ b/pk3DS/Util.cs @@ -21,7 +21,7 @@ internal static Bitmap LayerImage(Image baseLayer, Image overLayer, int x, int y { Color newColor = overlayImage.GetPixel(i % (overlayImage.Width), i / (overlayImage.Width)); Color oldColor = newImage.GetPixel(i % (overlayImage.Width) + x, i / (overlayImage.Width) + y); - newColor = Color.FromArgb((int)((double)(newColor.A) * trans), newColor.R, newColor.G, newColor.B); // Apply transparency change + newColor = Color.FromArgb((int)(newColor.A * trans), newColor.R, newColor.G, newColor.B); // Apply transparency change // if (newColor.A != 0) // If Pixel isn't transparent, we'll overwrite the color. { // if (newColor.A < 100) @@ -312,19 +312,19 @@ internal static DialogResult Error(params string[] lines) { System.Media.SystemSounds.Exclamation.Play(); string msg = String.Join(Environment.NewLine + Environment.NewLine, lines); - return (DialogResult)MessageBox.Show(msg, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); + return MessageBox.Show(msg, "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); } internal static DialogResult Alert(params string[] lines) { System.Media.SystemSounds.Asterisk.Play(); string msg = String.Join(Environment.NewLine + Environment.NewLine, lines); - return (DialogResult)MessageBox.Show(msg, "Alert", MessageBoxButtons.OK, MessageBoxIcon.Warning); + return MessageBox.Show(msg, "Alert", MessageBoxButtons.OK, MessageBoxIcon.Warning); } internal static DialogResult Prompt(MessageBoxButtons btn, params string[] lines) { System.Media.SystemSounds.Question.Play(); string msg = String.Join(Environment.NewLine + Environment.NewLine, lines); - return (DialogResult)MessageBox.Show(msg, "Prompt", btn, MessageBoxIcon.Asterisk); + return MessageBox.Show(msg, "Prompt", btn, MessageBoxIcon.Asterisk); } // DataSource Providing