Prototype sequaltial integer IO...
This commit is contained in:
parent
32d41d7669
commit
50e8bfdb98
@ -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
|
function c_string (ada_string : string) return string is
|
||||||
begin
|
begin
|
||||||
return (ada_string & character'val (0));
|
return (ada_string & character'val (0));
|
||||||
|
@ -2,8 +2,10 @@
|
|||||||
--
|
--
|
||||||
-- GNU General Public Licence (version 3 or later)
|
-- GNU General Public Licence (version 3 or later)
|
||||||
|
|
||||||
with 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;
|
use ada.text_io, ada.strings.unbounded, interfaces.c, ray, system;
|
||||||
|
|
||||||
|
with ada.sequential_io;
|
||||||
|
|
||||||
package core is
|
package core is
|
||||||
|
|
||||||
@ -121,6 +123,8 @@ package core is
|
|||||||
procedure dash;
|
procedure dash;
|
||||||
procedure semi_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 c_string (ada_string : in string) return string;
|
||||||
|
|
||||||
function random (minimum, maximum : in integer) return integer;
|
function random (minimum, maximum : in integer) return integer;
|
||||||
|
@ -350,6 +350,8 @@ begin
|
|||||||
|
|
||||||
world.save ("heyo");
|
world.save ("heyo");
|
||||||
|
|
||||||
|
core.save ("test.a", null, 0);
|
||||||
|
|
||||||
--~world.mapshot (folder & "/mapshot.png");
|
--~world.mapshot (folder & "/mapshot.png");
|
||||||
|
|
||||||
------------------------------------------------------------------------------------------
|
------------------------------------------------------------------------------------------
|
||||||
|
Loading…
Reference in New Issue
Block a user