Finished squared grid drawing procedure...

This commit is contained in:
Ognjen Milan Robovic 2024-02-18 08:41:23 -05:00
parent 975449dc29
commit 7a9b47592f

View File

@ -190,31 +190,44 @@ package body core is
------------------------------------------------------------------------------------------
procedure draw_squared_grid (x, y, width, height : in integer) is
offset_x : constant integer := x + base / 2 + (width mod base) / 2;
offset_y : constant integer := y + base / 2 + (height mod base) / 2;
full_vector, crop_vector : integer;
offset_x : constant integer := x + base / 2 + (width mod base) / 2;
offset_y : constant integer := y + base / 2 + (height mod base) / 2;
line_h : constant integer := height / base - 1;
line_v1 : constant integer := width / base;
line_v2 : constant integer := width / base - 1;
crop_height : constant integer := ((height + base) / 2) mod base;
full_vector : integer;
begin
for horizontal in 0 .. height / base - 1
for vertical in 0 .. line_v2
loop
render_vector (offset_x + vertical * base, y, offset_x + vertical * base, y + crop_height);
--~render_vector (offset_x + vertical * base - base / 2, y, offset_x + vertical * base - base / 2, y + crop_height);
end loop;
--
for horizontal in 0 .. line_h
loop
render_vector (x, offset_y + horizontal * base, x + width, offset_y + horizontal * base);
--
for vertical in 0 .. width / base - 1
for vertical in 0 .. line_v1
loop
full_vector := y + 2 * base * (horizontal / 2) - ((y + height) mod base) / 2;
--
render_vector (offset_x + vertical * base, full_vector, offset_x + vertical * base, full_vector + base);
render_vector (offset_x + vertical * base + base / 2, full_vector + base, offset_x + vertical * base + base / 2, full_vector + base + base);
render_vector (offset_x + vertical * base - base / 2, full_vector + base, offset_x + vertical * base - base / 2, full_vector + 2 * base);
end loop;
--
--~render_vector (offset_x + vertical * base, full_vector, offset_x + vertical * base, full_vector + base);
--~render_vector (offset_x + (width / base) * base, full_vector + 2 * base, offset_x + (width / base) * base, full_vector + 2 * base + base);
if horizontal > 1 then
for vertical in 0 .. line_v2
loop
full_vector := y + 2 * base * (horizontal / 2) - ((y + height) mod base) / 2;
--
render_vector (offset_x + vertical * base, full_vector, offset_x + vertical * base, full_vector + base);
end loop;
end if;
end loop;
for vertical in 0 .. width / base - 1
loop
full_vector := y + 2 * base * ((height / base) / 2) - ((y + height) mod base) / 2;
--
render_vector (offset_x + vertical * base, full_vector, offset_x + vertical * base, full_vector + base);
--~render_vector (offset_x + vertical * base + base / 2, full_vector + base, offset_x + vertical * base + base / 2, full_vector + base + base);
render_vector (offset_x + vertical * base, full_vector, offset_x + vertical * base, full_vector + crop_height);
end loop;
end draw_squared_grid;