-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathwcon.pas
62 lines (51 loc) · 1.03 KB
/
wcon.pas
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
{$mode TP}
{$PACKRECORDS 1}
Unit Wcon;
Interface
uses RMCore,rwpal,rwXGF,WPRF,Xgf2src;
Function WriteDat(x,y,x2,y2,myFormat,LanType : word; filename : string) : word;
Implementation
function GetMaxColor : integer;
begin
GetMaxColor:=RMCoreBase.Palette.GetColorCount -1;
end;
Function WriteDat(x,y,x2,y2,myFormat,LanType : word;filename:string):word;
Var
mywidth : word;
myheight: word;
F : File;
Error : Word;
begin
{$I+}
myWidth:=x2-x+1;
myHeight:=y2-y+1;
If myFormat=SPRSource then
begin
error:=WriteSPR(x,y,x2,y2,'$$$$.tmp');
end
else if myFormat=PPRSource then
begin
error:=WritePPR(x,y,x2,y2,'$$$$.tmp');
end
else if myFormat=PALSource then
begin
error:=WritePAL('$$$$.tmp');
end
else
begin
error:=writeXgf(x,y,x2,y2,LanType,'$$$$.tmp');
end;
if Error<>0 then
begin
WriteDat:=Error;
exit;
end;
error:=XgfToSrc('$$$$.tmp',filename,myWidth,myHeight,GetMaxColor+1,myFormat,Lantype);
Assign(f,'$$$$.tmp');
Erase(F);
WriteDAT:=error;
Error:=IORESULT;
{$I+}
end;
begin
end.