More sprite modificaitons and resizable window...

This commit is contained in:
Ognjen Milan Robovic 2024-05-01 15:19:12 -04:00
parent a21e9429cd
commit 1ab1daff56
11 changed files with 58 additions and 14 deletions

View File

@ -244,11 +244,15 @@ package body core is
-- --
echo (comment, "-- Setting trace log level to none (ignoring all default Raylib logs)."); echo (comment, "-- Setting trace log level to none (ignoring all default Raylib logs).");
ray.set_trace_log_level (ray.log_none); ray.set_trace_log_level (ray.log_none);
--
ray.set_window_flags (ray.flag_window_resizable);
--
echo (comment, "-- Initializing Raylib window data..."); echo (comment, "-- Initializing Raylib window data...");
echo (comment, "-- -- Window title : Chads of Might & Magic"); echo (comment, "-- -- Window title : Chads of Might & Magic");
echo (comment, "-- -- Window width : 1800"); echo (comment, "-- -- Window width : 1800");
echo (comment, "-- -- Window height : 900"); echo (comment, "-- -- Window height : 900");
ray.open_window (1800, 900, "Chads of Might & Magic"); ray.open_window (1800, 900, "Chads of Might & Magic");
--
echo (comment, "-- Initializing Raylib audio device data..."); echo (comment, "-- Initializing Raylib audio device data...");
ray.open_audio_device; ray.open_audio_device;
-- --

View File

@ -10,12 +10,10 @@ procedure main is
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
side_panel : integer := 480; side_panel : integer := 0;
preview_x : integer := 64;
preview_y : integer := 64;
preview_width : integer := 0; preview_width : integer := 0;
preview_height : integer := 0; preview_height : integer := 0;
text_box_height : integer := 32; text_box_height : integer := 0;
player : chad.information := chad.trait (chad.ognjen); player : chad.information := chad.trait (chad.ognjen);
@ -135,9 +133,6 @@ begin
world.make (world.rough, 40, 20); world.make (world.rough, 40, 20);
preview_width := core.window_width - side_panel;
preview_height := core.window_height - text_box_height;
core.dash; core.dash;
core.echo (core.success, "Successfully initialized game data, entering main gameplay loop."); core.echo (core.success, "Successfully initialized game data, entering main gameplay loop.");
core.dash; core.dash;
@ -149,6 +144,11 @@ begin
-- --
exit when core.engine_active = false; exit when core.engine_active = false;
-- --
side_panel := core.window_width / 4;
preview_width := core.window_width - side_panel;
preview_height := core.window_height - text_box_height;
text_box_height := 32;
--
core.camera.x := core.clip (core.camera.x, 0, world.width - 1); core.camera.x := core.clip (core.camera.x, 0, world.width - 1);
core.camera.y := core.clip (core.camera.y, 0, world.height - 1); core.camera.y := core.clip (core.camera.y, 0, world.height - 1);
-- --

View File

@ -17,6 +17,46 @@ package ray is
for logical'size use 32; for logical'size use 32;
for colour_range'size use 8; for colour_range'size use 8;
type window_flag is (
flag_none,
flag_fullscreen_mode,
flag_window_resizable,
flag_window_undecorated,
flag_window_transparent,
flag_msaa_x4_hint,
flag_vsync_hint,
flag_window_hidden,
flag_window_always_run,
flag_window_minimized,
flag_window_maximized,
flag_window_unfocused,
flag_window_topmost,
flag_window_high_dpi,
flag_window_mouse_passthrough,
flag_borderless_windowed_mode,
flag_interlaced_hint
) with convention => c;
for window_flag use (
flag_none => 16#00000000#, -- 0
flag_fullscreen_mode => 16#00000002#, -- 2
flag_window_resizable => 16#00000004#, -- 4
flag_window_undecorated => 16#00000008#, -- 8
flag_window_transparent => 16#00000010#, -- 16
flag_msaa_x4_hint => 16#00000020#, -- 32
flag_vsync_hint => 16#00000040#, -- 64
flag_window_hidden => 16#00000080#, -- 128
flag_window_always_run => 16#00000100#, -- 256
flag_window_minimized => 16#00000200#, -- 512
flag_window_maximized => 16#00000400#, -- 1024
flag_window_unfocused => 16#00000800#, -- 2048
flag_window_topmost => 16#00001000#, -- 4096
flag_window_high_dpi => 16#00002000#, -- 8192
flag_window_mouse_passthrough => 16#00004000#, -- 16384
flag_borderless_windowed_mode => 16#00008000#, -- 32768
flag_interlaced_hint => 16#00010000# -- 65536
);
type trace_log_level is ( type trace_log_level is (
log_all, log_trace, log_debug, log_info, log_warning, log_error, log_all, log_trace, log_debug, log_info, log_warning, log_error,
log_fatal, log_none log_fatal, log_none
@ -39,6 +79,8 @@ package ray is
no_font : font; no_font : font;
no_sound : sound; no_sound : sound;
procedure set_window_flags (flags : window_flag := flag_none) with import => true, convention => c, external_name => "SetConfigFlags";
procedure open_window (width, height : in integer; title : in string) with import => true, convention => c, external_name => "InitWindow"; procedure open_window (width, height : in integer; title : in string) with import => true, convention => c, external_name => "InitWindow";
procedure close_window with import => true, convention => c, external_name => "CloseWindow"; procedure close_window with import => true, convention => c, external_name => "CloseWindow";

View File

@ -182,8 +182,6 @@ package body ui is
procedure synchronize is procedure synchronize is
begin begin
prioritize := false;
--
for index in 0 .. structure_limit loop for index in 0 .. structure_limit loop
exit when index = structure_count; exit when index = structure_count;
-- --
@ -193,7 +191,6 @@ package body ui is
-- --
if structure_array (index).show then if structure_array (index).show then
draw_structure (structure_array (index)); draw_structure (structure_array (index));
prioritize := true;
end if; end if;
end loop; end loop;
end synchronize; end synchronize;

View File

@ -131,13 +131,14 @@ package body world is
width => core.base-1, width => core.base-1,
height => core.base-1); height => core.base-1);
-- --
if core.cursor.x > offset.x + (move_x - core.camera.x) * core.base * core.zoom if core.cursor.x > offset.x + (move_x - core.camera.x ) * core.base * core.zoom
and core.cursor.x < offset.x + (move_x - core.camera.x) * core.base * core.zoom + core.base * core.zoom and core.cursor.x < offset.x + (move_x - core.camera.x + 1) * core.base * core.zoom
and core.cursor.y > offset.y + (move_y - core.camera.y) * core.base * core.zoom and core.cursor.y > offset.y + (move_y - core.camera.y ) * core.base * core.zoom
and core.cursor.y < offset.y + (move_y - core.camera.y) * core.base * core.zoom + core.base * core.zoom and core.cursor.y < offset.y + (move_y - core.camera.y + 1) * core.base * core.zoom
and core.cursor_mode = 1 and not ui.prioritize then and core.cursor_mode = 1 and not ui.prioritize then
core.camera.x := move_x; core.camera.x := move_x;
core.camera.y := move_y; core.camera.y := move_y;
core.cursor_mode := 0;
end if; end if;
end loop; end loop;
end loop; end loop;

Binary file not shown.

Before

Width:  |  Height:  |  Size: 840 B

After

Width:  |  Height:  |  Size: 876 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 836 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 798 B

After

Width:  |  Height:  |  Size: 836 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 344 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 404 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 274 B