]> git.xolatile.top Git - xolatile-raylib-ada.git/commitdiff
Generation example and rescaling...
authorxolatile <xolatile@proton.me>
Tue, 23 Apr 2024 16:32:00 +0000 (12:32 -0400)
committerxolatile <xolatile@proton.me>
Tue, 23 Apr 2024 16:32:00 +0000 (12:32 -0400)
15 files changed:
.gitignore
compile.sh
example/generation.adb
example/preview.adb
example/resource/ARCHERY.png
example/resource/BARRACKS.png
example/resource/BLACKSMITH.png
example/resource/CASTLE.png
example/resource/HOUSE_1.png
example/resource/HOUSE_2.png
example/resource/HOUSE_3.png
example/resource/STABLE.png
example/resource/TREE_1.png
example/resource/TREE_2.png
example/resource/TREE_3.png

index 0da3e994e1eefc7706196d6a95895aac49fd50bf..658fd5eb71abde6e08e27140ebf65b8f03080fbd 100644 (file)
@@ -2,3 +2,4 @@
 *.ali
 window
 preview
+generation
index e130bef86b7e6fac1412017ccef6b18ff1c7d439..30f58b79dce6b3ecbb90bc7878fae9cf13e12fb3 100644 (file)
@@ -18,6 +18,6 @@ gnatlink generation.ali -lraylib
 
 mv window ../window
 mv preview ../preview
-mv preview ../generation
+mv generation ../generation
 
 exit
index a3ed893e0058be618ff42439d3f79196e3eb2143..0c36181f5ec91442f38319dbab6aa06764289463 100644 (file)
@@ -1,7 +1,7 @@
 with Raylib;
 use  Raylib;
 
-procedure Preview is
+procedure Generation is
 
    type Texture_Index is (
       Archery,
@@ -23,29 +23,43 @@ procedure Preview is
 begin
    Open_Window (1280, 720, "Pandemos Empire" & ASCII.NUL);
    --
-   for I in Texture_Index
-   loop
+   Set_Exit_Key (Key_Q);
+   Set_Target_FPS (1);
+   --
+   for I in Texture_Index loop
       Texture_Array (I) := Load_Texture ("./example/resource/"
                                         & Texture_Index'Image (I)
                                         & ".png"
                                         & ASCII.NUL);
    end loop;
    --
-   until Window_Should_Close
-   loop
+   loop exit when Window_Should_Close;
       Begin_Drawing;
-      for Y in 0 .. Get_Screen_Height / Terrain.Height - 2
-         for X in 0 .. Get_Screen_Width / Terrain.Width - 2
+      --
+      for Y in 0 .. Get_Screen_Height / Texture_Array (Terrain).Height loop
+         for X in 0 .. Get_Screen_Width / Texture_Array (Terrain).Width loop
             Draw_Texture (Data => Texture_Array (Terrain),
-                          X    => X * Terrain.Width,
-                          Y    => Y * Terrain.Height);
+                          X    => X * Texture_Array (Terrain).Width,
+                          Y    => Y * Texture_Array (Terrain).Height);
+         end loop;
+      end loop;
+      --
+      for Building in Archery .. Stable loop
+         Draw_Texture (Data => Texture_Array (Building),
+                       X    => Get_Random_Value(0, Get_Screen_Width),
+                       Y    => Get_Random_Value(0, Get_Screen_Height));
+      end loop;
+      --
+      Draw_Texture (Texture_Array (Tree_1));
+      Draw_Texture (Texture_Array (Tree_2), 640, 360);
+      Draw_Texture (Texture_Array (Tree_3), 960, 360);
+      --
       End_Drawing;
    end loop;
    --
-   for I in Texture_Index
-   loop
+   for I in Texture_Index loop
       Unload_Texture (Texture_Array (I));
    end loop;
    --
    Close_Window;
-end Preview;
+end Generation;
index 0713ad063f590e5cb8cacf20cf3dd9f3a2e304ad..c02e75cc318a0286c1972ddea380212a0eca1afe 100644 (file)
@@ -15,7 +15,7 @@ begin
       Begin_Drawing;
       Draw_Texture (Map);
       End_Drawing;
-   end loop Main_Loop;
+   end loop;
    --
    Unload_Texture (Map);
    --
index 972a927d9a3d19275ded9d9e8817f4b32d693da7..9c9cbbe758867d5903e9bef136763f01cd72bd21 100644 (file)
Binary files a/example/resource/ARCHERY.png and b/example/resource/ARCHERY.png differ
index 12ff6487730c83223e377df895f4ed87fe1e0b7c..a804a3cfa483dbe9bb44b3ca3cf296dd4e92ae6b 100644 (file)
Binary files a/example/resource/BARRACKS.png and b/example/resource/BARRACKS.png differ
index fb35fb7b62e7e54226f6df30374ca641cc56907a..cdec86db7276a6d3775c0da582689ab84b44fb23 100644 (file)
Binary files a/example/resource/BLACKSMITH.png and b/example/resource/BLACKSMITH.png differ
index 2ea7ceab2969820f7d72240acbc113076586de81..3c0d6701456f004a7ca805fdb7e7f00837e0d395 100644 (file)
Binary files a/example/resource/CASTLE.png and b/example/resource/CASTLE.png differ
index 78ee6b2ac6c622abc9e57595de6915ab99491653..435834547588e14a7b8ee5dfaa855c24a1f3d124 100644 (file)
Binary files a/example/resource/HOUSE_1.png and b/example/resource/HOUSE_1.png differ
index 51ec6f945250912214efdb6a5d95ef485a76268d..5832acdad6516a0902a81e72c8ab3baefd2d3f39 100644 (file)
Binary files a/example/resource/HOUSE_2.png and b/example/resource/HOUSE_2.png differ
index 2cf238b5594e94de5af2361630e4cf7b85b91a5a..19a51e57b8686391c26751837848fc5abbde953c 100644 (file)
Binary files a/example/resource/HOUSE_3.png and b/example/resource/HOUSE_3.png differ
index 74c18730f4a6bedc8f541091ed0f325863564267..831bf01d9563b78aac12e359abb6ec721c655549 100644 (file)
Binary files a/example/resource/STABLE.png and b/example/resource/STABLE.png differ
index 545577fc07683f7e577ff01f51b5818df7495780..629ac1c8e015ac861eb244f0a156b2a273a60bb4 100644 (file)
Binary files a/example/resource/TREE_1.png and b/example/resource/TREE_1.png differ
index b42099c1e2aa262551456ba6ceca000d5eec245c..29d2adbe57074520dcf3a64a8d443224e11e36dc 100644 (file)
Binary files a/example/resource/TREE_2.png and b/example/resource/TREE_2.png differ
index 41206a5641746ebfdca05f0003ba21b6e60cb015..a4311447bd6be3b076ba0ad62365183ddf77581c 100644 (file)
Binary files a/example/resource/TREE_3.png and b/example/resource/TREE_3.png differ