diff --git a/Engines/FlatRedBallXNA/FlatRedBall/Content/ContentLoaders/TextureContentLoader.cs b/Engines/FlatRedBallXNA/FlatRedBall/Content/ContentLoaders/TextureContentLoader.cs index 6455afe8c..795d24912 100644 --- a/Engines/FlatRedBallXNA/FlatRedBall/Content/ContentLoaders/TextureContentLoader.cs +++ b/Engines/FlatRedBallXNA/FlatRedBall/Content/ContentLoaders/TextureContentLoader.cs @@ -237,7 +237,7 @@ public static Texture2D MakePremultiplied(Texture2D file) #if MONOGAME premultSpriteBatch.Begin(SpriteSortMode.Immediate, blendColor, samplerState: SamplerState.PointClamp); #else - spriteBatch.Begin(SpriteSortMode.Immediate, blendColor, SamplerState.PointClamp, null, null); + premultSpriteBatch.Begin(SpriteSortMode.Immediate, blendColor, SamplerState.PointClamp, null, null); #endif premultSpriteBatch.Draw(file, position, Color.White); premultSpriteBatch.End(); @@ -255,7 +255,7 @@ public static Texture2D MakePremultiplied(Texture2D file) #if MONOGAME premultSpriteBatch.Begin(SpriteSortMode.Immediate, blendAlpha, samplerState: SamplerState.PointClamp); #else - spriteBatch.Begin(SpriteSortMode.Immediate, blendAlpha, SamplerState.PointClamp, null, null); + premultSpriteBatch.Begin(SpriteSortMode.Immediate, blendAlpha, SamplerState.PointClamp, null, null); #endif premultSpriteBatch.Draw(file, position, Color.White); premultSpriteBatch.End(); diff --git a/Engines/FlatRedBallXNA/FlatRedBall/Utilities/StringFunctions.cs b/Engines/FlatRedBallXNA/FlatRedBall/Utilities/StringFunctions.cs index 3c1c20aaf..ca8b0e991 100644 --- a/Engines/FlatRedBallXNA/FlatRedBall/Utilities/StringFunctions.cs +++ b/Engines/FlatRedBallXNA/FlatRedBall/Utilities/StringFunctions.cs @@ -776,12 +776,18 @@ public static void MakeNameUnique(T nameable, IList list) } } + /// + /// Adds or increments the number at the end of the nameable's Name until it is unique in the list. + /// + /// Nameable type + /// The nameable instance + /// The list of other nameables. public static void MakeNameUnique(T nameable, IEnumerable list) where T : INameable { var count = list.Count(); - for (int i = 0; i < list.Count(); i++) + for (int i = 0; i < count; i++) { var atI = list.ElementAt(i);