From e98b19d87be36e2a91a2c64c63d18fa42430ce06 Mon Sep 17 00:00:00 2001 From: Colin McMillen Date: Wed, 26 Jul 2023 13:49:48 -0400 Subject: [PATCH] make DrawTexture(texture, x, y) function --- Program.cs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/Program.cs b/Program.cs index 4bcefae..424891c 100644 --- a/Program.cs +++ b/Program.cs @@ -798,7 +798,7 @@ public class Game : GameWindow { DrawTexture(active, photoBox); for (int i = 0; i < 5; i++) { Texture star = (activePhoto.Rating > i) ? STAR_FILLED : STAR_EMPTY; - DrawTexture(star, Util.MakeBox((star.Size.X + 10) * i + 10, 10, star.Size.X, star.Size.Y)); + DrawTexture(star, (star.Size.X + 10) * i + 10, 10); } // Draw thumbnail boxes. @@ -812,7 +812,7 @@ public class Game : GameWindow { Box2i box = geometry.ThumbnailBoxes[i]; DrawTexture(photo.Texture(), box); for (int j = 0; j < photo.Rating; j++) { - DrawTexture(STAR_SMALL, Util.MakeBox(box.Min.X + 8 + ((STAR_SMALL.Size.X + 2) * j), box.Min.Y + 8, STAR_SMALL.Size.X, STAR_SMALL.Size.Y)); + DrawTexture(STAR_SMALL, box.Min.X + 8 + ((STAR_SMALL.Size.X + 2) * j), box.Min.Y + 8); } if (ribbonIndex + i == photoIndex) { DrawBox(box, 5, Color4.Black); @@ -833,6 +833,10 @@ public class Game : GameWindow { SwapBuffers(); } + void DrawTexture(Texture texture, int x, int y) { + DrawTexture(texture, Util.MakeBox(x, y, texture.Size.X, texture.Size.Y)); + } + void DrawTexture(Texture texture, Box2i box) { DrawTexture(texture, box, Color4.White); } @@ -858,7 +862,7 @@ public class Game : GameWindow { void DrawText(string text, int x, int y) { Texture label = Util.RenderText(text); - DrawTexture(label, Util.MakeBox(x, y, label.Size.X, label.Size.Y)); + DrawTexture(label, x, y); label.Dispose(); }