Parcourir la source

More sprite modificaitons and resizable window...

master
Ognjen Milan Robovic il y a 2 semaines
Parent
révision
1ab1daff56
11 fichiers modifiés avec 58 ajouts et 14 suppressions
  1. +4
    -0
      source/core.adb
  2. +7
    -7
      source/main.adb
  3. +42
    -0
      source/ray.ads
  4. +0
    -3
      source/ui.adb
  5. +5
    -4
      source/world.adb
  6. BIN
      sprite/unit/fairy/base.png
  7. BIN
      sprite/unit/goblin/base.png
  8. BIN
      sprite/unit/imp/base.png
  9. BIN
      sprite/unit/imp/black_long_beard.png
  10. BIN
      sprite/unit/imp/black_short_hair.png
  11. BIN
      sprite/unit/imp/head_runic_tattoo.png

+ 4
- 0
source/core.adb Voir le fichier

@@ -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;
--


+ 7
- 7
source/main.adb Voir le fichier

@@ -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);
--


+ 42
- 0
source/ray.ads Voir le fichier

@@ -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";



+ 0
- 3
source/ui.adb Voir le fichier

@@ -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;


+ 5
- 4
source/world.adb Voir le fichier

@@ -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;


BIN
sprite/unit/fairy/base.png Voir le fichier

Avant Après
Largeur: 64  |  Hauteur: 96  |  Taille: 840B Largeur: 64  |  Hauteur: 96  |  Taille: 876B

BIN
sprite/unit/goblin/base.png Voir le fichier

Avant Après
Largeur: 64  |  Hauteur: 96  |  Taille: 13KB Largeur: 64  |  Hauteur: 96  |  Taille: 836B

BIN
sprite/unit/imp/base.png Voir le fichier

Avant Après
Largeur: 64  |  Hauteur: 96  |  Taille: 798B Largeur: 64  |  Hauteur: 96  |  Taille: 836B

BIN
sprite/unit/imp/black_long_beard.png Voir le fichier

Avant Après
Largeur: 64  |  Hauteur: 96  |  Taille: 344B

BIN
sprite/unit/imp/black_short_hair.png Voir le fichier

Avant Après
Largeur: 64  |  Hauteur: 96  |  Taille: 404B

BIN
sprite/unit/imp/head_runic_tattoo.png Voir le fichier

Avant Après
Largeur: 64  |  Hauteur: 96  |  Taille: 274B

Chargement…
Annuler
Enregistrer