|
|
@ -211,6 +211,7 @@ public class UiGeometry { |
|
|
|
public static Vector2i MIN_WINDOW_SIZE = new(1024, 768); |
|
|
|
|
|
|
|
public readonly Vector2i WindowSize; |
|
|
|
public readonly Vector2i ThumbnailSize; |
|
|
|
public readonly Box2i ThumbnailBox; |
|
|
|
public readonly List<Box2i> ThumbnailBoxes = new(); |
|
|
|
public readonly List<Box2i> StarBoxes = new(); |
|
|
@ -225,8 +226,9 @@ public class UiGeometry { |
|
|
|
int numThumbnails = Math.Max(WindowSize.Y / 100, 1); |
|
|
|
int thumbnailHeight = WindowSize.Y / numThumbnails; |
|
|
|
int thumbnailWidth = (int) (1.0 * thumbnailHeight * CameraInfo.AspectRatio); |
|
|
|
ThumbnailSize = new(thumbnailWidth, thumbnailHeight); |
|
|
|
|
|
|
|
Console.WriteLine($"thumbnail size: {thumbnailWidth} x {thumbnailHeight}"); |
|
|
|
Console.WriteLine($"thumbnail size: {thumbnailWidth}x{thumbnailHeight}"); |
|
|
|
for (int i = 0; i < numThumbnails; i++) { |
|
|
|
Box2i box = Util.MakeBox(WindowSize.X - thumbnailWidth, i * thumbnailHeight, |
|
|
|
thumbnailWidth, thumbnailHeight); |
|
|
@ -352,6 +354,7 @@ public class Game : GameWindow { |
|
|
|
public Game(GameWindowSettings gwSettings, NativeWindowSettings nwSettings) : |
|
|
|
base(gwSettings, nwSettings) { |
|
|
|
activeTool = viewTool; |
|
|
|
geometry = new UiGeometry(nwSettings.Size, STAR_FILLED.Size.X); |
|
|
|
} |
|
|
|
|
|
|
|
private static string outputRoot = @"c:\users\colin\desktop\totte-output"; |
|
|
@ -363,7 +366,7 @@ public class Game : GameWindow { |
|
|
|
private static Texture STAR_EMPTY = Util.RenderStar(20, false); |
|
|
|
private static Texture STAR_SMALL = Util.RenderStar(6, true); |
|
|
|
|
|
|
|
UiGeometry geometry = new(); |
|
|
|
UiGeometry geometry; |
|
|
|
FpsCounter fpsCounter = new(); |
|
|
|
|
|
|
|
// Four points, each consisting of (x, y, z, tex_x, tex_y).
|
|
|
@ -717,13 +720,13 @@ public class Game : GameWindow { |
|
|
|
} |
|
|
|
} |
|
|
|
foreach (Photo p in toLoad) { |
|
|
|
await Task.Run( () => { p.LoadAsync(); }); |
|
|
|
await Task.Run( () => { p.LoadAsync(geometry.PhotoBox.Size); }); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private async void LoadThumbnailsAsync() { |
|
|
|
foreach (Photo p in allPhotos) { |
|
|
|
await Task.Run( () => { p.LoadThumbnailAsync(); }); |
|
|
|
await Task.Run( () => { p.LoadThumbnailAsync(geometry.ThumbnailSize); }); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
@ -799,7 +802,7 @@ public class Game : GameWindow { |
|
|
|
} |
|
|
|
Photo photo = photos[ribbonIndex + i]; |
|
|
|
Box2i box = geometry.ThumbnailBoxes[i]; |
|
|
|
DrawTexture(photo.Texture(), box); |
|
|
|
DrawTexture(photo.ThumbnailTexture(), box); |
|
|
|
for (int j = 0; j < photo.Rating; j++) { |
|
|
|
DrawTexture(STAR_SMALL, box.Min.X + 8 + ((STAR_SMALL.Size.X + 2) * j), box.Min.Y + 8); |
|
|
|
} |
|
|
|