Prototyping mapshot functionality...
This commit is contained in:
parent
339da3e318
commit
62dc7a81d6
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -263,6 +263,8 @@ begin
|
||||
gameplay;
|
||||
end loop gameplay_loop;
|
||||
|
||||
mapshot ("./test.png");
|
||||
|
||||
------------------------------------------------------------------------------------------
|
||||
|
||||
deinitialize;
|
||||
|
@ -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";
|
||||
|
||||
|
BIN
sprite/item/chest/elven_armour.png
Normal file
BIN
sprite/item/chest/elven_armour.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 520 B |
BIN
sprite/item/full_body/lime_dress.png
Normal file
BIN
sprite/item/full_body/lime_dress.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 534 B |
BIN
sprite/item/full_body/magenta_dress.png
Normal file
BIN
sprite/item/full_body/magenta_dress.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 558 B |
BIN
sprite/item/full_body/pink_dress.png
Normal file
BIN
sprite/item/full_body/pink_dress.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 545 B |
BIN
sprite/item/full_body/sexy_dress.png
Normal file
BIN
sprite/item/full_body/sexy_dress.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 547 B |
BIN
sprite/item/head/elven_helmet.png
Normal file
BIN
sprite/item/head/elven_helmet.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.4 KiB |
Loading…
Reference in New Issue
Block a user