clean up TEXTURE_WHITE initialization & thumbnail geometry

This commit is contained in:
Colin McMillen 2023-07-08 00:04:45 -04:00
parent ec2989a9b0
commit 5194fec400

View File

@ -198,10 +198,10 @@ public class UiGeometry {
public UiGeometry(Vector2i windowSize) {
WindowSize = windowSize;
int thumbnailHeight = 150;
int numThumbnails = 12;
int thumbnailHeight = WindowSize.Y / numThumbnails;
int thumbnailWidth = (int) 1.0 * thumbnailHeight * activeCamera.Resolution.X / activeCamera.Resolution.Y;
int numBoxes = 10; // FIXME
for (int i = 0; i < numBoxes; i++) {
for (int i = 0; i < numThumbnails; i++) {
Box2i box = Util.makeBox(WindowSize.X - thumbnailWidth, i * thumbnailHeight, thumbnailWidth, thumbnailHeight);
ThumbnailBoxes.Add(box);
}
@ -219,8 +219,7 @@ public static class Util {
public class Game : GameWindow {
public Game(GameWindowSettings gwSettings, NativeWindowSettings nwSettings) : base(gwSettings, nwSettings) { }
private static Image<Rgba32> white1x1 = new(1, 1, new Rgba32(255, 255, 255));
private static Texture TEXTURE_WHITE = new Texture(white1x1);
private static Texture TEXTURE_WHITE = new Texture(new Image<Rgba32>(1, 1, new Rgba32(255, 255, 255)));
UiGeometry geometry = new();