Pārlūkot izejas kodu

Prototyping mapshot functionality...

master
Ognjen Milan Robovic pirms 1 nedēļas
vecāks
revīzija
62dc7a81d6
10 mainītis faili ar 25 papildinājumiem un 0 dzēšanām
  1. +11
    -0
      source/core.adb
  2. +2
    -0
      source/core.ads
  3. +2
    -0
      source/main.adb
  4. +10
    -0
      source/ray.ads
  5. Binārs
      sprite/item/chest/elven_armour.png
  6. Binārs
      sprite/item/full_body/lime_dress.png
  7. Binārs
      sprite/item/full_body/magenta_dress.png
  8. Binārs
      sprite/item/full_body/pink_dress.png
  9. Binārs
      sprite/item/full_body/sexy_dress.png
  10. Binārs
      sprite/item/head/elven_helmet.png

+ 11
- 0
source/core.adb Parādīt failu

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


+ 2
- 0
source/core.ads Parādīt failu

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


+ 2
- 0
source/main.adb Parādīt failu

@@ -263,6 +263,8 @@ begin
gameplay;
end loop gameplay_loop;

mapshot ("./test.png");

------------------------------------------------------------------------------------------

deinitialize;


+ 10
- 0
source/ray.ads Parādīt failu

@@ -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ārs
sprite/item/chest/elven_armour.png Parādīt failu

Pirms Pēc
Platums: 64  |  Augstums: 96  |  Izmērs: 520B

Binārs
sprite/item/full_body/lime_dress.png Parādīt failu

Pirms Pēc
Platums: 64  |  Augstums: 96  |  Izmērs: 534B

Binārs
sprite/item/full_body/magenta_dress.png Parādīt failu

Pirms Pēc
Platums: 64  |  Augstums: 96  |  Izmērs: 558B

Binārs
sprite/item/full_body/pink_dress.png Parādīt failu

Pirms Pēc
Platums: 64  |  Augstums: 96  |  Izmērs: 545B

Binārs
sprite/item/full_body/sexy_dress.png Parādīt failu

Pirms Pēc
Platums: 64  |  Augstums: 96  |  Izmērs: 547B

Binārs
sprite/item/head/elven_helmet.png Parādīt failu

Pirms Pēc
Platums: 64  |  Augstums: 96  |  Izmērs: 1.4KB

Notiek ielāde…
Atcelt
Saglabāt