]> git.nega.tv - josh/narcissus/commitdiff
shark: Turn up the difficulty
authorJosh Simmons <josh@nega.tv>
Mon, 20 May 2024 21:41:57 +0000 (23:41 +0200)
committerJosh Simmons <josh@nega.tv>
Mon, 20 May 2024 21:41:57 +0000 (23:41 +0200)
title/shark-shaders/shaders/primitive_2d_constants.h
title/shark/src/main.rs

index a4fb13f23a28b3df020639d798befda7e2ee8f62..5830e6fbe9777f09116347769cb0139c52e2a4f3 100644 (file)
@@ -1,4 +1,4 @@
-#define MAX_PRIMS 0x8000u
+#define MAX_PRIMS 0x10000u
 #define TILE_SIZE 16
 #define TILE_STRIDE (MAX_PRIMS / 32u)
 #define MAX_TILES_X 180
index a5190923e30c527b28b2390abf96b0194a996e3e..a3f68fda7709c7e5199e3a6b78bb1ad7e3454739 100644 (file)
@@ -873,7 +873,7 @@ impl<'gpu> DrawState<'gpu> {
         let models = Models::load(gpu);
         let images = Images::load(gpu, thread_token);
 
-        const MAX_PRIMS: usize = 0x8000;
+        const MAX_PRIMS: usize = 0x10000;
         const TILE_STRIDE: usize = MAX_PRIMS / 32;
         const MAX_TILES_X: usize = 180;
         const MAX_TILES_Y: usize = 113;
@@ -1639,19 +1639,29 @@ pub fn main() {
                 let i = i as f32;
                 ui_state.text_fmt(
                     5.0,
-                    i * 20.0,
+                    i * 15.0 * scale,
                     FontFamily::RobotoRegular,
                     40.0,
                     format_args!("tick: {:?}", tick_duration),
                 );
+            }
 
-                ui_state.text_fmt(
-                    200.0,
-                    i * 20.0,
-                    FontFamily::NotoSansJapanese,
-                    40.0,
-                    format_args!("お握り The Quick Brown Fox Jumped Over The Lazy Dog. ████████"),
-                );
+            for i in 0..80 {
+                for j in 0..11 {
+                    let i = i as f32;
+                    let j = j as f32;
+                    let x = 200.0 + j * 200.0;
+                    let y = 100.0 + j * 100.0;
+                    ui_state.text_fmt(
+                        x * scale,
+                        (y + i * 15.0) * scale,
+                        FontFamily::NotoSansJapanese,
+                        15.0,
+                        format_args!(
+                            "お握り The Quick Brown Fox Jumped Over The Lazy Dog. ████████"
+                        ),
+                    );
+                }
             }
 
             draw_state.draw(