Debian Codegraph @

Data_Generators/makedata/shp2make.pas

raw
1 program shp2make;
2 (********************************************************************
3 This file is part of Ironseed.
4
5 Ironseed is free software: you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation, either version 3 of the License, or
8 (at your option) any later version.
9
10 Ironseed is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with Ironseed. If not, see <https://www.gnu.org/licenses/>.
17 ********************************************************************)
18
19 {*********************************************
20 Data Generator: Ship picture parts
21
22 Copyright:
23 1994 Channel 7, Destiny: Virtual
24 2020 Matija Nalis <[email protected]>
25 **********************************************}
26
27 uses data;
28
29 var shipfile: file of shipdistype;
30 k: integer;
31
32 procedure saveship(index,x1,y1: integer);
33 var temp: ^shipdistype;
34 i,j: integer;
35 begin
36 //writeln ('saving ship ', index);
37 new(temp);
38 for j:=x1 to x1+57 do
39 for i:=0 to 74 do
40 temp^[j-x1,i]:=screen[y1+i,j];
41 assign(shipfile,'data/shippix.dta');
42 reset(shipfile);
43 if ioresult<>0 then errorhandler('data/shippix.dta',1);
44 seek(shipfile,index);
45 if ioresult<>0 then errorhandler('data/shippix.dta',5);
46 write(shipfile,temp^);
47 if ioresult<>0 then errorhandler('data/shippix.dta',5);
48 close(shipfile);
49 dispose(temp);
50 end;
51
52 begin
53 assign(shipfile,'data/shippix.dta');
54 rewrite(shipfile);
55 if ioresult<>0 then errorhandler('data/shippix.dta',1);
56
57 loadscreen('Data_Generators/makedata/shippart', @screen);
58 if ioresult<>0 then errorhandler('Data_Generators/makedata/shippart',1);
59 for k:=0 to 8 do
60 saveship(k,(k mod 5)*61+3,(k div 5)*77+3);
61 end.