Breaking compilation of ~3000 SLOC project...

This commit is contained in:
Ognjen Milan Robovic 2024-04-25 00:27:13 -04:00
parent 4b832177b0
commit 3750a8727b
33 changed files with 226 additions and 100 deletions

View File

@ -1,3 +1,7 @@
-- Copyright (c) 2024 - Ognjen 'xolatile' Milan Robovic
--
-- GNU General Public Licence (version 3 or later)
with core, ui, ai;
use ai;

View File

@ -1,3 +1,7 @@
-- Copyright (c) 2024 - Ognjen 'xolatile' Milan Robovic
--
-- GNU General Public Licence (version 3 or later)
with core;
package ai is

View File

@ -1,3 +1,7 @@
-- Copyright (c) 2024 - Ognjen 'xolatile' Milan Robovic
--
-- GNU General Public Licence (version 3 or later)
with core, ui, attribute;
use attribute;

View File

@ -1,3 +1,7 @@
-- Copyright (c) 2024 - Ognjen 'xolatile' Milan Robovic
--
-- GNU General Public Licence (version 3 or later)
with core;
package attribute is

View File

@ -1,3 +1,7 @@
-- Copyright (c) 2024 - Ognjen 'xolatile' Milan Robovic
--
-- GNU General Public Licence (version 3 or later)
with core, ui, faction, chad;
use chad;

View File

@ -1,12 +1,15 @@
with core, faction, attribute, skill, resource;
-- Copyright (c) 2024 - Ognjen 'xolatile' Milan Robovic
--
-- GNU General Public Licence (version 3 or later)
with core, attribute, skill, resource, faction;
package chad is
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
type codex is (
ognjen, richard, eric, linus, ada, marina,
kathleen, wouter, john
ada, richard, ognjen, wouter, john, marina
);
------------------------------------------------------------------------------------------
@ -33,15 +36,12 @@ package chad is
count : constant natural := codex'pos (codex'last) + 1;
trait : constant array (codex) of information := (
("Ognjen Milan Robovic ", faction.castle, attribute.offense, skill.archery, resource.gold),
("Richard Martin Stallman ", faction.stronghold, attribute.offense, skill.archery, resource.gold),
("Eric Steven Raymond ", faction.inferno, attribute.offense, skill.archery, resource.gold),
("Linus Benedict Torvalds ", faction.tower, attribute.offense, skill.archery, resource.gold),
("Ada Augusta King ", faction.conflux, attribute.offense, skill.archery, resource.gold),
("Marina Ann Hantzis ", faction.necropolis, attribute.offense, skill.archery, resource.gold),
("Kathleen Hylda Britten ", faction.rampart, attribute.offense, skill.archery, resource.gold),
("Wouter van Oortmerssen ", faction.fortress, attribute.offense, skill.archery, resource.gold),
("John Warner Backus ", faction.dungeon, attribute.offense, skill.archery, resource.gold)
("Ada Augusta King ", faction.fairy, attribute.defense, skill.diplomacy, resource.steel),
("Richard Martin Stallman ", faction.dwarf, attribute.offense, skill.leadership, resource.wood),
("Ognjen Milan Robovic ", faction.gnoll, attribute.stamina, skill.archery, resource.leather),
("Wouter van Oortmerssen ", faction.kobold, attribute.speed, skill.medicine, resource.stone),
("John Warner Backus ", faction.goblin, attribute.wisdom, skill.sorcery, resource.crystal),
("Marina Ann Hantzis ", faction.imp, attribute.reach, skill.necromancy, resource.gold)
);
------------------------------------------------------------------------------------------

View File

@ -1,3 +1,7 @@
-- Copyright (c) 2024 - Ognjen 'xolatile' Milan Robovic
--
-- GNU General Public Licence (version 3 or later)
with core, effect, resource, faction, construction;
use construction;

View File

@ -1,3 +1,7 @@
-- Copyright (c) 2024 - Ognjen 'xolatile' Milan Robovic
--
-- GNU General Public Licence (version 3 or later)
with core, effect, resource, faction;
package construction is

