diff --git a/source/construction.adb b/source/construction.adb index a83939d..cdbf3b9 100644 --- a/source/construction.adb +++ b/source/construction.adb @@ -8,10 +8,6 @@ package body construction is ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - sprite : array (enumeration) of core.sprite; - - ------------------------------------------------------------------------------------------ - procedure configure is begin core.echo (core.comment, "Configuring construction components..."); diff --git a/source/construction.ads b/source/construction.ads index bf01724..6be8f3f 100644 --- a/source/construction.ads +++ b/source/construction.ads @@ -35,6 +35,8 @@ package construction is ("Imp Den ", faction.imp, (others => 0), 1, effect.none) ); + sprite : array (enumeration) of core.sprite; + ------------------------------------------------------------------------------------------ procedure configure; diff --git a/source/world.adb b/source/world.adb index 75cbd95..765dde3 100644 --- a/source/world.adb +++ b/source/world.adb @@ -64,8 +64,18 @@ package body world is -- for index in 1 .. 30 loop map.constructions (index).index := core.random (0, construction.count - 1); - map.constructions (index).x := core.random (0, map.width - 1); - map.constructions (index).y := core.random (0, map.height - 1); + map.constructions (index).x := core.random (6, map.width - 6); + map.constructions (index).y := core.random (6, map.height - 6); + -- + declare reach_x : constant natural := construction.sprite (construction.enumeration'val (map.constructions (index).index)).width / core.base; + reach_y : constant natural := construction.sprite (construction.enumeration'val (map.constructions (index).index)).height / core.base; + begin + for x in 0 .. reach_x - 1 loop + for y in 0 .. reach_y - 1 loop + map.clips (map.constructions (index).x + x, map.constructions (index).y + y) := true; + end loop; + end loop; + end; end loop; -- for index in 1 .. 60 loop @@ -145,25 +155,6 @@ package body world is offset.y + (map.items (index).y - core.camera.y) * core.base * core.zoom); end if; end loop; - -- - --~for vertical in 0 .. map.height - 1 loop - --~exit when offset.y + (vertical - core.camera.y) * core.base * core.zoom > core.window_height; - --~-- - --~for horizontal in 0 .. map.width - 1 loop - --~exit when offset.x + (horizontal - core.camera.x) * core.base * core.zoom > core.window_width; - --~-- - --~u := core.base * biome'pos (map.kind) * 4; - --~v := core.base * map.tiles (horizontal, vertical); - --~-- - --~core.draw (data => tiles, - --~x => offset.x + (horizontal - core.camera.x) * core.base * core.zoom, - --~y => offset.y + (vertical - core.camera.y) * core.base * core.zoom, - --~u => u, - --~v => v, - --~width => core.base, - --~height => core.base); - --~end loop; - --~end loop; end draw; ------------------------------------------------------------------------------------------