Added copied greave icons and world profiling...
Before Width: | Height: | Size: 310 B After Width: | Height: | Size: 273 B |
Before Width: | Height: | Size: 329 B After Width: | Height: | Size: 251 B |
Before Width: | Height: | Size: 310 B After Width: | Height: | Size: 249 B |
Before Width: | Height: | Size: 329 B After Width: | Height: | Size: 258 B |
Before Width: | Height: | Size: 329 B After Width: | Height: | Size: 270 B |
Before Width: | Height: | Size: 329 B After Width: | Height: | Size: 235 B |
Before Width: | Height: | Size: 310 B After Width: | Height: | Size: 225 B |
Before Width: | Height: | Size: 329 B After Width: | Height: | Size: 243 B |
Before Width: | Height: | Size: 310 B After Width: | Height: | Size: 245 B |
Before Width: | Height: | Size: 310 B After Width: | Height: | Size: 231 B |
@ -147,6 +147,13 @@ package body core is
|
|||||||
|
|
||||||
------------------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
|
function time return float is
|
||||||
|
begin
|
||||||
|
return float (ray.get_time);
|
||||||
|
end time;
|
||||||
|
|
||||||
|
------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
function c_string (ada_string : string) return string is
|
function c_string (ada_string : string) return string is
|
||||||
begin
|
begin
|
||||||
return (ada_string & character'val (0));
|
return (ada_string & character'val (0));
|
||||||
|
@ -125,6 +125,8 @@ package core is
|
|||||||
procedure dash;
|
procedure dash;
|
||||||
procedure semi_dash;
|
procedure semi_dash;
|
||||||
|
|
||||||
|
function time return float;
|
||||||
|
|
||||||
function c_string (ada_string : in string) return string;
|
function c_string (ada_string : in string) return string;
|
||||||
|
|
||||||
function random (minimum, maximum : in integer) return integer;
|
function random (minimum, maximum : in integer) return integer;
|
||||||
|
@ -320,6 +320,23 @@ begin
|
|||||||
--
|
--
|
||||||
ui.write (core.framerate'image, core.window_width - 5 * core.icon + 3, core.window_height - 27);
|
ui.write (core.framerate'image, core.window_width - 5 * core.icon + 3, core.window_height - 27);
|
||||||
--
|
--
|
||||||
|
ui.write ("draw_tiles_timer :" & world.draw_tiles_timer'image, 1400, 700 - 40, size => 15, code => true);
|
||||||
|
ui.write ("draw_views_timer :" & world.draw_views_timer'image, 1400, 720 - 40, size => 15, code => true);
|
||||||
|
ui.write ("draw_landmarks_timer :" & world.draw_landmarks_timer'image, 1400, 740 - 40, size => 15, code => true);
|
||||||
|
ui.write ("draw_locations_timer :" & world.draw_locations_timer'image, 1400, 760 - 40, size => 15, code => true);
|
||||||
|
ui.write ("draw_constructions_timer :" & world.draw_constructions_timer'image, 1400, 780 - 40, size => 15, code => true);
|
||||||
|
ui.write ("draw_equipments_timer :" & world.draw_equipments_timer'image, 1400, 800 - 40, size => 15, code => true);
|
||||||
|
ui.write ("draw_units_timer :" & world.draw_units_timer'image, 1400, 820 - 40, size => 15, code => true);
|
||||||
|
ui.write ("draw_world_timer :" & world.draw_world_timer'image, 1400, 840 - 40, size => 15, code => true);
|
||||||
|
--
|
||||||
|
ui.write (world.drawn_tiles'image, 1360, 700 - 40, size => 15, code => true, tint => (255, 0, 0, 255));
|
||||||
|
ui.write (world.drawn_views'image, 1360, 720 - 40, size => 15, code => true, tint => (255, 0, 0, 255));
|
||||||
|
ui.write (world.drawn_landmarks'image, 1360, 740 - 40, size => 15, code => true, tint => (255, 0, 0, 255));
|
||||||
|
ui.write (world.drawn_locations'image, 1360, 760 - 40, size => 15, code => true, tint => (255, 0, 0, 255));
|
||||||
|
ui.write (world.drawn_constructions'image, 1360, 780 - 40, size => 15, code => true, tint => (255, 0, 0, 255));
|
||||||
|
ui.write (world.drawn_equipments'image, 1360, 800 - 40, size => 15, code => true, tint => (255, 0, 0, 255));
|
||||||
|
ui.write (world.drawn_units'image, 1360, 820 - 40, size => 15, code => true, tint => (255, 0, 0, 255));
|
||||||
|
--
|
||||||
core.camera.x := world.map.chads (1).x;
|
core.camera.x := world.map.chads (1).x;
|
||||||
core.camera.y := world.map.chads (1).y;
|
core.camera.y := world.map.chads (1).y;
|
||||||
--
|
--
|
||||||
|
@ -179,8 +179,10 @@ package ray is
|
|||||||
procedure set_window_maximal_size (width, height : in integer) with import => true, convention => c, external_name => "SetWindowMaxSize";
|
procedure set_window_maximal_size (width, height : in integer) with import => true, convention => c, external_name => "SetWindowMaxSize";
|
||||||
procedure set_window_size (width, height : in integer) with import => true, convention => c, external_name => "SetWindowSize";
|
procedure set_window_size (width, height : in integer) with import => true, convention => c, external_name => "SetWindowSize";
|
||||||
|
|
||||||
--~double GetTime(void);
|
function get_time return long_float with import => true, convention => c, external_name => "GetTime";
|
||||||
|
|
||||||
--~void OpenURL(const char *url);
|
--~void OpenURL(const char *url);
|
||||||
|
|
||||||
function load_text (file : in string) return char_array with import => true, convention => c, external_name => "LoadFileText";
|
function load_text (file : in string) return char_array with import => true, convention => c, external_name => "LoadFileText";
|
||||||
|
|
||||||
function mouse_wheel_move return float with import => true, convention => c, external_name => "GetMouseWheelMove";
|
function mouse_wheel_move return float with import => true, convention => c, external_name => "GetMouseWheelMove";
|
||||||
|
@ -357,7 +357,21 @@ package body world is
|
|||||||
procedure draw is
|
procedure draw is
|
||||||
offset : core.vector := ((core.window_width - core.base) / 2,
|
offset : core.vector := ((core.window_width - core.base) / 2,
|
||||||
(core.window_height - core.base) / 2);
|
(core.window_height - core.base) / 2);
|
||||||
|
--
|
||||||
|
time_0 : float := 0.0;
|
||||||
|
time_1 : float := 0.0;
|
||||||
begin
|
begin
|
||||||
|
time_0 := core.time;
|
||||||
|
time_1 := core.time;
|
||||||
|
--
|
||||||
|
drawn_tiles := 0;
|
||||||
|
drawn_views := 0;
|
||||||
|
drawn_landmarks := 0;
|
||||||
|
drawn_locations := 0;
|
||||||
|
drawn_constructions := 0;
|
||||||
|
drawn_equipments := 0;
|
||||||
|
drawn_units := 0;
|
||||||
|
--
|
||||||
for vertical in 0 .. map.height - 1 loop
|
for vertical in 0 .. map.height - 1 loop
|
||||||
exit when offset.y + (vertical - core.camera.y) * core.base * core.zoom > core.window_height;
|
exit when offset.y + (vertical - core.camera.y) * core.base * core.zoom > core.window_height;
|
||||||
--
|
--
|
||||||
@ -401,7 +415,9 @@ package body world is
|
|||||||
width => core.base,
|
width => core.base,
|
||||||
height => core.base,
|
height => core.base,
|
||||||
ignore => true);
|
ignore => true);
|
||||||
--~--
|
--
|
||||||
|
core.increment (drawn_tiles);
|
||||||
|
--
|
||||||
if core.cursor.x > offset.x + (horizontal - core.camera.x ) * core.base * core.zoom - 6
|
if core.cursor.x > offset.x + (horizontal - core.camera.x ) * core.base * core.zoom - 6
|
||||||
and core.cursor.x < offset.x + (horizontal - core.camera.x + 1) * core.base * core.zoom + 6
|
and core.cursor.x < offset.x + (horizontal - core.camera.x + 1) * core.base * core.zoom + 6
|
||||||
and core.cursor.y > offset.y + (vertical - core.camera.y ) * core.base * core.zoom - 6
|
and core.cursor.y > offset.y + (vertical - core.camera.y ) * core.base * core.zoom - 6
|
||||||
@ -416,11 +432,16 @@ package body world is
|
|||||||
end loop;
|
end loop;
|
||||||
end loop;
|
end loop;
|
||||||
--
|
--
|
||||||
|
if core.animation_time = 0 then draw_tiles_timer := core.time - time_0; time_0 := core.time; end if;
|
||||||
|
--
|
||||||
for index in 1 .. landmark_limit loop
|
for index in 1 .. landmark_limit loop
|
||||||
if map.views (map.landmarks (index).x, map.landmarks (index).y) then
|
if map.views (map.landmarks (index).x, map.landmarks (index).y) then
|
||||||
core.draw (data => landmarks (landmark_index'val (map.landmarks (index).index)),
|
core.draw (data => landmarks (landmark_index'val (map.landmarks (index).index)),
|
||||||
x => offset.x + (map.landmarks (index).x - core.camera.x) * core.base * core.zoom,
|
x => offset.x + (map.landmarks (index).x - core.camera.x) * core.base * core.zoom,
|
||||||
y => offset.y + (map.landmarks (index).y - core.camera.y) * core.base * core.zoom);
|
y => offset.y + (map.landmarks (index).y - core.camera.y) * core.base * core.zoom);
|
||||||
|
--
|
||||||
|
core.increment (drawn_landmarks);
|
||||||
|
--
|
||||||
if core.cursor_inside (x => offset.x + (map.landmarks (index).x - core.camera.x) * core.base * core.zoom,
|
if core.cursor_inside (x => offset.x + (map.landmarks (index).x - core.camera.x) * core.base * core.zoom,
|
||||||
y => offset.y + (map.landmarks (index).y - core.camera.y) * core.base * core.zoom,
|
y => offset.y + (map.landmarks (index).y - core.camera.y) * core.base * core.zoom,
|
||||||
width => landmarks (landmark_index'val (map.landmarks (index).index)).width,
|
width => landmarks (landmark_index'val (map.landmarks (index).index)).width,
|
||||||
@ -432,12 +453,17 @@ package body world is
|
|||||||
end if;
|
end if;
|
||||||
end loop;
|
end loop;
|
||||||
--
|
--
|
||||||
|
if core.animation_time = 0 then draw_landmarks_timer := core.time - time_0; time_0 := core.time; end if;
|
||||||
|
--
|
||||||
for index in 1 .. location_limit loop
|
for index in 1 .. location_limit loop
|
||||||
if map.views (map.locations (index).x, map.locations (index).y) then
|
if map.views (map.locations (index).x, map.locations (index).y) then
|
||||||
core.draw (data => locations (location_index'val (map.locations (index).index)),
|
core.draw (data => locations (location_index'val (map.locations (index).index)),
|
||||||
x => offset.x + (map.locations (index).x - core.camera.x) * core.base * core.zoom,
|
x => offset.x + (map.locations (index).x - core.camera.x) * core.base * core.zoom,
|
||||||
y => offset.y + (map.locations (index).y - core.camera.y) * core.base * core.zoom,
|
y => offset.y + (map.locations (index).y - core.camera.y) * core.base * core.zoom,
|
||||||
state => core.animation'val (map.locations (index).state));
|
state => core.animation'val (map.locations (index).state));
|
||||||
|
--
|
||||||
|
core.increment (drawn_locations);
|
||||||
|
--
|
||||||
if core.cursor_inside (x => offset.x + (map.locations (index).x - core.camera.x) * core.base * core.zoom,
|
if core.cursor_inside (x => offset.x + (map.locations (index).x - core.camera.x) * core.base * core.zoom,
|
||||||
y => offset.y + (map.locations (index).y - core.camera.y) * core.base * core.zoom,
|
y => offset.y + (map.locations (index).y - core.camera.y) * core.base * core.zoom,
|
||||||
width => locations (location_index'val (map.locations (index).index)).width,
|
width => locations (location_index'val (map.locations (index).index)).width,
|
||||||
@ -465,20 +491,28 @@ package body world is
|
|||||||
end if;
|
end if;
|
||||||
end loop;
|
end loop;
|
||||||
--
|
--
|
||||||
|
if core.animation_time = 0 then draw_locations_timer := core.time - time_0; time_0 := core.time; end if;
|
||||||
|
--
|
||||||
for index in 1 .. construction_limit loop
|
for index in 1 .. construction_limit loop
|
||||||
if map.views (map.constructions (index).x, map.constructions (index).y) then
|
if map.views (map.constructions (index).x, map.constructions (index).y) then
|
||||||
construction.draw_plus (construction.enumeration'val (map.constructions (index).index),
|
construction.draw_plus (construction.enumeration'val (map.constructions (index).index),
|
||||||
offset.x + (map.constructions (index).x - core.camera.x) * core.base * core.zoom,
|
offset.x + (map.constructions (index).x - core.camera.x) * core.base * core.zoom,
|
||||||
offset.y + (map.constructions (index).y - core.camera.y) * core.base * core.zoom);
|
offset.y + (map.constructions (index).y - core.camera.y) * core.base * core.zoom);
|
||||||
|
--
|
||||||
|
core.increment (drawn_constructions);
|
||||||
end if;
|
end if;
|
||||||
end loop;
|
end loop;
|
||||||
--
|
--
|
||||||
|
if core.animation_time = 0 then draw_constructions_timer := core.time - time_0; time_0 := core.time; end if;
|
||||||
|
--
|
||||||
for index in 1 .. equipment_limit loop
|
for index in 1 .. equipment_limit loop
|
||||||
if map.views (map.equipments (index).x, map.equipments (index).y) then
|
if map.views (map.equipments (index).x, map.equipments (index).y) then
|
||||||
equipment.draw_plus (equipment.enumeration'val (map.equipments (index).index),
|
equipment.draw_plus (equipment.enumeration'val (map.equipments (index).index),
|
||||||
core.idle,
|
core.idle,
|
||||||
offset.x + (map.equipments (index).x - core.camera.x) * core.base * core.zoom,
|
offset.x + (map.equipments (index).x - core.camera.x) * core.base * core.zoom,
|
||||||
offset.y + (map.equipments (index).y - core.camera.y) * core.base * core.zoom);
|
offset.y + (map.equipments (index).y - core.camera.y) * core.base * core.zoom);
|
||||||
|
--
|
||||||
|
core.increment (drawn_equipments);
|
||||||
end if;
|
end if;
|
||||||
--
|
--
|
||||||
if map.equipments (index).x = core.camera.x
|
if map.equipments (index).x = core.camera.x
|
||||||
@ -490,15 +524,21 @@ package body world is
|
|||||||
end if;
|
end if;
|
||||||
end loop;
|
end loop;
|
||||||
--
|
--
|
||||||
|
if core.animation_time = 0 then draw_equipments_timer := core.time - time_0; time_0 := core.time; end if;
|
||||||
|
--
|
||||||
for index in 1 .. unit_limit loop
|
for index in 1 .. unit_limit loop
|
||||||
if map.views (map.units (index).x, map.units (index).y) then
|
if map.views (map.units (index).x, map.units (index).y) then
|
||||||
unit.draw (unit.enumeration'val (map.units (index).index),
|
unit.draw (unit.enumeration'val (map.units (index).index),
|
||||||
core.animation'val (map.units (index).state),
|
core.animation'val (map.units (index).state),
|
||||||
offset.x + (map.units (index).x - core.camera.x) * core.base * core.zoom,
|
offset.x + (map.units (index).x - core.camera.x) * core.base * core.zoom,
|
||||||
offset.y + (map.units (index).y - core.camera.y) * core.base * core.zoom);
|
offset.y + (map.units (index).y - core.camera.y) * core.base * core.zoom);
|
||||||
|
--
|
||||||
|
core.increment (drawn_units);
|
||||||
end if;
|
end if;
|
||||||
end loop;
|
end loop;
|
||||||
--
|
--
|
||||||
|
if core.animation_time = 0 then draw_units_timer := core.time - time_0; time_0 := core.time; end if;
|
||||||
|
--
|
||||||
for index in 1 .. map.chad_count loop
|
for index in 1 .. map.chad_count loop
|
||||||
if map.views (map.chads (index).x, map.chads (index).y) then
|
if map.views (map.chads (index).x, map.chads (index).y) then
|
||||||
chad.draw (map.chads (index),
|
chad.draw (map.chads (index),
|
||||||
@ -517,9 +557,14 @@ package body world is
|
|||||||
core.draw (data => dark,
|
core.draw (data => dark,
|
||||||
x => offset.x + (horizontal - core.camera.x) * core.base * core.zoom,
|
x => offset.x + (horizontal - core.camera.x) * core.base * core.zoom,
|
||||||
y => offset.y + (vertical - core.camera.y) * core.base * core.zoom);
|
y => offset.y + (vertical - core.camera.y) * core.base * core.zoom);
|
||||||
|
--
|
||||||
|
core.increment (drawn_views);
|
||||||
end if;
|
end if;
|
||||||
end loop;
|
end loop;
|
||||||
end loop;
|
end loop;
|
||||||
|
--
|
||||||
|
if core.animation_time = 0 then draw_views_timer := core.time - time_0; end if;
|
||||||
|
if core.animation_time = 0 then draw_world_timer := core.time - time_1; end if;
|
||||||
end draw;
|
end draw;
|
||||||
|
|
||||||
------------------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------
|
||||||
|
@ -114,6 +114,23 @@ package world is
|
|||||||
|
|
||||||
map : information;
|
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;
|
||||||
|
|
||||||
|
drawn_tiles : natural := 0;
|
||||||
|
drawn_views : natural := 0;
|
||||||
|
drawn_landmarks : natural := 0;
|
||||||
|
drawn_locations : natural := 0;
|
||||||
|
drawn_constructions : natural := 0;
|
||||||
|
drawn_equipments : natural := 0;
|
||||||
|
drawn_units : natural := 0;
|
||||||
|
|
||||||
------------------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------
|
||||||
|
|
||||||
procedure configure;
|
procedure configure;
|
||||||
|