View File

@ -1,3 +1,7 @@
-- Copyright (c) 2024 - Ognjen 'xolatile' Milan Robovic
--
-- GNU General Public Licence (version 3 or later)
with core;
use core;

View File

@ -1,3 +1,7 @@
-- Copyright (c) 2024 - Ognjen 'xolatile' Milan Robovic
--
-- GNU General Public Licence (version 3 or later)
with ada.text_io, ada.strings.unbounded, interfaces.c;
use ada.text_io, ada.strings.unbounded, interfaces.c;

View File

@ -1,3 +1,7 @@
-- Copyright (c) 2024 - Ognjen 'xolatile' Milan Robovic
--
-- GNU General Public Licence (version 3 or later)
with core, deity;
use deity;

View File

@ -1,3 +1,7 @@
-- Copyright (c) 2024 - Ognjen 'xolatile' Milan Robovic
--
-- GNU General Public Licence (version 3 or later)
with core;
package deity is

View File

@ -1,3 +1,7 @@
-- Copyright (c) 2024 - Ognjen 'xolatile' Milan Robovic
--
-- GNU General Public Licence (version 3 or later)
with core, effect;
use effect;

View File

@ -1,3 +1,7 @@
-- Copyright (c) 2024 - Ognjen 'xolatile' Milan Robovic
--
-- GNU General Public Licence (version 3 or later)
with core;
package effect is

View File

@ -1,3 +1,7 @@
-- Copyright (c) 2024 - Ognjen 'xolatile' Milan Robovic
--
-- GNU General Public Licence (version 3 or later)
with core, attribute, skill, resource, faction;
use faction;

View File

@ -1,3 +1,7 @@
-- Copyright (c) 2024 - Ognjen 'xolatile' Milan Robovic
--
-- GNU General Public Licence (version 3 or later)
with core, attribute, skill, resource;
package faction is
@ -5,8 +9,8 @@ package faction is
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
type codex is (
neutral, castle, stronghold, inferno, tower, conflux,
necropolis, rampart, fortress, dungeon
fairy, dwarf, gnoll, kobold, goblin, imp,
neutral
);
------------------------------------------------------------------------------------------
@ -14,9 +18,9 @@ package faction is
type information is
record
name : core.short_string;
attribute_bonus : attribute.codex;
skill_bonus : skill.codex;
resource_bonus : resource.codex;
bonus_attribute : attribute.codex;
bonus_skill : skill.codex;
bonus_resource : resource.codex;
end record;
------------------------------------------------------------------------------------------
@ -24,16 +28,13 @@ package faction is
count : constant natural := codex'pos (codex'last) + 1;
trait : constant array (codex) of information := (
("Neutral ", attribute.offense, skill.archery, resource.gold),
("Castle ", attribute.offense, skill.archery, resource.gold),
("Stronghold ", attribute.offense, skill.archery, resource.gold),
("Inferno ", attribute.offense, skill.archery, resource.gold),
("Tower ", attribute.offense, skill.archery, resource.gold),
("Conflux ", attribute.offense, skill.archery, resource.gold),
("Necropolis ", attribute.offense, skill.archery, resource.gold),
("Rampart ", attribute.offense, skill.archery, resource.gold),
("Fortress ", attribute.offense, skill.archery, resource.gold),
("Dungeon ", attribute.offense, skill.archery, resource.gold)
("Fairy Kingdom ", attribute.speed, skill.mysticism, resource.gold),
("Dwarf Kingdom ", attribute.defense, skill.estates, resource.stone),
("Gnoll Kingdom ", attribute.stamina, skill.logistics, resource.leather),
("Kobold Kingdom ", attribute.offense, skill.tactics, resource.steel),
("Goblin Kingdom ", attribute.reach, skill.exploration, resource.wood),
("Imp Kingdom ", attribute.wisdom, skill.sorcery, resource.crystal),
("Neutral ", attribute.offense, skill.archery, resource.gold)
);
------------------------------------------------------------------------------------------

View File

