More code refactoring...

This commit is contained in:
Ognjen Milan Robovic 2024-05-27 12:59:41 -04:00
parent 4cd99a1003
commit 632916444f
4 changed files with 26 additions and 26 deletions

View File

@ -419,8 +419,8 @@ package body core is
------------------------------------------------------------------------------------------
procedure increment (value : in out integer) is begin value := value + 1; end increment;
procedure decrement (value : in out integer) is begin value := value - 1; end decrement;
procedure increment (value : in out integer; super : in natural := 1) is begin value := value + super; end increment;
procedure decrement (value : in out integer; super : in natural := 1) is begin value := value - super; end decrement;
------------------------------------------------------------------------------------------

View File

@ -189,8 +189,8 @@ package core is
procedure save_point (here : in core.io.file_type; data : in point);
procedure load_point (here : in core.io.file_type; data : out point);
procedure increment (value : in out integer);
procedure decrement (value : in out integer);
procedure increment (value : in out integer; super : in natural := 1);
procedure decrement (value : in out integer; super : in natural := 1);
procedure idle_skip;

View File

@ -89,7 +89,7 @@ package body world is
end loop;
end loop;
--
if core.animation_time = 0 then draw_tiles_timer := core.time - time; end if;
if core.animation_time = 0 then draw_tiles_timer := natural (1_000_000.0 * (core.time - time)); end if;
end draw_tiles;
------------------------------------------------------------------------------------------
@ -156,7 +156,7 @@ package body world is
end if;
end loop;
--
if core.animation_time = 0 then draw_landmarks_timer := core.time - time; end if;
if core.animation_time = 0 then draw_landmarks_timer := natural (1_000_000.0 * (core.time - time)); end if;
end draw_landmarks;
------------------------------------------------------------------------------------------
@ -204,7 +204,7 @@ package body world is
end if;
end loop;
--
if core.animation_time = 0 then draw_locations_timer := core.time - time; end if;
if core.animation_time = 0 then draw_locations_timer := natural (1_000_000.0 * (core.time - time)); end if;
end draw_locations;
------------------------------------------------------------------------------------------
@ -226,7 +226,7 @@ package body world is
end if;
end loop;
--
if core.animation_time = 0 then draw_constructions_timer := core.time - time; end if;
if core.animation_time = 0 then draw_constructions_timer := natural (1_000_000.0 * (core.time - time)); end if;
end draw_constructions;
------------------------------------------------------------------------------------------
@ -257,7 +257,7 @@ package body world is
end if;
end loop;
--
if core.animation_time = 0 then draw_equipments_timer := core.time - time; end if;
if core.animation_time = 0 then draw_equipments_timer := natural (1_000_000.0 * (core.time - time)); end if;
end draw_equipments;
------------------------------------------------------------------------------------------
@ -290,7 +290,7 @@ package body world is
end if;
end loop;
--
if core.animation_time = 0 then draw_units_timer := core.time - time; end if;
if core.animation_time = 0 then draw_units_timer := natural (1_000_000.0 * (core.time - time)); end if;
end draw_units;
------------------------------------------------------------------------------------------
@ -316,7 +316,7 @@ package body world is
end loop;
end loop;
--
if core.animation_time = 0 then draw_views_timer := core.time - time; end if;
if core.animation_time = 0 then draw_views_timer := natural (1_000_000.0 * (core.time - time)); end if;
end darken_map;
------------------------------------------------------------------------------------------
@ -656,7 +656,7 @@ package body world is
draw_units (offset, view_from, view_to);
darken_map (offset, view_from, view_to);
--
if core.animation_time = 0 then draw_world_timer := core.time - time; end if;
if core.animation_time = 0 then draw_world_timer := natural (1_000_000.0 * (core.time - time)); end if;
end draw;
------------------------------------------------------------------------------------------
@ -757,12 +757,12 @@ package body world is
------------------------------------------------------------------------------------------
procedure resource_cheat_1 is begin map.chads (1).resources (resource.gold) := map.chads (1).resources (resource.gold) + 127; end resource_cheat_1;
procedure resource_cheat_2 is begin map.chads (1).resources (resource.wood) := map.chads (1).resources (resource.wood) + 127; end resource_cheat_2;
procedure resource_cheat_3 is begin map.chads (1).resources (resource.stone) := map.chads (1).resources (resource.stone) + 127; end resource_cheat_3;
procedure resource_cheat_4 is begin map.chads (1).resources (resource.metal) := map.chads (1).resources (resource.metal) + 127; end resource_cheat_4;
procedure resource_cheat_5 is begin map.chads (1).resources (resource.leather) := map.chads (1).resources (resource.leather) + 127; end resource_cheat_5;
procedure resource_cheat_6 is begin map.chads (1).resources (resource.gem) := map.chads (1).resources (resource.gem) + 127; end resource_cheat_6;
procedure resource_cheat_1 is begin core.increment (map.chads (1).resources (resource.gold).value, 20); end resource_cheat_1;
procedure resource_cheat_2 is begin core.increment (map.chads (1).resources (resource.wood).value, 10); end resource_cheat_2;
procedure resource_cheat_3 is begin core.increment (map.chads (1).resources (resource.stone).value, 10); end resource_cheat_3;
procedure resource_cheat_4 is begin core.increment (map.chads (1).resources (resource.metal).value, 10); end resource_cheat_4;
procedure resource_cheat_5 is begin core.increment (map.chads (1).resources (resource.leather).value, 10); end resource_cheat_5;
procedure resource_cheat_6 is begin core.increment (map.chads (1).resources (resource.gem).value, 10); end resource_cheat_6;
------------------------------------------------------------------------------------------

View File

@ -114,14 +114,14 @@ package world is
map : information;
draw_tiles_timer : float := 0.0;
draw_views_timer : float := 0.0;
draw_landmarks_timer : float := 0.0;
draw_locations_timer : float := 0.0;
draw_constructions_timer : float := 0.0;
draw_equipments_timer : float := 0.0;
draw_units_timer : float := 0.0;
draw_world_timer : float := 0.0;
draw_tiles_timer : natural := 0;
draw_views_timer : natural := 0;
draw_landmarks_timer : natural := 0;
draw_locations_timer : natural := 0;
draw_constructions_timer : natural := 0;
draw_equipments_timer : natural := 0;
draw_units_timer : natural := 0;
draw_world_timer : natural := 0;
drawn_tiles : natural := 0;
drawn_views : natural := 0;