ソースを参照

Generation example and rescaling...

master
コミット
2908bb46c6
15個のファイルの変更29行の追加14行の削除
  1. +1
    -0
      .gitignore
  2. +1
    -1
      compile.sh
  3. +26
    -12
      example/generation.adb
  4. +1
    -1
      example/preview.adb
  5. バイナリ
      example/resource/ARCHERY.png
  6. バイナリ
      example/resource/BARRACKS.png
  7. バイナリ
      example/resource/BLACKSMITH.png
  8. バイナリ
      example/resource/CASTLE.png
  9. バイナリ
      example/resource/HOUSE_1.png
  10. バイナリ
      example/resource/HOUSE_2.png
  11. バイナリ
      example/resource/HOUSE_3.png
  12. バイナリ
      example/resource/STABLE.png
  13. バイナリ
      example/resource/TREE_1.png
  14. バイナリ
      example/resource/TREE_2.png
  15. バイナリ
      example/resource/TREE_3.png

+ 1
- 0
.gitignore ファイルの表示

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

+ 1
- 1
compile.sh ファイルの表示

@@ -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 ファイルの表示

@@ -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 ファイルの表示

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


バイナリ
example/resource/ARCHERY.png ファイルの表示

変更前 変更後
幅: 305  |  高さ: 222  |  サイズ: 119KB 幅: 153  |  高さ: 111  |  サイズ: 31KB

バイナリ
example/resource/BARRACKS.png ファイルの表示

変更前 変更後
幅: 315  |  高さ: 250  |  サイズ: 129KB 幅: 158  |  高さ: 125  |  サイズ: 34KB

バイナリ
example/resource/BLACKSMITH.png ファイルの表示

変更前 変更後
幅: 305  |  高さ: 259  |  サイズ: 132KB 幅: 153  |  高さ: 130  |  サイズ: 34KB

バイナリ
example/resource/CASTLE.png ファイルの表示

変更前 変更後
幅: 500  |  高さ: 422  |  サイズ: 377KB 幅: 250  |  高さ: 211  |  サイズ: 97KB

バイナリ
example/resource/HOUSE_1.png ファイルの表示

変更前 変更後
幅: 178  |  高さ: 141  |  サイズ: 50KB 幅: 89  |  高さ: 71  |  サイズ: 13KB

バイナリ
example/resource/HOUSE_2.png ファイルの表示

変更前 変更後
幅: 175  |  高さ: 140  |  サイズ: 49KB 幅: 88  |  高さ: 70  |  サイズ: 13KB

バイナリ
example/resource/HOUSE_3.png ファイルの表示

変更前 変更後
幅: 178  |  高さ: 137  |  サイズ: 51KB 幅: 89  |  高さ: 69  |  サイズ: 13KB

バイナリ
example/resource/STABLE.png ファイルの表示

変更前 変更後
幅: 318  |  高さ: 252  |  サイズ: 124KB 幅: 159  |  高さ: 126  |  サイズ: 33KB

バイナリ
example/resource/TREE_1.png ファイルの表示

変更前 変更後
幅: 384  |  高さ: 448  |  サイズ: 203KB 幅: 115  |  高さ: 134  |  サイズ: 21KB

バイナリ
example/resource/TREE_2.png ファイルの表示

変更前 変更後
幅: 320  |  高さ: 384  |  サイズ: 147KB 幅: 96  |  高さ: 115  |  サイズ: 15KB

バイナリ
example/resource/TREE_3.png ファイルの表示

変更前 変更後
幅: 384  |  高さ: 384  |  サイズ: 201KB 幅: 115  |  高さ: 115  |  サイズ: 21KB

読み込み中…
キャンセル
保存