From fbb99ad4aa0aca263dd2d5f717e744b6a77988a4 Mon Sep 17 00:00:00 2001 From: xolatile Date: Mon, 19 Feb 2024 14:10:00 -0500 Subject: [PATCH] Redoing squared grid loops, testing... --- source/core.adb | 20 ++++++++++++++++++++ source/main.adb | 8 ++++---- 2 files changed, 24 insertions(+), 4 deletions(-) diff --git a/source/core.adb b/source/core.adb index 15bf5eb..1b84645 100644 --- a/source/core.adb +++ b/source/core.adb @@ -197,12 +197,31 @@ package body core is line_v2 : constant integer := width / base - 1; crop_height : constant integer := ((height + base) / 2) mod base; full_vector : integer := 0; + --~horizontal : integer := 0; + --~vertical : integer := 0; + --~offset : integer := (if (height / base - 1) mod 2 = 1 then 16 else 0); begin for vertical in 0 .. line_v2 loop render_vector (offset_x + vertical * base, y, offset_x + vertical * base, y + crop_height); end loop; -- + --~while horizontal < y + height - base - offset + --~loop + --~render_vector (x, offset_y + horizontal, x + width, offset_y + horizontal); + --~-- + --~offset := (if offset = 0 then 16 else 0); + --~-- + --~horizontal := horizontal + base; + --~vertical := 0; + --~-- + --~while vertical < x + width - base - offset + --~loop + --~render_vector (offset_x + vertical + offset, horizontal - base / 2 + 1, offset_x + vertical + offset, horizontal + base / 2 + 1); + --~-- + --~vertical := vertical + base; + --~end loop; + --~end loop; for horizontal in 0 .. line_h loop render_vector (x, offset_y + horizontal * base, x + width, offset_y + horizontal * base); @@ -223,6 +242,7 @@ package body core is 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; diff --git a/source/main.adb b/source/main.adb index 4c7c31e..eb7058e 100644 --- a/source/main.adb +++ b/source/main.adb @@ -93,8 +93,8 @@ begin core.draw_central_grid (preview_x, preview_y, preview_width - 2 * preview_x, preview_height - 2 * preview_y); core.draw_squared_grid (preview_x, preview_y, preview_width - 2 * preview_x, preview_height - 2 * preview_y); -- - ui.draw_menu (0, 0, preview_width, preview_height, false); - ui.draw_tiny_menu (preview_width, 0, side_panel, preview_height, true); + --~ui.draw_menu (0, 0, preview_width, preview_height, false); + --~ui.draw_tiny_menu (preview_width, 0, side_panel, preview_height, true); -- --~for this in magic.blow_away .. magic.thunderclap loop magic.draw (this, 112 * (magic.codex'pos (this) - magic.codex'pos (magic.chain_magic_arrow)) - 60, 112 * 0 + 64); end loop; --~for this in magic.agony_mass .. magic.weakness loop magic.draw (this, 112 * (magic.codex'pos (this) - magic.codex'pos (magic.thunderclap)) - 60, 112 * 1 + 64); end loop; @@ -111,8 +111,8 @@ begin -- core.draw_state_box (preview_width + 32, 32); -- - menu.draw (menu.attribute_information, 100, 100); - menu.draw (menu.resource_information, 600, 100); + --~menu.draw (menu.attribute_information, 100, 100); + --~menu.draw (menu.resource_information, 600, 100); end loop gameplay; ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------