@ -1,3 +1,7 @@
-- Copyright (c) 2024 - Ognjen 'xolatile' Milan Robovic
--
-- GNU General Public Licence (version 3 or later)
with core, item;
use item;

View File

@ -1,3 +1,7 @@
-- Copyright (c) 2024 - Ognjen 'xolatile' Milan Robovic
--
-- GNU General Public Licence (version 3 or later)
with core, effect;
package item is

View File

@ -1,3 +1,7 @@
-- Copyright (c) 2024 - Ognjen 'xolatile' Milan Robovic
--
-- GNU General Public Licence (version 3 or later)
with core, ui, effect, magic;
use magic;

View File

@ -1,3 +1,7 @@
-- Copyright (c) 2024 - Ognjen 'xolatile' Milan Robovic
--
-- GNU General Public Licence (version 3 or later)
with core, effect;
package magic is

View File

@ -1,6 +1,11 @@
-- Copyright (c) 2024 - Ognjen 'xolatile' Milan Robovic
--
-- GNU General Public Licence (version 3 or later)
pragma ada_2012;
with core, ui, effect, attribute, skill, resource, faction, might, magic, item, unit, construction, chad, world, ai;
--~with core, ui, effect, attribute, skill, resource, faction, might, magic, item, unit, construction, chad, world, ai;
with core, ui, effect, attribute, skill, resource, faction, chad, ai;
procedure main is
@ -16,52 +21,52 @@ procedure main is
------------------------------------------------------------------------------------------
type menu_index is (
menu_none, menu_attribute, menu_skill, menu_resource, menu_unit, menu_might, menu_magic
);
--~type menu_index is (
--~menu_none, menu_attribute, menu_skill, menu_resource, menu_unit, menu_might, menu_magic
--~);
menu_limit : constant integer := 3;
menu_count : integer := 0;
--~menu_limit : constant integer := 3;
--~menu_count : integer := 0;
menu_stack : array (1 .. menu_limit) of menu_index := (others => menu_none);
--~menu_stack : array (1 .. menu_limit) of menu_index := (others => menu_none);
procedure menu_insert (index : in menu_index) is
begin
if menu_count = menu_limit then return; end if;
--
menu_count := menu_count mod menu_limit + 1;
--
menu_stack (menu_count) := index;
end menu_insert;
--~procedure menu_insert (index : in menu_index) is
--~begin
--~if menu_count = menu_limit then return; end if;
--~--
--~menu_count := menu_count mod menu_limit + 1;
--~--
--~menu_stack (menu_count) := index;
--~end menu_insert;
procedure menu_remove is
begin
if menu_count = 0 then return; end if;
--
menu_stack (menu_count) := menu_none;
--
menu_count := menu_count - 1;
end menu_remove;
--~procedure menu_remove is
--~begin
--~if menu_count = 0 then return; end if;
--~--
--~menu_stack (menu_count) := menu_none;
--~--
--~menu_count := menu_count - 1;
--~end menu_remove;
procedure menu_render is
begin
if menu_count > 0 then
core.overlay;
end if;
--
for index in 1 .. menu_limit
loop
case menu_stack (index) is
when menu_none => null;
when menu_attribute => attribute.menu (100, 100, false);
when menu_skill => skill.menu (200, 200, false);
when menu_resource => resource.menu (300, 300, false);
when menu_unit => unit.menu (0, 0, true);
when menu_might => might.menu (0, 0, true);
when menu_magic => magic.menu (0, 0, true);
end case;
end loop;
end menu_render;
--~procedure menu_render is
--~begin
--~if menu_count > 0 then
--~core.overlay;
--~end if;
--~--
--~for index in 1 .. menu_limit
--~loop
--~case menu_stack (index) is
--~when menu_none => null;
--~when menu_attribute => attribute.menu (100, 100, false);
--~when menu_skill => skill.menu (200, 200, false);
--~when menu_resource => resource.menu (300, 300, false);
--~when menu_unit => unit.menu (0, 0, true);
--~when menu_might => might.menu (0, 0, true);
--~when menu_magic => magic.menu (0, 0, true);
--~end case;
--~end loop;
--~end menu_render;
------------------------------------------------------------------------------------------
@ -70,26 +75,26 @@ procedure main is
procedure move_camera_down is begin core.camera.y := core.camera.y + 1; end move_camera_down;
procedure move_camera_left is begin core.camera.x := core.camera.x - 1; end move_camera_left;
procedure move_camera_right is begin core.camera.x := core.camera.x + 1; end move_camera_right;
procedure show_attribute_menu is begin menu_insert (menu_attribute); end show_attribute_menu;
procedure show_skill_menu is begin menu_insert (menu_skill); end show_skill_menu;
procedure show_resource_menu is begin menu_insert (menu_resource); end show_resource_menu;
procedure show_unit_menu is begin menu_insert (menu_unit); end show_unit_menu;
procedure show_might_menu is begin menu_insert (menu_might); end show_might_menu;
procedure show_magic_menu is begin menu_insert (menu_magic); end show_magic_menu;
procedure hide_top_menu is begin menu_remove; end hide_top_menu;
--~procedure show_attribute_menu is begin menu_insert (menu_attribute); end show_attribute_menu;
--~procedure show_skill_menu is begin menu_insert (menu_skill); end show_skill_menu;
--~procedure show_resource_menu is begin menu_insert (menu_resource); end show_resource_menu;
--~procedure show_unit_menu is begin menu_insert (menu_unit); end show_unit_menu;
--~procedure show_might_menu is begin menu_insert (menu_might); end show_might_menu;
--~procedure show_magic_menu is begin menu_insert (menu_magic); end show_magic_menu;
--~procedure hide_top_menu is begin menu_remove; end hide_top_menu;
signal_list : constant array (core.signal_code) of access procedure := (
core.signal_up => move_camera_up'access,
core.signal_down => move_camera_down'access,
core.signal_left => move_camera_left'access,
core.signal_right => move_camera_right'access,
core.signal_a => show_attribute_menu'access,
core.signal_s => show_skill_menu'access,
core.signal_r => show_resource_menu'access,
core.signal_u => show_unit_menu'access,
core.signal_m => show_might_menu'access,
core.signal_n => show_magic_menu'access,
core.signal_grave => hide_top_menu'access,
--~core.signal_a => show_attribute_menu'access,
--~core.signal_s => show_skill_menu'access,
--~core.signal_r => show_resource_menu'access,
--~core.signal_u => show_unit_menu'access,
--~core.signal_m => show_might_menu'access,
--~core.signal_n => show_magic_menu'access,
--~core.signal_grave => hide_top_menu'access,
others => idle'access
);
@ -113,16 +118,16 @@ begin
attribute.configure;
skill.configure;
resource.configure;
might.configure;
magic.configure;
item.configure;
unit.configure;
construction.configure;
--~chad.configure;
world.configure;
--~might.configure;
--~magic.configure;
--~item.configure;
--~unit.configure;
--~construction.configure;
chad.configure;
--~world.configure;
ai.configure;
world.make (world.rough, 120, 100);
--~world.make (world.rough, 120, 100);
preview_width := core.window_width - side_panel;
preview_height := core.window_height;
@ -140,13 +145,13 @@ begin
--
ui.active := (if core.cursor_mode = 3 then ui.default else ui.steam);
--
core.draw (core.hexagon_fill_sprite, 0, 0);
core.draw (core.hexagon_grid_sprite, 0, 0);
--~core.draw (core.hexagon_fill_sprite, 0, 0);
--~core.draw (core.hexagon_grid_sprite, 0, 0);
--
core.camera.x := core.clip (core.camera.x, 0, world.map.width - preview_width / core.base);
core.camera.y := core.clip (core.camera.y, 0, world.map.height - preview_height / core.base);
--~core.camera.x := core.clip (core.camera.x, 0, world.map.width - preview_width / core.base);
--~core.camera.y := core.clip (core.camera.y, 0, world.map.height - preview_height / core.base);
--
world.draw (preview_x, preview_y, preview_width - 2 * preview_x, preview_height - 2 * preview_y - 32, core.signal_mode = core.signal_code'pos (core.signal_g));
--~world.draw (preview_x, preview_y, preview_width - 2 * preview_x, preview_height - 2 * preview_y - 32, core.signal_mode = core.signal_code'pos (core.signal_g));
--
--~core.draw_central_grid (preview_x, preview_y, preview_width - 2 * preview_x, preview_height - 2 * preview_y);
--~core.draw_squared_grid (preview_x, preview_y, preview_width - 2 * preview_x, preview_height - 2 * preview_y);
@ -165,9 +170,9 @@ begin
--~magic.menu (0, 0, true);
--~might.menu (0, 0, true);
--
menu_render;
--~menu_render;
--
ui.write (menu_count'image, 16, 16);
--~ui.write (menu_count'image, 16, 16);
--
ui.draw_text_box (0, core.window_height - 32, core.window_width, 32);
end loop gameplay;

View File

@ -1,3 +1,7 @@
-- Copyright (c) 2024 - Ognjen 'xolatile' Milan Robovic
--
-- GNU General Public Licence (version 3 or later)
with core, ui, effect, might;
use might;

View File

@ -1,3 +1,7 @@
-- Copyright (c) 2024 - Ognjen 'xolatile' Milan Robovic
--
-- GNU General Public Licence (version 3 or later)
with core, effect;
package might is

View File

@ -1,3 +1,7 @@
-- Copyright (c) 2024 - Ognjen 'xolatile' Milan Robovic
--
-- GNU General Public Licence (version 3 or later)
with core, ui, resource;
use resource;

View File

@ -1,3 +1,7 @@
-- Copyright (c) 2024 - Ognjen 'xolatile' Milan Robovic
--
-- GNU General Public Licence (version 3 or later)
with core;
package resource is

View File

@ -1,3 +1,7 @@
-- Copyright (c) 2024 - Ognjen 'xolatile' Milan Robovic
--
-- GNU General Public Licence (version 3 or later)
with core, ui, skill;
use skill;

View File

@ -1,3 +1,7 @@
-- Copyright (c) 2024 - Ognjen 'xolatile' Milan Robovic
--
-- GNU General Public Licence (version 3 or later)
with core;
package skill is

View File

@ -1,4 +1,8 @@
with core, ui;
-- Copyright (c) 2024 - Ognjen 'xolatile' Milan Robovic
--
-- GNU General Public Licence (version 3 or later)
with core, ui;
use ui;
@ -90,7 +94,7 @@ package body ui is
procedure configure is
procedure load_ui (index : in style; folder_path : in string) is
begin
glyphs (index) := core.import_glyphs ("./sprite/ui/" & folder_path & "/font.png", 24, 0);
glyphs (index) := core.import_glyphs ("./sprite/ui/" & folder_path & "/font.png", (if index = default then 16 else 24), 0);
--
for this in codex
loop

View File

@ -1,3 +1,7 @@
-- Copyright (c) 2024 - Ognjen 'xolatile' Milan Robovic
--
-- GNU General Public Licence (version 3 or later)
with core;
package ui is

View File

@ -1,3 +1,7 @@
-- Copyright (c) 2024 - Ognjen 'xolatile' Milan Robovic
--
-- GNU General Public Licence (version 3 or later)
with core, ui, effect, attribute, faction, unit;
use unit;

View File

@ -1,3 +1,7 @@
-- Copyright (c) 2024 - Ognjen 'xolatile' Milan Robovic
--
-- GNU General Public Licence (version 3 or later)
with core, effect, attribute, faction;
package unit is

View File

@ -1,3 +1,7 @@
-- Copyright (c) 2024 - Ognjen 'xolatile' Milan Robovic
--
-- GNU General Public Licence (version 3 or later)
with ada.strings.fixed;
with core, resource, item, unit, construction, world;

View File

@ -1,3 +1,7 @@
-- Copyright (c) 2024 - Ognjen 'xolatile' Milan Robovic
--
-- GNU General Public Licence (version 3 or later)
with core, resource, item, unit, construction;
package world is