diff --git a/source/core.adb b/source/core.adb index 0f09cef..0599263 100644 --- a/source/core.adb +++ b/source/core.adb @@ -244,11 +244,15 @@ package body core is -- echo (comment, "-- Setting trace log level to none (ignoring all default Raylib logs)."); ray.set_trace_log_level (ray.log_none); + -- + ray.set_window_flags (ray.flag_window_resizable); + -- echo (comment, "-- Initializing Raylib window data..."); echo (comment, "-- -- Window title : Chads of Might & Magic"); echo (comment, "-- -- Window width : 1800"); echo (comment, "-- -- Window height : 900"); ray.open_window (1800, 900, "Chads of Might & Magic"); + -- echo (comment, "-- Initializing Raylib audio device data..."); ray.open_audio_device; -- diff --git a/source/main.adb b/source/main.adb index ffc723f..96d3ec9 100644 --- a/source/main.adb +++ b/source/main.adb @@ -10,12 +10,10 @@ procedure main is ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - side_panel : integer := 480; - preview_x : integer := 64; - preview_y : integer := 64; + side_panel : integer := 0; preview_width : integer := 0; preview_height : integer := 0; - text_box_height : integer := 32; + text_box_height : integer := 0; player : chad.information := chad.trait (chad.ognjen); @@ -135,9 +133,6 @@ begin world.make (world.rough, 40, 20); - preview_width := core.window_width - side_panel; - preview_height := core.window_height - text_box_height; - core.dash; core.echo (core.success, "Successfully initialized game data, entering main gameplay loop."); core.dash; @@ -149,6 +144,11 @@ begin -- 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.y := core.clip (core.camera.y, 0, world.height - 1); -- diff --git a/source/ray.ads b/source/ray.ads index 949bfd7..19f3e44 100644 --- a/source/ray.ads +++ b/source/ray.ads @@ -17,6 +17,46 @@ package ray is for logical'size use 32; 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 ( log_all, log_trace, log_debug, log_info, log_warning, log_error, log_fatal, log_none @@ -39,6 +79,8 @@ package ray is no_font : font; 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 close_window with import => true, convention => c, external_name => "CloseWindow"; diff --git a/source/ui.adb b/source/ui.adb index 8d02aef..093e116 100644 --- a/source/ui.adb +++ b/source/ui.adb @@ -182,8 +182,6 @@ package body ui is procedure synchronize is begin - prioritize := false; - -- for index in 0 .. structure_limit loop exit when index = structure_count; -- @@ -193,7 +191,6 @@ package body ui is -- if structure_array (index).show then draw_structure (structure_array (index)); - prioritize := true; end if; end loop; end synchronize; diff --git a/source/world.adb b/source/world.adb index 38ce95b..be20c30 100644 --- a/source/world.adb +++ b/source/world.adb @@ -131,13 +131,14 @@ package body world is width => core.base-1, height => core.base-1); -- - 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.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 + 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 + 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 + 1) * core.base * core.zoom and core.cursor_mode = 1 and not ui.prioritize then core.camera.x := move_x; core.camera.y := move_y; + core.cursor_mode := 0; end if; end loop; end loop; diff --git a/sprite/unit/fairy/base.png b/sprite/unit/fairy/base.png index 19ad19a..b56302b 100644 Binary files a/sprite/unit/fairy/base.png and b/sprite/unit/fairy/base.png differ diff --git a/sprite/unit/goblin/base.png b/sprite/unit/goblin/base.png index da86a98..9d3060e 100644 Binary files a/sprite/unit/goblin/base.png and b/sprite/unit/goblin/base.png differ diff --git a/sprite/unit/imp/base.png b/sprite/unit/imp/base.png index 0d3be2f..4d4c416 100644 Binary files a/sprite/unit/imp/base.png and b/sprite/unit/imp/base.png differ diff --git a/sprite/unit/imp/black_long_beard.png b/sprite/unit/imp/black_long_beard.png new file mode 100644 index 0000000..552bc04 Binary files /dev/null and b/sprite/unit/imp/black_long_beard.png differ diff --git a/sprite/unit/imp/black_short_hair.png b/sprite/unit/imp/black_short_hair.png new file mode 100644 index 0000000..7096497 Binary files /dev/null and b/sprite/unit/imp/black_short_hair.png differ diff --git a/sprite/unit/imp/head_runic_tattoo.png b/sprite/unit/imp/head_runic_tattoo.png new file mode 100644 index 0000000..89f000f Binary files /dev/null and b/sprite/unit/imp/head_runic_tattoo.png differ