Skip to content

Commit b9970a9

Browse files
committed
Change: Cleanup a little more cruft
1 parent b663412 commit b9970a9

File tree

6 files changed

+7
-21
lines changed

6 files changed

+7
-21
lines changed

source/ObjectViewer/InterfaceS.cs

-8
Original file line numberDiff line numberDiff line change
@@ -126,13 +126,5 @@ internal struct Options {
126126
// ================================
127127

128128
#pragma warning restore 0649
129-
130-
// round to power of two
131-
internal static int RoundToPowerOfTwo(int Value) {
132-
Value -= 1;
133-
for (int i = 1; i < sizeof(int) * 8; i *= 2) {
134-
Value = Value | Value >> i;
135-
} return Value + 1;
136-
}
137129
}
138130
}

source/ObjectViewer/ObjectManager.cs

+2-4
Original file line numberDiff line numberDiff line change
@@ -1893,8 +1893,7 @@ internal static UnifiedObject LoadObject(string FileName, Encoding Encoding, boo
18931893
{
18941894
while (true)
18951895
{
1896-
string f;
1897-
f = OpenBveApi.Path.CombineFile(System.IO.Path.GetDirectoryName(FileName), System.IO.Path.GetFileName(FileName) + ".x");
1896+
string f = OpenBveApi.Path.CombineFile(System.IO.Path.GetDirectoryName(FileName), System.IO.Path.GetFileName(FileName) + ".x");
18981897
if (System.IO.File.Exists(f))
18991898
{
19001899
FileName = f;
@@ -2010,8 +2009,7 @@ internal static StaticObject LoadStaticObject(string FileName, Encoding Encoding
20102009
{
20112010
while (true)
20122011
{
2013-
string f;
2014-
f = OpenBveApi.Path.CombineFile(System.IO.Path.GetDirectoryName(FileName), System.IO.Path.GetFileName(FileName) + ".x");
2012+
string f = OpenBveApi.Path.CombineFile(System.IO.Path.GetDirectoryName(FileName), System.IO.Path.GetFileName(FileName) + ".x");
20152013
if (System.IO.File.Exists(f))
20162014
{
20172015
FileName = f;

source/ObjectViewer/Parsers/CsvB3dObjectParser.cs

+1-3
Original file line numberDiff line numberDiff line change
@@ -206,10 +206,8 @@ private static int SecondIndexOfAny(string testString, string[] values)
206206
/// <summary>Loads a CSV or B3D object from a file.</summary>
207207
/// <param name="FileName">The text file to load the animated object from. Must be an absolute file name.</param>
208208
/// <param name="Encoding">The encoding the file is saved in. If the file uses a byte order mark, the encoding indicated by the byte order mark is used and the Encoding parameter is ignored.</param>
209-
/// <param name="ForceTextureRepeatX">Whether to force TextureWrapMode.Repeat for the X axis of the texture.</param>
210-
/// <param name="ForceTextureRepeatY">Whether to force TextureWrapMode.Repeat for the Y axis of the texture.</param>
211209
/// <returns>The object loaded.</returns>
212-
internal static ObjectManager.StaticObject ReadObject(string FileName, Encoding Encoding, bool ForceTextureRepeatX, bool ForceTextureRepeatY) {
210+
internal static ObjectManager.StaticObject ReadObject(string FileName, Encoding Encoding) {
213211
System.Globalization.CultureInfo Culture = System.Globalization.CultureInfo.InvariantCulture;
214212
bool IsB3D = string.Equals(System.IO.Path.GetExtension(FileName), ".b3d", StringComparison.OrdinalIgnoreCase);
215213
// initialize object

source/ObjectViewer/Parsers/Ls3DGrpParser.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@ internal static ObjectManager.AnimatedObjectCollection ReadObject(string FileNam
231231
}
232232
else if(CurrentObjects[i].Name.ToLowerInvariant().EndsWith(".l3dobj"))
233233
{
234-
Object = (ObjectManager.StaticObject)ObjectManager.LoadObject(CurrentObjects[i].Name, Encoding, false, false, false, CurrentObjects[i].Rotation);
234+
Object = (ObjectManager.StaticObject)ObjectManager.LoadObject(CurrentObjects[i].Name, Encoding, false, CurrentObjects[i].Rotation);
235235
}
236236
else
237237
{

source/ObjectViewer/RendererS.cs

+2-4
Original file line numberDiff line numberDiff line change
@@ -857,8 +857,7 @@ private static void RenderOverlays()
857857
{
858858
if (ObjectManager.ObjectsUsed == 0 & ObjectManager.AnimatedWorldObjectsUsed == 0)
859859
{
860-
string[][] Keys;
861-
Keys = new string[][] { new string[] { "F7" }, new string[] { "F8" }, new string[] { "F10" } };
860+
string[][] Keys = { new string[] { "F7" }, new string[] { "F8" }, new string[] { "F10" } };
862861
RenderKeys(4.0, 4.0, 20.0, Keys);
863862
DrawString(Fonts.SmallFont, "Open one or more objects", new Point(32,4),TextAlignment.TopLeft, TextColor);
864863
DrawString(Fonts.SmallFont, "Display the options window", new Point(32,24),TextAlignment.TopLeft, TextColor);
@@ -868,8 +867,7 @@ private static void RenderOverlays()
868867
else
869868
{
870869
DrawString(Fonts.SmallFont, "Position: " + World.AbsoluteCameraPosition.X.ToString("0.00", Culture) + ", " + World.AbsoluteCameraPosition.Y.ToString("0.00", Culture) + ", " + World.AbsoluteCameraPosition.Z.ToString("0.00", Culture), new Point((int)(0.5 * ScreenWidth -88),4),TextAlignment.TopLeft, TextColor);
871-
string[][] Keys;
872-
Keys = new string[][] { new string[] { "F5" }, new string[] { "F7" }, new string[] { "del" }, new string[] { "F8" }, new string[] { "F10" } };
870+
string[][] Keys = { new string[] { "F5" }, new string[] { "F7" }, new string[] { "del" }, new string[] { "F8" }, new string[] { "F10" } };
873871
RenderKeys(4.0, 4.0, 24.0, Keys);
874872
DrawString(Fonts.SmallFont, "Reload the currently open objects", new Point(32,4),TextAlignment.TopLeft, TextColor);
875873
DrawString(Fonts.SmallFont, "Open additional objects", new Point(32,24),TextAlignment.TopLeft, TextColor);

source/ObjectViewer/TextureManager.cs

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
using OpenTK.Graphics.OpenGL;
88
namespace OpenBve
99
{
10-
internal static partial class Textures
10+
internal static class Textures
1111
{
1212
/// <summary>Holds all currently registered textures.</summary>
1313
internal static Texture[] RegisteredTextures = new Texture[16];

0 commit comments

Comments
 (0)