Added basic printf debugging...
This commit is contained in:
parent
dad6c7e86d
commit
8cc3f0d228
@ -8,6 +8,8 @@ package body attribute is
|
||||
|
||||
procedure configure is
|
||||
begin
|
||||
core.echo (core.comment, "Configuring attribute components...");
|
||||
--
|
||||
for index in codex
|
||||
loop
|
||||
sprite (index) := core.load_sprite ("./sprite/attribute/" & core.lowercase (codex'image (index)) & ".png", 1, 1);
|
||||
|
@ -8,6 +8,8 @@ package body chad is
|
||||
|
||||
procedure configure is
|
||||
begin
|
||||
core.echo (core.comment, "Configuring chad components...");
|
||||
--
|
||||
for index in codex
|
||||
loop
|
||||
--~sprite (index) := core.load_sprite ("./sprite/chad/" & core.lowercase (codex'image (index)) & ".png", 1, 1);
|
||||
|
@ -16,6 +16,8 @@ package body construction is
|
||||
|
||||
procedure configure is
|
||||
begin
|
||||
core.echo (core.comment, "Configuring construction components...");
|
||||
--
|
||||
for index in codex
|
||||
loop
|
||||
declare
|
||||
|
@ -6,8 +6,56 @@ package body core is
|
||||
|
||||
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
procedure terminal (colour : in terminal_colour := white; effect : in terminal_effect := normal) is
|
||||
format : string := character'val (27) & "[" & character'val (terminal_effect'pos (effect) + 48) & ";3" & character'val (terminal_colour'pos (colour) + 48) & "m";
|
||||
begin
|
||||
put (format);
|
||||
end terminal;
|
||||
|
||||
------------------------------------------------------------------------------------------
|
||||
|
||||
procedure echo (status : in echo_status; message : in string) is
|
||||
begin
|
||||
put ("[");
|
||||
--
|
||||
case status is
|
||||
when failure => terminal (red, bold); put ("Failure"); terminal;
|
||||
when warning => terminal (yellow, bold); put ("Warning"); terminal;
|
||||
when success => terminal (green, bold); put ("Success"); terminal;
|
||||
when comment => terminal (grey, bold); put ("Comment"); terminal;
|
||||
end case;
|
||||
--
|
||||
put_line ("] " & message);
|
||||
end echo;
|
||||
|
||||
------------------------------------------------------------------------------------------
|
||||
|
||||
procedure dash is
|
||||
begin
|
||||
terminal (grey, bold);
|
||||
put ("------------------------------------------------------------------------------------------");
|
||||
put ("------------------------------------------------------------------------------------------");
|
||||
terminal;
|
||||
new_line;
|
||||
end dash;
|
||||
|
||||
------------------------------------------------------------------------------------------
|
||||
|
||||
procedure semi_dash is
|
||||
begin
|
||||
terminal (grey, bold);
|
||||
put (" ");
|
||||
put ("------------------------------------------------------------------------------------------");
|
||||
terminal;
|
||||
new_line;
|
||||
end semi_dash;
|
||||
|
||||
------------------------------------------------------------------------------------------
|
||||
|
||||
procedure configure is
|
||||
begin
|
||||
echo (comment, "Configuring core game engine components...");
|
||||
--
|
||||
engine_configure;
|
||||
--
|
||||
hexagon_grid_sprite := load_sprite ("./sprite/ui/hexagon_grid_tile.png", 1, 1);
|
||||
@ -66,13 +114,6 @@ package body core is
|
||||
|
||||
------------------------------------------------------------------------------------------
|
||||
|
||||
function sigmoid (value : in boolean) return integer is
|
||||
begin
|
||||
return (if value then -1 else 1);
|
||||
end sigmoid;
|
||||
|
||||
------------------------------------------------------------------------------------------
|
||||
|
||||
function c_string (ada_string : string) return string is
|
||||
begin
|
||||
return (ada_string & character'val (0));
|
||||
|
@ -5,6 +5,19 @@ package core is
|
||||
|
||||
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
type terminal_colour is (
|
||||
grey, red, green, yellow, blue, pink,
|
||||
cyan, white
|
||||
);
|
||||
|
||||
type terminal_effect is (
|
||||
normal, bold, italic, underline, blink, invert
|
||||
);
|
||||
|
||||
type echo_status is (
|
||||
failure, warning, success, comment
|
||||
);
|
||||
|
||||
type signal_code is (
|
||||
signal_none, signal_space, signal_zero, signal_one, signal_two, signal_three,
|
||||
signal_four, signal_five, signal_six, signal_seven, signal_eight, signal_nine,
|
||||
@ -87,6 +100,13 @@ package core is
|
||||
|
||||
------------------------------------------------------------------------------------------
|
||||
|
||||
procedure terminal (colour : in terminal_colour := white; effect : in terminal_effect := normal);
|
||||
|
||||
procedure echo (status : in echo_status; message : in string);
|
||||
|
||||
procedure dash;
|
||||
procedure semi_dash;
|
||||
|
||||
procedure configure;
|
||||
procedure synchronize;
|
||||
|
||||
@ -95,7 +115,6 @@ package core is
|
||||
function flip_coin return integer;
|
||||
function roll_dice return integer;
|
||||
function by_chance (chance : in integer) return integer;
|
||||
function sigmoid (value : in boolean) return integer;
|
||||
function c_string (ada_string : in string) return string;
|
||||
|
||||
function clip (value, minimum, maximum : in integer) return integer;
|
||||
|
@ -11,7 +11,7 @@ package deity is
|
||||
|
||||
------------------------------------------------------------------------------------------
|
||||
|
||||
subtype piety_limit is natural range -30 .. 30;
|
||||
subtype piety_limit is integer range -30 .. 30;
|
||||
|
||||
type information is
|
||||
record
|
||||
|
@ -16,6 +16,8 @@ package body item is
|
||||
|
||||
procedure configure is
|
||||
begin
|
||||
core.echo (core.comment, "Configuring item components...");
|
||||
--
|
||||
for index in codex
|
||||
loop
|
||||
declare
|
||||
|
@ -16,6 +16,8 @@ package body magic is
|
||||
|
||||
procedure configure is
|
||||
begin
|
||||
core.echo (core.comment, "Configuring magic components...");
|
||||
--
|
||||
for index in codex
|
||||
loop
|
||||
declare
|
||||
|
@ -19,6 +19,13 @@ procedure main is
|
||||
|
||||
begin
|
||||
|
||||
core.dash;
|
||||
core.echo (core.comment, "Copyright (C) 2024 -- Ognjen 'xolatile' Milan Robovic");
|
||||
core.echo (core.comment, "Version -- 1.0.0");
|
||||
core.echo (core.comment, "License -- GNU/GPLv3+");
|
||||
core.echo (core.comment, "Xhads is free software, you can redistribute it and modify it under the terms of the GNU General Public License by Free Software Foundation.");
|
||||
core.dash;
|
||||
|
||||
core.configure;
|
||||
ui.configure;
|
||||
attribute.configure;
|
||||
@ -40,6 +47,8 @@ begin
|
||||
preview_height := core.window_height;
|
||||
ui.active := ui.steam;
|
||||
|
||||
core.echo (core.success, "Successfully initialized game data, entering main gameplay loop.");
|
||||
|
||||
gameplay: loop
|
||||
core.synchronize;
|
||||
--
|
||||
|
@ -16,6 +16,8 @@ package body might is
|
||||
|
||||
procedure configure is
|
||||
begin
|
||||
core.echo (core.comment, "Configuring might components...");
|
||||
--
|
||||
for index in codex
|
||||
loop
|
||||
declare
|
||||
|
@ -8,6 +8,8 @@ package body resource is
|
||||
|
||||
procedure configure is
|
||||
begin
|
||||
core.echo (core.comment, "Configuring resource components...");
|
||||
--
|
||||
for index in codex
|
||||
loop
|
||||
sprite (index) := core.load_sprite ("./sprite/resource/" & core.lowercase (codex'image (index)) & ".png", 1, 1);
|
||||
|
@ -8,6 +8,8 @@ package body skill is
|
||||
|
||||
procedure configure is
|
||||
begin
|
||||
core.echo (core.comment, "Configuring skill components...");
|
||||
--
|
||||
for index in codex
|
||||
loop
|
||||
sprite (index) := core.load_sprite ("./sprite/skill/" & core.lowercase (codex'image (index)) & ".png", 1, 1);
|
||||
|
@ -81,6 +81,8 @@ package body ui is
|
||||
end loop;
|
||||
end load_ui;
|
||||
begin
|
||||
core.echo (core.comment, "Configuring UI components...");
|
||||
--
|
||||
load_ui (default, "default/");
|
||||
load_ui (steam, "steam/");
|
||||
--
|
||||
|
@ -15,6 +15,8 @@ package body unit is
|
||||
|
||||
procedure configure is
|
||||
begin
|
||||
core.echo (core.comment, "Configuring unit components...");
|
||||
--
|
||||
for index in codex
|
||||
loop
|
||||
declare
|
||||
|
@ -30,6 +30,8 @@ package body world is
|
||||
|
||||
procedure configure is
|
||||
begin
|
||||
core.echo (core.comment, "Configuring world components...");
|
||||
--
|
||||
blocks := core.load_sprite ("./sprite/world/terrain/terrain.png", 1, 1);
|
||||
--
|
||||
for index in codex
|
||||
|
Loading…
Reference in New Issue
Block a user