From b3e3d3d11ad942b0e87fb8a3f9360b3268250da0 Mon Sep 17 00:00:00 2001 From: Colin McMillen Date: Sat, 8 Jul 2023 00:33:15 -0400 Subject: [PATCH] use fancy new type-inferring new() --- Program.cs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Program.cs b/Program.cs index e745111..cf88953 100644 --- a/Program.cs +++ b/Program.cs @@ -16,8 +16,8 @@ public class CameraInfo { Resolution = resolution; } - public static readonly CameraInfo NIKON_D7000 = new CameraInfo(new Vector2i(4928, 3264)); - public static readonly CameraInfo IPHONE_12_MINI = new CameraInfo(new Vector2i(4032, 3024)); + public static readonly CameraInfo NIKON_D7000 = new(new Vector2i(4928, 3264)); + public static readonly CameraInfo IPHONE_12_MINI = new(new Vector2i(4032, 3024)); } public class Shader : IDisposable { @@ -186,7 +186,7 @@ public class Texture : IDisposable { } public class UiGeometry { - public static Vector2i MIN_WINDOW_SIZE = new Vector2i(640, 480); + public static Vector2i MIN_WINDOW_SIZE = new(640, 480); private static CameraInfo activeCamera = CameraInfo.NIKON_D7000; public readonly Vector2i WindowSize; @@ -206,7 +206,7 @@ public class UiGeometry { ThumbnailBoxes.Add(box); } - PhotoBox = new(0, 0, WindowSize.X - thumbnailWidth, WindowSize.Y); + PhotoBox = new Box2i(0, 0, WindowSize.X - thumbnailWidth, WindowSize.Y); } } @@ -219,7 +219,7 @@ public static class Util { public class Game : GameWindow { public Game(GameWindowSettings gwSettings, NativeWindowSettings nwSettings) : base(gwSettings, nwSettings) {} - private static Texture TEXTURE_WHITE = new Texture(new Image(1, 1, new Rgba32(255, 255, 255))); + private static Texture TEXTURE_WHITE = new(new Image(1, 1, new Rgba32(255, 255, 255))); UiGeometry geometry = new(); @@ -237,7 +237,7 @@ public class Game : GameWindow { int VertexArrayObject; List textures = new(); int textureIndex = 0; - Shader shader = new Shader(); + Shader shader = new(); Matrix4 projection; protected override void OnUpdateFrame(FrameEventArgs e) { @@ -435,7 +435,7 @@ static class Program { nwSettings.Title = "Totte"; // FIXME: nwSettings.Icon = ... - using (Game game = new Game(gwSettings, nwSettings)) { + using (Game game = new(gwSettings, nwSettings)) { game.Run(); } }