diff --git a/.gitignore b/.gitignore index 0a437a6..99a71d1 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ source/*.o source/*.ali xhads -song/* diff --git a/source/ai.adb b/source/ai.adb index c1da1b9..9d108c4 100644 --- a/source/ai.adb +++ b/source/ai.adb @@ -4,8 +4,6 @@ with core, ui, ai; -use ai; - package body ai is ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ diff --git a/source/attribute.adb b/source/attribute.adb index 751e8aa..071ee5b 100644 --- a/source/attribute.adb +++ b/source/attribute.adb @@ -4,8 +4,6 @@ with core, ui, attribute; -use attribute; - package body attribute is ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ diff --git a/source/chad.adb b/source/chad.adb index 7779e17..067b2b2 100644 --- a/source/chad.adb +++ b/source/chad.adb @@ -4,8 +4,6 @@ with core, ui, faction, chad; -use chad; - package body chad is ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ diff --git a/source/construction.adb b/source/construction.adb index d24a9c7..f08384a 100644 --- a/source/construction.adb +++ b/source/construction.adb @@ -4,8 +4,6 @@ with core, effect, resource, faction, construction; -use construction; - package body construction is ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ diff --git a/source/core.adb b/source/core.adb index 243b332..2a221d8 100644 --- a/source/core.adb +++ b/source/core.adb @@ -4,8 +4,6 @@ with core; -use core; - package body core is ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ @@ -85,6 +83,18 @@ package body core is procedure pause_sound (data : sound) with import => true, convention => c, external_name => "PauseSound"; procedure resume_sound (data : sound) with import => true, convention => c, external_name => "ResumeSound"; + procedure megadraw ( + data : texture; + uv : rectangle; + view : rectangle; + origin : vessel; + rotate : float; + tint : color + ) with + import => true, + convention => c, + external_name => "DrawTexturePro"; + ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ texture_count : integer := 0; @@ -482,6 +492,12 @@ package body core is uv => (float (u), float (v), float (width), float (height)), view => (float (x), float (y)), tint => (255, 255, 255, 255)); + --~megadraw (data => texture_array (sprite), + --~uv => (float (u), float (v), float (width), float (height)), + --~view => (0.0, 0.0, float (x), float (y)), + --~origin => (0.0, 0.0), + --~rotate => 0.0, + --~tint => (255, 255, 255, 255)); end render_sprite; ------------------------------------------------------------------------------------------ diff --git a/source/deity.adb b/source/deity.adb index 9899e15..70d955f 100644 --- a/source/deity.adb +++ b/source/deity.adb @@ -4,8 +4,6 @@ with core, deity; -use deity; - package body deity is ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ diff --git a/source/effect.adb b/source/effect.adb index 8302514..ab93b4e 100644 --- a/source/effect.adb +++ b/source/effect.adb @@ -4,8 +4,6 @@ with core, effect; -use effect; - package body effect is ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ diff --git a/source/faction.adb b/source/faction.adb index 5e23585..c8ba118 100644 --- a/source/faction.adb +++ b/source/faction.adb @@ -4,8 +4,6 @@ with core, attribute, skill, resource, faction; -use faction; - package body faction is ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ diff --git a/source/item.adb b/source/item.adb index 54fd68a..63e6cf0 100644 --- a/source/item.adb +++ b/source/item.adb @@ -4,8 +4,6 @@ with core, item; -use item; - package body item is ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ diff --git a/source/magic.adb b/source/magic.adb index c170aed..9029016 100644 --- a/source/magic.adb +++ b/source/magic.adb @@ -4,8 +4,6 @@ with core, ui, effect, magic; -use magic; - package body magic is ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ diff --git a/source/might.adb b/source/might.adb index c75adbc..b403309 100644 --- a/source/might.adb +++ b/source/might.adb @@ -4,8 +4,6 @@ with core, ui, effect, might; -use might; - package body might is ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ diff --git a/source/resource.adb b/source/resource.adb index b2d8c5a..804848f 100644 --- a/source/resource.adb +++ b/source/resource.adb @@ -4,8 +4,6 @@ with core, ui, resource; -use resource; - package body resource is ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ diff --git a/source/skill.adb b/source/skill.adb index 42ff88b..509bb03 100644 --- a/source/skill.adb +++ b/source/skill.adb @@ -4,8 +4,6 @@ with core, ui, skill; -use skill; - package body skill is ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ diff --git a/source/ui.adb b/source/ui.adb index 4b869f0..1a4faab 100644 --- a/source/ui.adb +++ b/source/ui.adb @@ -4,8 +4,6 @@ with core, ui; -use ui; - package body ui is ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ diff --git a/source/unit.adb b/source/unit.adb index 96e9dd5..565309a 100644 --- a/source/unit.adb +++ b/source/unit.adb @@ -4,8 +4,6 @@ with core, ui, effect, attribute, faction, unit; -use unit; - package body unit is ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ diff --git a/source/world.adb b/source/world.adb index 3da6065..59138b4 100644 --- a/source/world.adb +++ b/source/world.adb @@ -2,11 +2,8 @@ -- -- GNU General Public Licence (version 3 or later) ---~with ada.strings.fixed; with core, resource, item, unit, construction, world; -use world; - package body world is ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ @@ -40,12 +37,12 @@ package body world is -- for index in codex loop - landmarks (index) := new sprite_array (0 .. limit (index)); - for value in 0 .. limit (index) + landmarks (index) := new sprite_array (0 .. limit (index) - 1); + -- + for value in 0 .. limit (index) - 1 loop declare folder : constant string := core.lowercase (codex'image (index)); - --~file : constant string := ada.strings.fixed.trim (value'image, ada.strings.left); file : constant string := value'image; begin landmarks (index) (value) := core.import_sprite ("./sprite/world/landmark/" & folder & "/" & file & ".png", 1, 1); @@ -59,6 +56,7 @@ package body world is procedure make (index : in codex; width, height : in natural) is begin core.echo (core.comment, "-- Procedurally generating new map..."); + -- core.echo (core.comment, "-- -- Map type : " & index'image); core.echo (core.comment, "-- -- Map width :" & width'image); core.echo (core.comment, "-- -- Map height :" & height'image); @@ -84,7 +82,7 @@ package body world is -- for object in 0 .. landmark_limit loop - map.landmark (object).index := core.random_integer (0, limit (index)); + map.landmark (object).index := core.random_integer (0, limit (index) - 1); map.landmark (object).x := core.base * core.random_integer (1, map.width - 1); map.landmark (object).y := core.base * core.random_integer (1, map.height - 1); end loop;