From cb06f12d3585e28aeaf06aea82843cf84a7a0a9f Mon Sep 17 00:00:00 2001 From: xolatile Date: Sun, 2 Jun 2024 10:15:47 -0400 Subject: [PATCH] Removing clutter... --- compile.sh | 2 +- source/attribute.adb | 49 ------------------------------------------------ source/attribute.ads | 5 ----- source/chad.adb | 16 ++++++++-------- source/main.adb | 29 ++++++++++++++++++++++++---- source/material.adb | 34 --------------------------------- source/material.ads | 5 ----- source/resource.adb | 49 ------------------------------------------------ source/resource.ads | 5 ----- source/skill.adb | 53 ---------------------------------------------------- source/skill.ads | 5 ----- 11 files changed, 34 insertions(+), 218 deletions(-) diff --git a/compile.sh b/compile.sh index 9fe0fda..28fdeb8 100644 --- a/compile.sh +++ b/compile.sh @@ -3,7 +3,7 @@ set -xe cd source -gnatmake -gnatp -O3 -f -fstack-check -fno-exceptions -c main.adb +gnatmake -O3 -fstack-check -fno-exceptions -c main.adb gnatbind main.ali gnatlink -o xhads main.ali -lraylib mv xhads ../xhads diff --git a/source/attribute.adb b/source/attribute.adb index 934237d..c307cd6 100644 --- a/source/attribute.adb +++ b/source/attribute.adb @@ -8,37 +8,6 @@ package body attribute is ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - procedure configure is - structure : ui.structure; - -- - time : float := 0.0; - begin - time := core.time; - -- - core.echo (core.comment, "Configuring" & count'image & " attribute components..."); - -- - structure.title := "Attribute Menu "; - structure.toggle := core.signal_a; - structure.show := false; - structure.center := false; - structure.resize := true; - structure.x := 60; - structure.y := 100; - structure.gui_n := count; - -- - ui.add_structure (data => structure); - -- - for index in enumeration loop - icon (index) := core.import_sprite (core.folder & "/icon/attribute/" & core.lowercase (enumeration'image (index)) & ".png", 1, 1); - -- - ui.add_structure_button (icon (index), description (index).name, description (index).text); - end loop; - -- - core.echo (core.success, "Successfully configured attribute information in" & natural'image (natural (1_000_000.0 * (core.time - time))) & " microseconds."); - end configure; - - ------------------------------------------------------------------------------------------ - procedure draw_points (data : in points; x, y : in integer) is move_x : integer := x; begin @@ -51,24 +20,6 @@ package body attribute is end loop; end draw_points; - ------------------------------------------------------------------------------------------ - - procedure save_points (here : in core.io.file_type; data : in points) is - begin - for index in enumeration loop - core.save_point (here, data (index)); - end loop; - end save_points; - - ------------------------------------------------------------------------------------------ - - procedure load_points (here : in core.io.file_type; data : out points) is - begin - for index in enumeration loop - core.load_point (here, data (index)); - end loop; - end load_points; - ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ end attribute; diff --git a/source/attribute.ads b/source/attribute.ads index f386cc9..421d524 100644 --- a/source/attribute.ads +++ b/source/attribute.ads @@ -43,13 +43,8 @@ package attribute is ------------------------------------------------------------------------------------------ - procedure configure; - procedure draw_points (data : in points; x, y : in integer); - procedure save_points (here : in core.io.file_type; data : in points); - procedure load_points (here : in core.io.file_type; data : out points); - ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ end attribute; diff --git a/source/chad.adb b/source/chad.adb index b56d7a6..e3ee2df 100644 --- a/source/chad.adb +++ b/source/chad.adb @@ -140,10 +140,10 @@ package body chad is core.save_point (here, data.mana); core.save_point (here, data.movement); -- - attribute.save_points (here, data.attributes); - skill.save_points (here, data.skills); - resource.save_points (here, data.resources); - material.save_points (here, data.materials); + for index in attribute.enumeration loop core.save_point (here, data.attributes (index)); end loop; + for index in skill.enumeration loop core.save_point (here, data.skills (index)); end loop; + for index in resource.enumeration loop core.save_point (here, data.resources (index)); end loop; + for index in material.enumeration loop core.save_point (here, data.materials (index)); end loop; -- for index in equipment.slot loop core.io.write (here, equipment.enumeration'pos (data.equipments (index))); @@ -172,10 +172,10 @@ package body chad is core.load_point (here, data.mana); core.load_point (here, data.movement); -- - attribute.load_points (here, data.attributes); - skill.load_points (here, data.skills); - resource.load_points (here, data.resources); - material.load_points (here, data.materials); + for index in attribute.enumeration loop core.load_point (here, data.attributes (index)); end loop; + for index in skill.enumeration loop core.load_point (here, data.skills (index)); end loop; + for index in resource.enumeration loop core.load_point (here, data.resources (index)); end loop; + for index in material.enumeration loop core.load_point (here, data.materials (index)); end loop; -- for index in equipment.slot loop core.io.read (here, this); data.equipments (index) := equipment.enumeration'val (this); diff --git a/source/main.adb b/source/main.adb index 1531c32..d243044 100644 --- a/source/main.adb +++ b/source/main.adb @@ -198,12 +198,33 @@ begin --~core.play (core.import_song (core.c_string (core.folder & "/song/main_menu.ogg")).index); - attribute.configure; - skill.configure; - resource.configure; + core.echo (core.comment, "Configuring" & attribute.count'image & " attribute components..."); + -- + for index in attribute.enumeration loop + attribute.icon (index) := core.import_sprite (core.folder & "/icon/attribute/" & core.lowercase (attribute.enumeration'image (index)) & ".png", 1, 1); + end loop; + + core.echo (core.comment, "Configuring" & skill.count'image & " skill components..."); + -- + for index in skill.enumeration loop + skill.icon (index) := core.import_sprite (core.folder & "/icon/skill/" & core.lowercase (skill.enumeration'image (index)) & ".png", 1, 1); + end loop; + + core.echo (core.comment, "Configuring" & resource.count'image & " resource components..."); + -- + for index in resource.enumeration loop + resource.icon (index) := core.import_sprite (core.folder & "/icon/resource/" & core.lowercase (resource.enumeration'image (index)) & ".png", 1, 1); + end loop; + --~might.configure; magic.configure; - material.configure; + + core.echo (core.comment, "Configuring" & material.count'image & " material components..."); + -- + for index in material.enumeration loop + material.icon (index) := core.import_sprite (core.folder & "/icon/material/" & core.lowercase (material.enumeration'image (index)) & ".png", 1, 1); + end loop; + equipment.configure; unit.configure; deity.configure; diff --git a/source/material.adb b/source/material.adb index 1d5403f..a604017 100644 --- a/source/material.adb +++ b/source/material.adb @@ -8,22 +8,6 @@ package body material is ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - procedure configure is - time : float := 0.0; - begin - time := core.time; - -- - core.echo (core.comment, "Configuring" & count'image & " material components..."); - -- - for index in enumeration loop - icon (index) := core.import_sprite (core.folder & "/icon/material/" & core.lowercase (enumeration'image (index)) & ".png", 1, 1); - end loop; - -- - core.echo (core.success, "Successfully configured resource information in" & natural'image (natural (1_000_000.0 * (core.time - time))) & " microseconds."); - end configure; - - ------------------------------------------------------------------------------------------ - procedure draw_points (data : in points := (others => (0, 0)); x : in integer := 0; y : in integer := 0) is @@ -40,24 +24,6 @@ package body material is end loop; end draw_points; - ------------------------------------------------------------------------------------------ - - procedure save_points (here : in core.io.file_type; data : in points) is - begin - for index in enumeration loop - core.save_point (here, data (index)); - end loop; - end save_points; - - ------------------------------------------------------------------------------------------ - - procedure load_points (here : in core.io.file_type; data : out points) is - begin - for index in enumeration loop - core.load_point (here, data (index)); - end loop; - end load_points; - ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ end material; diff --git a/source/material.ads b/source/material.ads index 9ad8a0c..c192c2c 100644 --- a/source/material.ads +++ b/source/material.ads @@ -67,15 +67,10 @@ package material is ------------------------------------------------------------------------------------------ - procedure configure; - procedure draw_points (data : in points := (others => (0, 0)); x : in integer := 0; y : in integer := 0); - procedure save_points (here : in core.io.file_type; data : in points); - procedure load_points (here : in core.io.file_type; data : out points); - ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ end material; diff --git a/source/resource.adb b/source/resource.adb index 6230f7c..e10d9f1 100644 --- a/source/resource.adb +++ b/source/resource.adb @@ -8,37 +8,6 @@ package body resource is ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - procedure configure is - structure : ui.structure; - -- - time : float := 0.0; - begin - time := core.time; - -- - core.echo (core.comment, "Configuring" & count'image & " resource components..."); - -- - structure.title := "Resource Menu "; - structure.toggle := core.signal_r; - structure.show := false; - structure.center := false; - structure.resize := true; - structure.x := 60; - structure.y := 500; - structure.gui_n := count; - -- - ui.add_structure (structure); - -- - for index in enumeration loop - icon (index) := core.import_sprite (core.folder & "/icon/resource/" & core.lowercase (enumeration'image (index)) & ".png", 1, 1); - -- - ui.add_structure_button (icon (index), description (index).name, description (index).text); - end loop; - -- - core.echo (core.success, "Successfully configured resource information in" & natural'image (natural (1_000_000.0 * (core.time - time))) & " microseconds."); - end configure; - - ------------------------------------------------------------------------------------------ - procedure draw_points (data : in points; x, y : in integer) is frame_width : constant integer := 4 * core.icon; begin @@ -53,24 +22,6 @@ package body resource is end loop; end draw_points; - ------------------------------------------------------------------------------------------ - - procedure save_points (here : in core.io.file_type; data : in points) is - begin - for index in enumeration loop - core.save_point (here, data (index)); - end loop; - end save_points; - - ------------------------------------------------------------------------------------------ - - procedure load_points (here : in core.io.file_type; data : out points) is - begin - for index in enumeration loop - core.load_point (here, data (index)); - end loop; - end load_points; - ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ end resource; diff --git a/source/resource.ads b/source/resource.ads index fcf0e94..11f422a 100644 --- a/source/resource.ads +++ b/source/resource.ads @@ -41,13 +41,8 @@ package resource is ------------------------------------------------------------------------------------------ - procedure configure; - procedure draw_points (data : in points; x, y : in integer); - procedure save_points (here : in core.io.file_type; data : in points); - procedure load_points (here : in core.io.file_type; data : out points); - ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ end resource; diff --git a/source/skill.adb b/source/skill.adb index 70b8666..68f1b28 100644 --- a/source/skill.adb +++ b/source/skill.adb @@ -8,41 +8,6 @@ package body skill is ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - procedure configure is - structure : ui.structure; - -- - time : float := 0.0; - begin - time := core.time; - -- - core.echo (core.comment, "Configuring" & count'image & " skill components..."); - -- - structure.title := "Skill Menu "; - structure.toggle := core.signal_s; - structure.show := false; - structure.center := true; - structure.resize := true; - structure.x := 80; - structure.y := (core.window_height - 320) / 2; - structure.gui_n := count + 1; - -- - ui.add_structure (structure); - -- - for index in enumeration loop - icon (index) := core.import_sprite (core.folder & "/icon/skill/" & core.lowercase (enumeration'image (index)) & ".png", 1, 1); - -- - if enumeration'pos (index) = 9 then - ui.add_structure_orient; - end if; - -- - ui.add_structure_button (icon (index), description (index).name, description (index).text); - end loop; - -- - core.echo (core.success, "Successfully configured skill information in" & natural'image (natural (1_000_000.0 * (core.time - time))) & " microseconds."); - end configure; - - ------------------------------------------------------------------------------------------ - procedure draw_points (data : in points := (others => (0, 0)); x : in integer := 0; y : in integer := 0) is @@ -65,24 +30,6 @@ package body skill is end loop; end draw_points; - ------------------------------------------------------------------------------------------ - - procedure save_points (here : in core.io.file_type; data : in points) is - begin - for index in enumeration loop - core.save_point (here, data (index)); - end loop; - end save_points; - - ------------------------------------------------------------------------------------------ - - procedure load_points (here : in core.io.file_type; data : out points) is - begin - for index in enumeration loop - core.load_point (here, data (index)); - end loop; - end load_points; - ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ end skill; diff --git a/source/skill.ads b/source/skill.ads index 08a5a41..b5b07be 100644 --- a/source/skill.ads +++ b/source/skill.ads @@ -57,15 +57,10 @@ package skill is ------------------------------------------------------------------------------------------ - procedure configure; - procedure draw_points (data : in points := (others => (0, 0)); x : in integer := 0; y : in integer := 0); - procedure save_points (here : in core.io.file_type; data : in points); - procedure load_points (here : in core.io.file_type; data : out points); - ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ end skill;