diff --git a/source/core.adb b/source/core.adb index 6255302..b2530c2 100644 --- a/source/core.adb +++ b/source/core.adb @@ -195,6 +195,17 @@ package body core is ------------------------------------------------------------------------------------------ + procedure mapshot (file_path : in string) is + data : ray.image; + test : integer; + begin + data := ray.image_colour (16, 16, (255, 255, 0, 255)); + ray.image_clear_background (data, (255, 0, 0, 255)); + test := ray.dump_image (data, c_string (file_path)); + end mapshot; + + ------------------------------------------------------------------------------------------ + procedure draw (data : in sprite := (others => 0); x : in integer := 0; y : in integer := 0; diff --git a/source/core.ads b/source/core.ads index bbdb57c..02f7ed3 100644 --- a/source/core.ads +++ b/source/core.ads @@ -125,6 +125,8 @@ package core is function import_font (file_path : in string; scale, space : in integer) return font; function import_song (file_path : in string) return song; + procedure mapshot (file_path : in string); + procedure draw (data : in sprite := (others => 0); x : in integer := 0; y : in integer := 0; diff --git a/source/main.adb b/source/main.adb index decab17..f643d73 100644 --- a/source/main.adb +++ b/source/main.adb @@ -263,6 +263,8 @@ begin gameplay; end loop gameplay_loop; + mapshot ("./test.png"); + ------------------------------------------------------------------------------------------ deinitialize; diff --git a/source/ray.ads b/source/ray.ads index 19f3e44..b7c04b3 100644 --- a/source/ray.ads +++ b/source/ray.ads @@ -17,6 +17,8 @@ package ray is for logical'size use 32; for colour_range'size use 8; + type pixels is array (natural range <>) of colour_range; + type window_flag is ( flag_none, flag_fullscreen_mode, @@ -71,6 +73,7 @@ package ray is type colour is record r, g, b, a : colour_range; end record with convention => c_pass_by_copy; type rectangle is record x ,y, width, height : float; end record with convention => c_pass_by_copy; type texture is record id : natural; width, height, mipmaps, format : integer; end record with convention => c_pass_by_copy; + type image is record data : access pixels; width, height, mipmaps : integer; format : integer := 7; end record with convention => c_pass_by_copy; type font is record base, count, pad : integer; data : texture; squares : pointer; glyphs : pointer; end record with convention => c_pass_by_copy; type stream is record buffer, processor : pointer; rate, size, channels : natural; end record with convention => c_pass_by_copy; type sound is record data : stream; frame : natural; end record with convention => c_pass_by_copy; @@ -120,6 +123,13 @@ package ray is procedure unload_sound (data : in sound) with import => true, convention => c, external_name => "UnloadSound"; procedure unload_font (data : in font) with import => true, convention => c, external_name => "UnloadFont"; + function image_colour (width, height : in integer; tint : in colour) return image with import => true, convention => c, external_name => "GenImageColor"; + + procedure image_clear_background (data : in out image; tint : in colour) with import => true, convention => c, external_name => "ImageClearBackground"; + + function dump_image (data : in image; file_path : in string) return integer with import => true, convention => c, external_name => "ExportImage"; + + procedure draw_line (x0, y0, x1, y1 : in integer; tint : in colour) with import => true, convention => c, external_name => "DrawLine"; procedure draw_rectangle (x, y, width, height : in integer; tint : in colour) with import => true, convention => c, external_name => "DrawRectangle"; diff --git a/sprite/item/chest/elven_armour.png b/sprite/item/chest/elven_armour.png new file mode 100644 index 0000000..9e9143e Binary files /dev/null and b/sprite/item/chest/elven_armour.png differ diff --git a/sprite/item/full_body/lime_dress.png b/sprite/item/full_body/lime_dress.png new file mode 100644 index 0000000..0804085 Binary files /dev/null and b/sprite/item/full_body/lime_dress.png differ diff --git a/sprite/item/full_body/magenta_dress.png b/sprite/item/full_body/magenta_dress.png new file mode 100644 index 0000000..d00682d Binary files /dev/null and b/sprite/item/full_body/magenta_dress.png differ diff --git a/sprite/item/full_body/pink_dress.png b/sprite/item/full_body/pink_dress.png new file mode 100644 index 0000000..83bb14c Binary files /dev/null and b/sprite/item/full_body/pink_dress.png differ diff --git a/sprite/item/full_body/sexy_dress.png b/sprite/item/full_body/sexy_dress.png new file mode 100644 index 0000000..efbe5c5 Binary files /dev/null and b/sprite/item/full_body/sexy_dress.png differ diff --git a/sprite/item/head/elven_helmet.png b/sprite/item/head/elven_helmet.png new file mode 100644 index 0000000..b019b21 Binary files /dev/null and b/sprite/item/head/elven_helmet.png differ