Browse Source

Generation example and rescaling...

master
parent
commit
2908bb46c6
15 changed files with 29 additions and 14 deletions
  1. +1
    -0
      .gitignore
  2. +1
    -1
      compile.sh
  3. +26
    -12
      example/generation.adb
  4. +1
    -1
      example/preview.adb
  5. BIN
      example/resource/ARCHERY.png
  6. BIN
      example/resource/BARRACKS.png
  7. BIN
      example/resource/BLACKSMITH.png
  8. BIN
      example/resource/CASTLE.png
  9. BIN
      example/resource/HOUSE_1.png
  10. BIN
      example/resource/HOUSE_2.png
  11. BIN
      example/resource/HOUSE_3.png
  12. BIN
      example/resource/STABLE.png
  13. BIN
      example/resource/TREE_1.png
  14. BIN
      example/resource/TREE_2.png
  15. BIN
      example/resource/TREE_3.png

+ 1
- 0
.gitignore View File

@@ -2,3 +2,4 @@
*.ali
window
preview
generation

+ 1
- 1
compile.sh View File

@@ -18,6 +18,6 @@ gnatlink generation.ali -lraylib

mv window ../window
mv preview ../preview
mv preview ../generation
mv generation ../generation

exit

+ 26
- 12
example/generation.adb View 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;

+ 1
- 1
example/preview.adb View File

@@ -15,7 +15,7 @@ begin
Begin_Drawing;
Draw_Texture (Map);
End_Drawing;
end loop Main_Loop;
end loop;
--
Unload_Texture (Map);
--


BIN
example/resource/ARCHERY.png View File

Before After
Width: 305  |  Height: 222  |  Size: 119KB Width: 153  |  Height: 111  |  Size: 31KB

BIN
example/resource/BARRACKS.png View File

Before After
Width: 315  |  Height: 250  |  Size: 129KB Width: 158  |  Height: 125  |  Size: 34KB

BIN
example/resource/BLACKSMITH.png View File

Before After
Width: 305  |  Height: 259  |  Size: 132KB Width: 153  |  Height: 130  |  Size: 34KB

BIN
example/resource/CASTLE.png View File

Before After
Width: 500  |  Height: 422  |  Size: 377KB Width: 250  |  Height: 211  |  Size: 97KB

BIN
example/resource/HOUSE_1.png View File

Before After
Width: 178  |  Height: 141  |  Size: 50KB Width: 89  |  Height: 71  |  Size: 13KB

BIN
example/resource/HOUSE_2.png View File

Before After
Width: 175  |  Height: 140  |  Size: 49KB Width: 88  |  Height: 70  |  Size: 13KB

BIN
example/resource/HOUSE_3.png View File

Before After
Width: 178  |  Height: 137  |  Size: 51KB Width: 89  |  Height: 69  |  Size: 13KB

BIN
example/resource/STABLE.png View File

Before After
Width: 318  |  Height: 252  |  Size: 124KB Width: 159  |  Height: 126  |  Size: 33KB

BIN
example/resource/TREE_1.png View File

Before After
Width: 384  |  Height: 448  |  Size: 203KB Width: 115  |  Height: 134  |  Size: 21KB

BIN
example/resource/TREE_2.png View File

Before After
Width: 320  |  Height: 384  |  Size: 147KB Width: 96  |  Height: 115  |  Size: 15KB

BIN
example/resource/TREE_3.png View File

Before After
Width: 384  |  Height: 384  |  Size: 201KB Width: 115  |  Height: 115  |  Size: 21KB

Loading…
Cancel
Save