Prototype sequaltial integer IO...

This commit is contained in:
Ognjen Milan Robovic 2024-05-23 08:29:21 -04:00
parent 32d41d7669
commit 50e8bfdb98
3 changed files with 23 additions and 2 deletions

View File

@ -147,6 +147,21 @@ package body core is
------------------------------------------------------------------------------------------
procedure save (file_name : in string; data : in ray.pointer; size : in natural) is
package io is new ada.sequential_io (integer);
--
file : io.file_type;
begin
io.create (file, io.out_file, file_name);
io.write (file, 255);
io.write (file, 0);
io.write (file, 0);
io.write (file, 255);
io.close (file);
end save;
------------------------------------------------------------------------------------------
function c_string (ada_string : string) return string is
begin
return (ada_string & character'val (0));

View File

@ -2,8 +2,10 @@
--
-- GNU General Public Licence (version 3 or later)
with ada.text_io, ada.strings.unbounded, interfaces.c, ray;
use ada.text_io, ada.strings.unbounded, interfaces.c, ray;
with ada.text_io, ada.strings.unbounded, interfaces.c, ray, system;
use ada.text_io, ada.strings.unbounded, interfaces.c, ray, system;
with ada.sequential_io;
package core is
@ -121,6 +123,8 @@ package core is
procedure dash;
procedure semi_dash;
procedure save (file_name : in string; data : in ray.pointer; size : in natural);
function c_string (ada_string : in string) return string;
function random (minimum, maximum : in integer) return integer;

View File

@ -350,6 +350,8 @@ begin
world.save ("heyo");
core.save ("test.a", null, 0);
--~world.mapshot (folder & "/mapshot.png");
------------------------------------------------------------------------------------------