-
Notifications
You must be signed in to change notification settings - Fork 4
/
rres.pas
1316 lines (1187 loc) · 58.1 KB
/
rres.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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
{$MODE TP}
{$PACKRECORDS 1}
Unit rres;
Interface
uses rmcore,rmthumb,rmxgfcore,rwxgf,rmamigarwxgf,rwpal,wmodex,rwmap,gwbasic,mapcore,rmcodegen,
wraylib,rwaqb,wmouse,rwspriteanim;
//Function RESInclude(filename:string):word;
Function RESInclude(filename:string; index : integer; ExportOnlyIndex : Boolean):word;
Function RESBinary(filename:string):word;
const
MaxResItems = 255;
type
resheadrec = Packed Record
sig : array[1..3] of char;
ver : byte;
resitemcount : integer;
end;
resrec = Packed Record
rt : integer;
rid : array[1..20] of char;
offset : longint;
size : longint;
end;
resIndex = array[1..MaxResItems] of resrec;
RFILE = Packed Record
ResFile : File;
ResList : ^resIndex;
ResItems : integer;
end;
Procedure res_open(Var IRFILE : RFILE;filename : string);
Procedure res_close(var IRFILE : RFILE);
Function res_getsize(VAR IRFILE : RFILE; ri : integer) : longint;
Procedure res_read(VAR IRFILE : RFILE; var rbuf; ri : integer);
(*
Procedure res_dis_xgf(Var IRFILE : RFILE; x,y : integer;ri : integer;dmode : integer);
*)
Implementation
Procedure res_open(Var IRFILE : RFILE;filename : string);
type
ExeHeaderRec = Record
Sig : Word; (* EXE File signature *)
bleft : Word; (* Number of Bytes in last page of EXE image*)
nPages : Word; (* Number of 512 Byte pages in EXE image *)
end;
Var
i,error : word;
ressig : array[1..3] of char;
ExeHeader : ExeHeaderRec;
ExeSize : LongInt;
begin
{$I-}
assign(IRFILE.Resfile,filename);
Reset(IRFILE.ResFile,1);
error:=ioresult;
if error <> 0 then
begin
writeln('error opening resource file ',filename);
halt;
end;
exesize:=0;
If Filename=ParamStr(0) then
begin
BlockRead(IRFILE.ResFile,ExeHeader,SizeOf(ExeHeaderRec));
ExeSize:=Longint(ExeHeader.bleft)+LongInt((ExeHeader.npages-1))*512;
Seek(IRFILE.ResFile,ExeSize);
end;
blockread(IRFILE.Resfile,ressig,3);
if ressig <> 'RES' then
begin
writeln('not a valid resource file');
halt;
end;
blockread(IRFILE.resfile,IRFILE.resitems,2);
getmem(IRFILE.reslist,sizeof(resrec)*IRFILE.resitems);
blockread(IRFILE.resfile,IRFILE.reslist^,sizeof(resrec)*IRFILE.resitems);
error:=ioresult;
if error<>0 then
begin
writeln('error reading resource file header');
halt;
end;
For i:=1 to IRFILE.resitems do
begin
Inc(IRFILE.ResList^[i].offset,exesize);
end;
{$I+}
end;
Procedure res_close(var IRFILE : RFILE);
var
error : word;
begin
{$I-}
close(IRFILE.resfile);
Freemem(IRFILE.reslist,sizeof(resrec)*IRFILE.resitems);
error:=ioresult;
if error <> 0 then
begin
writeln('error closing resource file');
halt;
end;
{$I+}
end;
Function res_getsize(VAR IRFILE : RFILE; ri : integer) : longint;
begin
res_getsize:=IRFILE.reslist^[ri].size;
end;
Procedure res_read(VAR IRFILE : RFILE; var rbuf; ri : integer);
var
error : word;
begin
{$I-}
seek(IRFILE.resfile,IRFILE.reslist^[ri].offset);
blockread(IRFILE.resfile,rbuf,IRFILE.reslist^[ri].size);
error:=ioresult;
if error <> 0 then
begin
writeln('error reading resource file');
halt;
end;
{$I+}
end;
//Image Export Propertis Dialog box the image type changes depending on what compiler is selected
//we need a way to convert all the droplist combination to a simple format
function ImageIndexToFormat(Compiler,ImageIndex : integer) : integer;
var
format : integer;
begin
format:=0;
case Compiler of TPLan:begin
case ImageIndex of 1:format:=PutImageExportFormat;
2:format:=XLibLBMExportFormat;
3:format:=XLibPBMExportFormat;
4:format:=MouseImageExportFormat;
end;
end;
TMTLan:begin
case ImageIndex of 1:format:=PutImageExportFormat;
end;
end;
TCLan:begin
case ImageIndex of 1:format:=PutImageExportFormat;
2:format:=XLibLBMExportFormat;
3:format:=XLibPBMExportFormat;
4:format:=MouseImageExportFormat;
end;
end;
QCLan:begin
case ImageIndex of 1:format:=PutImageExportFormat;
2:format:=MouseImageExportFormat;
end;
end;
QBLan:begin
case ImageIndex of 1:format:=PutImageExportFormat;
2:format:=MouseImageExportFormat;
end;
end;
BAMLan:begin
case ImageIndex of 1:format:=PutImageExportFormat;
2:format:=RGBExportFormat;
end;
end;
QB64Lan:begin
case ImageIndex of 1:format:=RGBAFuchsiaExportFormat;
2:format:=RGBAIndex0ExportFormat;
3:format:=RGBACustomExportFormat;
4:format:=RGBExportFormat;
5:format:=RayLibRGBAFuchsiaExportFormat;
6:format:=RayLibRGBAIndex0ExportFormat;
7:format:=RayLibRGBACustomExportFormat;
8:format:=RayLibRGBExportFormat;
end;
end;
QBJSLan:begin
case ImageIndex of 1:format:=RGBAFuchsiaExportFormat;
2:format:=RGBAIndex0ExportFormat;
3:format:=RGBACustomExportFormat;
4:format:=RGBExportFormat;
end;
end;
PBLan:begin
case ImageIndex of 1:format:=PutImageExportFormat;
2:format:=MouseImageExportFormat;
end;
end;
GWLan:begin
case ImageIndex of 1:format:=PutImageExportFormat;
2:format:=MouseImageExportFormat;
end;
end;
FPLan:begin
case ImageIndex of 1:format:=PutImageExportFormat;
2:format:=RGBAFuchsiaExportFormat;
3:format:=RGBAIndex0ExportFormat;
4:format:=RGBACustomExportFormat;
5:format:=RGBExportFormat;
6:format:=MouseImageExportFormat;
end;
end;
FBinQBModeLan:begin
case ImageIndex of 1:format:=PutImageExportFormat;
2:format:=MouseImageExportFormat;
end;
end;
FBLan:begin
case ImageIndex of 1:format:=RGBAFuchsiaExportFormat;
2:format:=RGBAIndex0ExportFormat;
3:format:=RGBACustomExportFormat;
4:format:=RGBExportFormat;
end;
end;
ABLan:begin
case ImageIndex of 1:format:=PutImageExportFormat;
2:format:=AmigaBOBExportFormat;
3:format:=AmigaVSpriteExportFormat;
end;
end;
APLan:begin
case ImageIndex of 1:format:=AmigaBOBExportFormat;
2:format:=AmigaVSpriteExportFormat;
end;
end;
ACLan:begin
case ImageIndex of 1:format:=AmigaBOBExportFormat;
2:format:=AmigaVSpriteExportFormat;
end;
end;
AQBLan:begin
case ImageIndex of 1:format:=PutImageExportFormat;
2:format:=AmigaBOBExportFormat;
3:format:=AmigaVSpriteExportFormat;
end;
end;
QPLan:begin
case ImageIndex of 1:format:=PutImageExportFormat;
2:format:=MouseImageExportFormat;
end;
end;
gccLan:begin
case ImageIndex of 1:format:=RGBAFuchsiaExportFormat;
2:format:=RGBAIndex0ExportFormat;
3:format:=RGBACustomExportFormat;
4:format:=RGBExportFormat;
end;
end;
OWLan:begin
case ImageIndex of 1:format:=PutImageExportFormat;
2:format:=MouseImageExportFormat;
end;
end;
end;
ImageIndexToFormat:=format;
end;
function GetRESImageSize(width,height,nColors,Lan,ImageType : integer) : longint;
var
size : longint;
ImageFormat : integer;
begin
size:=0;
ImageFormat:=ImageIndexToFormat(Lan,ImageType);
Case Lan of TPLan:begin
Case ImageFormat of PutImageExportFormat:size:=GetXImageSize(width,height,ncolors);
XLibLBMExportFormat,
XLibPBMExportFormat:size:=GetLBMPBMImageSize(width,height); // Xlib LBM/PBM
MouseImageExportFormat:size:=GetMouseShapeSize;
end;
end;
TMTLan:begin
Case ImageFormat of PutImageExportFormat:size:=GetXImageSizeTMT(width,height,ncolors);
end;
end;
TCLan:begin
Case ImageFormat of PutImageExportFormat:size:=GetXImageSize(width,height,ncolors);
XLibLBMExportFormat,
XLibPBMExportFormat:size:=GetLBMPBMImageSize(width,height); // Xlib LBM/PBM
MouseImageExportFormat:size:=GetMouseShapeSize;
end;
end;
QCLan:begin
Case ImageFormat of PutImageExportFormat:size:=GetXImageSize(width,height,ncolors);
MouseImageExportFormat:size:=GetMouseShapeSize;
end;
end;
QPLan:begin
Case ImageFormat of PutImageExportFormat:size:=GetXImageSize(width,height,ncolors);
MouseImageExportFormat:size:=GetMouseShapeSize;
end;
end;
GWLan:begin
Case ImageFormat of PutImageExportFormat:size:=GetXImageSize(width,height,ncolors);
MouseImageExportFormat:size:=GetMouseShapeSize;
end;
end;
PBLan:begin
Case ImageFormat of PutImageExportFormat:size:=GetXImageSize(width,height,ncolors);
MouseImageExportFormat:size:=GetMouseShapeSize;
end;
end;
QBLan:begin
Case ImageFormat of PutImageExportFormat:size:=GetXImageSize(width,height,ncolors);
MouseImageExportFormat:size:=GetMouseShapeSize;
end;
end;
BAMLan:begin
Case ImageFormat of PutImageExportFormat:size:=GetXImageSizeBAM(width,height,ncolors);
RGBExportFormat:size:=GetRGBXImageSizeBAM(width,height);
end;
end;
QB64Lan:begin
Case ImageFormat of RGBAFuchsiaExportFormat:size:=ResRayLibImageSize(width,height,RGBASize);
RGBAIndex0ExportFormat:size:=ResRayLibImageSize(width,height,RGBASize);
RGBACustomExportFormat:size:=ResRayLibImageSize(width,height,RGBASize);
RGBExportFormat:size:=ResRayLibImageSize(width,height,RGBSize);
RayLibRGBAFuchsiaExportFormat:size:=ResRayLibImageSize(width,height,RGBASize);
RayLibRGBAIndex0ExportFormat:size:=ResRayLibImageSize(width,height,RGBASize);
RayLibRGBACustomExportFormat:size:=ResRayLibImageSize(width,height,RGBASize);
RayLibRGBExportFormat:size:=ResRayLibImageSize(width,height,RGBSize);
end;
end;
QBJSLan:begin
Case ImageFormat of RGBAFuchsiaExportFormat:size:=ResRayLibImageSize(width,height,RGBASize);
RGBAIndex0ExportFormat:size:=ResRayLibImageSize(width,height,RGBASize);
RGBACustomExportFormat:size:=ResRayLibImageSize(width,height,RGBASize);
RGBExportFormat:size:=ResRayLibImageSize(width,height,RGBSize);
end;
end;
FPLan:begin
Case ImageFormat of PutImageExportFormat:size:=GetXImageSizeFP(width,height);
RGBAFuchsiaExportFormat:size:=ResRayLibImageSize(width,height,RGBASize);
RGBAIndex0ExportFormat:size:=ResRayLibImageSize(width,height,RGBASize);
RGBACustomExportFormat:size:=ResRayLibImageSize(width,height,RGBASize);
RGBExportFormat:size:=ResRayLibImageSize(width,height,RGBSize);
MouseImageExportFormat:size:=GetMouseShapeSize;
end;
end;
FBinQBModeLan:begin
Case ImageFormat of PutImageExportFormat:size:=GetXImageSizeFB(width,height);
MouseImageExportFormat:size:=GetMouseShapeSize;
end;
end;
FBLan:begin
Case ImageFormat of RGBAFuchsiaExportFormat:size:=ResRayLibImageSize(width,height,RGBASize);
RGBAIndex0ExportFormat:size:=ResRayLibImageSize(width,height,RGBASize);
RGBACustomExportFormat:size:=ResRayLibImageSize(width,height,RGBASize);
RGBExportFormat:size:=ResRayLibImageSize(width,height,RGBSize);
end;
end;
ABLan:begin
Case ImageFormat of PutImageExportFormat:size:=GetABXImageSize(width,height,nColors);
AmigaBOBExportFormat:size:=GetBobDataSize(width,height,nColors,false); //bob
AmigaVSpriteExportFormat:size:=GetBobDataSize(width,height,nColors,true); //vsprite
end;
end;
AQBLan:begin
Case ImageFormat of PutImageExportFormat,
AmigaBOBExportFormat,
AmigaVSpriteExportFormat:size:=width*height;
end;
end;
APLan:begin
Case ImageFormat of AmigaBOBExportFormat,
AmigaVSpriteExportFormat:size:=GetAmigaBitMapSize(width,height,ncolors);
end;
end;
ACLan:begin
Case ImageFormat of AmigaBOBExportFormat,
AmigaVSpriteExportFormat:size:=GetAmigaBitMapSize(width,height,ncolors);
end;
end;
gccLan:begin
// size:=ResRayLibImageSize(width,height,ImageType);
Case ImageFormat of RGBAFuchsiaExportFormat:size:=ResRayLibImageSize(width,height,RGBASize);
RGBAIndex0ExportFormat:size:=ResRayLibImageSize(width,height,RGBASize);
RGBACustomExportFormat:size:=ResRayLibImageSize(width,height,RGBASize);
RGBExportFormat:size:=ResRayLibImageSize(width,height,RGBSize);
end;
end;
OWLan:begin
Case ImageFormat of PutImageExportFormat:size:=GetXImageSizeOW(width,height,ncolors);
MouseImageExportFormat:size:=GetMouseShapeSize;
end;
end;
end;
GetRESImageSize:=size;
end;
function GetRESPaletteSize(nColors,Lan,rgbFormat : integer) : longint;
var
size : longint;
begin
size:=0;
if rgbFormat = ColorIndexFormat then Size:=nColors
else Size:=nColors*3;
GetRESPaletteSize:=Size;
end;
function GetRESMapSize(mwidth,mheight : integer) : longint;
var
size : longint;
begin
size:=(mwidth*mheight*sizeof(integer))+(4*sizeof(integer));
GetRESMapSize:=Size;
end;
Procedure WriteBasicLabel(var data : BufferRec;Lan : integer;LabelName : string);
begin
//we don't want GWLan - it has line number already
case Lan of BAMLan,ABLan,AQBLan,FBinQBModeLan,FBLan,QBLan,QB64Lan,PBLan,QBJSLan:Writeln(data.fText,LabelName,'Label:');
end;
end;
procedure WriteBasicVariable(var data : BufferRec;Lan : integer;vname,vsubname : string;value : longint);
var
DotOrUnderScore : String;
begin
DotOrUnderScore:='.';
if (Lan=BAMLan) or (Lan=AQBLan) or (Lan = FBinQBModeLan) or (Lan = FBLan) or (Lan = QBJSLan) then
begin
DotOrUnderScore:='_';
end;
if (Lan=AQBLan) or (Lan = FBLan) then
begin
writeln(data.fText,LineCountToStr(Lan),'Dim ',vname,DotOrUnderScore,vsubname,' As Integer = ',value);
end
else if (Lan=QB64Lan) then
begin
writeln(data.fText,LineCountToStr(Lan),'Const ',vname,DotOrUnderScore,vsubname,' = ',value);
end
else if (Lan=QBJSLan) then
begin
writeln(data.fText,LineCountToStr(Lan),'Const ',vname,DotOrUnderScore,vsubname,' = ',value);
end
else
begin
writeln(data.fText,LineCountToStr(Lan),vname,DotOrUnderScore,vsubname,' = ',value);
end;
end;
procedure WriteFBBasicDimReadStub(var data : BufferRec;Lan : integer; name : string;size : longint);
begin
if (Lan<>GWLan) then writeln(data.fText,LineCountToStr(Lan),'Restore ',name,'Label');
writeln(data.fText,LineCountToStr(Lan),'Dim ',name,'(',size,') As Integer');
writeln(data.fText,LineCountToStr(Lan),'For _rmi=0 to ',size-1);
writeln(data.fText,LineCountToStr(Lan),' Read ',name,'(_rmi)');
writeln(data.fText,LineCountToStr(Lan),'Next _rmi');
end;
procedure WriteBasicDimReadStub(var data : BufferRec;Lan : integer; name : string;size : longint);
begin
if (Lan<>GWLan) then writeln(data.fText,LineCountToStr(Lan),'Restore ',name,'Label');
writeln(data.fText,LineCountToStr(Lan),'Dim ',name,'(',size,')');
writeln(data.fText,LineCountToStr(Lan),'For i=0 to ',size-1);
writeln(data.fText,LineCountToStr(Lan),' Read ',name,'(i)');
writeln(data.fText,LineCountToStr(Lan),'Next i');
end;
procedure WriteFBBasicReadStub(var data : BufferRec;Lan : integer; name : string;size : longint);
begin
writeln(data.fText,LineCountToStr(Lan),'Restore ',name,'Label');
writeln(data.fText,LineCountToStr(Lan),'Dim As Any Ptr ',name);
writeln(data.fText,LineCountToStr(Lan),name,' = ImageCreate(',name,'_Width,',name,'_Height)');
writeln(data.fText,LineCountToStr(Lan),'For _rmy=0 to ',name,'_Height-1');
writeln(data.fText,LineCountToStr(Lan),' For _rmx=0 to ',name,'_Width-1');
writeln(data.fText,LineCountToStr(Lan),' Read _rmr,_rmg,_rmb');
writeln(data.fText,LineCountToStr(Lan),' if ',name,'_Format = 7 Then');
writeln(data.fText,LineCountToStr(Lan),' Read _rma');
writeln(data.fText,LineCountToStr(Lan),' PSet ',name,',(_rmx, _rmy),RGBA(_rmr,_rmg,_rmb,_rma)');
writeln(data.fText,LineCountToStr(Lan),' else');
writeln(data.fText,LineCountToStr(Lan),' PSet ',name,',(_rmx, _rmy),RGB(_rmr,_rmg,_rmb)');
writeln(data.fText,LineCountToStr(Lan),' end if');
writeln(data.fText,LineCountToStr(Lan),' Next _rmx');
writeln(data.fText,LineCountToStr(Lan),'Next _rmy');
end;
procedure WriteQBJSReadStub(var data : BufferRec;Lan : integer; name : string;size : longint);
begin
writeln(data.fText,LineCountToStr(Lan),'Restore ',name,'Label');
writeln(data.fText,LineCountToStr(Lan),'Dim ',name);
writeln(data.fText,LineCountToStr(Lan),name,' = _NewImage(',name,'_Width,',name,'_Height,32)');
writeln(data.fText,LineCountToStr(Lan),'rmprevdest = _Dest');
writeln(data.fText,LineCountToStr(Lan),'_Dest ',name);
writeln(data.fText,LineCountToStr(Lan),'For rmy=0 to ',name,'_Height-1');
writeln(data.fText,LineCountToStr(Lan),' For rmx=0 to ',name,'_Width-1');
writeln(data.fText,LineCountToStr(Lan),' Read rmr,rmg,rmb');
writeln(data.fText,LineCountToStr(Lan),' if ',name,'_Format = 7 Then');
writeln(data.fText,LineCountToStr(Lan),' Read rma');
writeln(data.fText,LineCountToStr(Lan),' PSet(rmx,rmy),_RGBA(rmr,rmg,rmb,rma)');
writeln(data.fText,LineCountToStr(Lan),' else');
writeln(data.fText,LineCountToStr(Lan),' PSet(rmx,rmy),_RGB(rmr,rmg,rmb)');
writeln(data.fText,LineCountToStr(Lan),' end if');
writeln(data.fText,LineCountToStr(Lan),' Next rmx');
writeln(data.fText,LineCountToStr(Lan),'Next rmy');
writeln(data.fText,LineCountToStr(Lan),'_Dest rmprevdest');
end;
procedure WriteQB64ReadStub(var data : BufferRec;Lan : integer; name : string;size : longint);
begin
writeln(data.fText,LineCountToStr(Lan),'Restore ',name,'Label');
writeln(data.fText,LineCountToStr(Lan),'Dim ',name,'&');
writeln(data.fText,LineCountToStr(Lan),name,'& = _NewImage(',name,'.Width,',name,'.Height,32)');
writeln(data.fText,LineCountToStr(Lan),'rmprevdest = _Dest');
writeln(data.fText,LineCountToStr(Lan),'_Dest ',name,'&');
writeln(data.fText,LineCountToStr(Lan),'For rmy=0 to ',name,'.Height-1');
writeln(data.fText,LineCountToStr(Lan),' For rmx=0 to ',name,'.Width-1');
writeln(data.fText,LineCountToStr(Lan),' Read rmr,rmg,rmb');
writeln(data.fText,LineCountToStr(Lan),' if ',name,'.Format = 7 Then');
writeln(data.fText,LineCountToStr(Lan),' Read rma');
writeln(data.fText,LineCountToStr(Lan),' PSet(rmx,rmy),_RGBA(rmr,rmg,rmb,rma)');
writeln(data.fText,LineCountToStr(Lan),' else');
writeln(data.fText,LineCountToStr(Lan),' PSet(rmx,rmy),_RGB(rmr,rmg,rmb)');
writeln(data.fText,LineCountToStr(Lan),' end if');
writeln(data.fText,LineCountToStr(Lan),' Next rmx');
writeln(data.fText,LineCountToStr(Lan),'Next rmy');
writeln(data.fText,LineCountToStr(Lan),'_Dest rmprevdest');
end;
procedure WriteQB64RayLibReadStub(var data : BufferRec;Lan : integer; name : string;size : longint);
begin
writeln(data.fText,LineCountToStr(Lan),'Restore ',name,'Label');
writeln(data.fText,LineCountToStr(Lan),'Dim ',name,'Data AS _MEM');
writeln(data.fText,LineCountToStr(Lan),'Dim ',name,'Image AS Image');
writeln(data.fText,LineCountToStr(Lan),'Dim ',name,'Texture AS Texture');
writeln(data.fText,LineCountToStr(Lan),name,'Data = _MemNew(',name,'.Size)');
writeln(data.fText,LineCountToStr(Lan),'rmc = 0');
writeln(data.fText,LineCountToStr(Lan),'For rmy=0 to ',name,'.Height-1');
writeln(data.fText,LineCountToStr(Lan),' For rmx=0 to ',name,'.Width-1');
writeln(data.fText,LineCountToStr(Lan),' Read rmr,rmg,rmb');
writeln(data.fText,LineCountToStr(Lan),' _MemPut ',name,'Data, ',name,'Data.OFFSET + rmc, rmr As _UNSIGNED _BYTE ');
writeln(data.fText,LineCountToStr(Lan),' _MemPut ',name,'Data, ',name,'Data.OFFSET + rmc + 1, rmg As _UNSIGNED _BYTE ');
writeln(data.fText,LineCountToStr(Lan),' _MemPut ',name,'Data, ',name,'Data.OFFSET + rmc + 2, rmb As _UNSIGNED _BYTE ');
writeln(data.fText,LineCountToStr(Lan),' if ',name,'.Format = 7 Then');
writeln(data.fText,LineCountToStr(Lan),' Read rma');
writeln(data.fText,LineCountToStr(Lan),' _MemPut ',name,'Data, ',name,'Data.OFFSET + rmc + 3, rma As _UNSIGNED _BYTE ');
writeln(data.fText,LineCountToStr(Lan),' rmc = rmc + 4 ');
writeln(data.fText,LineCountToStr(Lan),' else');
writeln(data.fText,LineCountToStr(Lan),' rmc = rmc + 3 ');
writeln(data.fText,LineCountToStr(Lan),' end if');
writeln(data.fText,LineCountToStr(Lan),' Next rmx');
writeln(data.fText,LineCountToStr(Lan),'Next rmy');
writeln(data.fText,LineCountToStr(Lan),name,'Image.dat = ',name,'Data.OFFSET');
writeln(data.fText,LineCountToStr(Lan),name,'Image.W = ',name,'.Width');
writeln(data.fText,LineCountToStr(Lan),name,'Image.H = ',name,'.Height');
writeln(data.fText,LineCountToStr(Lan),name,'Image.mipmaps = 1');
writeln(data.fText,LineCountToStr(Lan),name,'Image.format = ',name,'.Format');
writeln(data.fText,LineCountToStr(Lan),'LoadTextureFromImage ',name,'Image, ',name,'Texture');
end;
procedure WriteAQBImageStub(var data : BufferRec;Lan,Image,Mask : integer; name : string;size : longint);
begin
writeln(data.fText,LineCountToStr(Lan),'Restore ',name,'Label');
writeln(data.fText,LineCountToStr(Lan),'Dim As BITMAP_t PTR ',name,'BitMap = NULL');
if Image = 2 then
begin
writeln(data.fText,LineCountToStr(Lan),'Dim As BOB_t PTR ',name,'Bob');
end
else if Image = 3 then
begin
writeln(data.fText,LineCountToStr(Lan),'Dim As SPRITE_t PTR ',name,'Sprite');
end;
writeln(data.fText,LineCountToStr(Lan),name,'BitMap = BITMAP(',name,'_Width,',name,'_Height,',name,'_Depth,TRUE)');
writeln(data.fText,LineCountToStr(Lan),'BITMAP OUTPUT ',name,'BitMap');
writeln(data.fText,LineCountToStr(Lan),'For _rmj=0 to ',name,'_Height-1');
writeln(data.fText,LineCountToStr(Lan),' For _rmi=0 to ',name,'_Width-1');
writeln(data.fText,LineCountToStr(Lan),' Read _rma');
writeln(data.fText,LineCountToStr(Lan),' Pset(_rmi,_rmj),_rma');
writeln(data.fText,LineCountToStr(Lan),' Next _rmi');
writeln(data.fText,LineCountToStr(Lan),'Next _rmj');
if Mask = 1 then writeln(data.fText,LineCountToStr(Lan),'BITMAP MASK ',name,'BitMap');
if Image = 2 then
begin
writeln(data.fText,LineCountToStr(Lan),name,'Bob = BOB(',name,'BitMap)');
end
else if Image = 3 then
begin
writeln(data.fText,LineCountToStr(Lan),name,'Sprite = SPRITE(',name,'BitMap)');
end;
writeln(data.fText,LineCountToStr(Lan),'WINDOW OUTPUT 1');
end;
procedure WriteAmigaBasicBobVSprite(var data : BufferRec;Lan : integer; name : string;size : longint);
begin
writeln(data.fText,LineCountToStr(Lan),'Restore ',name,'Label');
writeln(data.fText,LineCountToStr(Lan),name,'$=""');
writeln(data.fText,LineCountToStr(Lan),'For i=0 to ',size-1);
writeln(data.fText,LineCountToStr(Lan),' Read a');
writeln(data.fText,LineCountToStr(Lan),' ',name,'$=',name,'$+chr$(a)');
writeln(data.fText,LineCountToStr(Lan),'Next i');
end;
procedure WriteAmigaBasicPaletteReadStub(var data : BufferRec;Lan : integer; name : string;size : longint);
var
fv : string;
begin
fv:='i';
if Lan = AQBLan then fv:='_rmi';
writeln(data.fText,LineCountToStr(Lan),'Restore ',name,'Label');
writeln(data.fText,LineCountToStr(Lan),'Dim ',name,'!(',size,')');
writeln(data.fText,LineCountToStr(Lan),'For ',fv,'=0 to ',size-1);
writeln(data.fText,LineCountToStr(Lan),' Read ',name,'!(',fv,')');
writeln(data.fText,LineCountToStr(Lan),'Next ',fv);
end;
procedure WriteBasicRMInit(var data : BufferRec);
var
count : integer;
width,height : integer;
EO : ImageExportFormatRec;
nColors : integer;
Size : LongInt;
PalSize : Longint;
i : integer;
DefIntFlag : Boolean;
MP : MapPropsRec;
MPE : MapExportFormatRec;
mwidth,mheight : integer;
Lan : integer;
Format : integer;
ImageExportFormat : integer;
begin
DefIntFlag:=True;
count:=ImageThumbBase.GetCount;
for i:=0 to count-1 do
begin
width:=ImageThumbBase.GetExportWidth(i);
height:=ImageThumbBase.GetExportHeight(i);
ImageThumbBase.GetExportOptions(i,EO);
//start using ImageExportFormat instead of EO.Image because it give us more correct information without addtional condistions to check
ImageExportFormat:=ImageIndexToFormat(EO.Lan,EO.Image);
nColors:=ImageThumbBase.GetMaxColor(i)+1;
size:=GetRESImageSize(width,height,nColors,EO.Lan,EO.Image);
if (EO.LAN in [QB64Lan,FBLan]) then //GetRESImageSize works most of the time but not for this - we need to use RayLibImageSize here
begin
Case ImageExportFormat of RGBAFuchsiaExportFormat:size:=RayLibImageSize(width,height,RGBASize);
RGBAIndex0ExportFormat:size:=RayLibImageSize(width,height,RGBASize);
RGBACustomExportFormat:size:=RayLibImageSize(width,height,RGBASize);
RGBExportFormat:size:=RayLibImageSize(width,height,RGBSize);
RayLibRGBAFuchsiaExportFormat:size:=RayLibImageSize(width,height,RGBASize);
RayLibRGBAIndex0ExportFormat:size:=RayLibImageSize(width,height,RGBASize);
RayLibRGBACustomExportFormat:size:=RayLibImageSize(width,height,RGBASize);
RayLibRGBExportFormat:size:=RayLibImageSize(width,height,RGBSize);
end;
end;
if (EO.LAN in [BAMLan,ABLan,AQBLan,GWLan,QBLan,QB64Lan,QBJSLan,FBinQBModeLan,FBLan,PBLan]) then
begin
if DefIntFlag then
begin
if (EO.Lan in [AQBLan,FBLan]) then
begin
writeln(data.fText,LineCountToStr(EO.Lan),'Dim As Integer _rmx,_rmy,_rmr,_rmg,_rmb,_rma,_rmi,_rmj');
end
else if (EO.Lan = QB64Lan) then
begin
if ImageExportFormat in [RayLibRGBAFuchsiaExportFormat,RayLibRGBAIndex0ExportFormat,RayLibRGBACustomExportFormat,RayLibRGBExportFormat] then
begin
writeln(data.fText,LineCountToStr(EO.Lan),'Dim rmx,rmy,rmi,rmj,rmc AS Integer');
writeln(data.fText,LineCountToStr(EO.Lan),'Dim rmr, rmg, rmb, rma As _Unsigned _Byte');
end
else
begin
writeln(data.fText,LineCountToStr(EO.Lan),'Dim rmx,rmy,rmi,rmj,rmc,rmprevdest AS Integer');
writeln(data.fText,LineCountToStr(EO.Lan),'Dim rmr, rmg, rmb, rma As _Unsigned _Byte');
end;
end
else if (EO.Lan = QBJSLan) then
begin
if ImageExportFormat in [RGBAFuchsiaExportFormat,RGBAIndex0ExportFormat,RGBACustomExportFormat,RGBExportFormat] then
begin
writeln(data.fText,LineCountToStr(EO.Lan),'Dim rmx,rmy,rmi,rmj,rmc AS Integer');
writeln(data.fText,LineCountToStr(EO.Lan),'Dim rmr, rmg, rmb, rma As _Unsigned _Byte');
writeln(data.fText,LineCountToStr(EO.Lan),'Dim rmprevdest');
end;
end
else
begin
Writeln(data.fText,LineCountToStr(EO.Lan),'DEFINT A-Z');
end;
DefIntFlag:=False; // we only write this once - we put it here because we don't know which language until we pull the first image
end;
//write palette first
if EO.Palette > 0 then
begin
PalSize:=GetRESPaletteSize(nColors,EO.Lan,EO.Palette);
WriteBasicVariable(data,EO.Lan,EO.Name+'Pal','Size',PalSize);
WriteBasicVariable(data,EO.Lan,EO.Name+'Pal','Colors',nColors);
WriteBasicVariable(data,EO.Lan,EO.Name+'Pal','Id',i);
if ((EO.Lan=ABLan) or (EO.Lan=AQBLan)) and (EO.Palette=5) then // uses SINGLE(!) variable for palette in n.nn format
begin
WriteAmigaBasicPaletteReadStub(data,EO.Lan,EO.Name+'Pal',PalSize);
end
else
begin
WriteBasicDimReadStub(data,EO.Lan,EO.Name+'Pal',PalSize);
end;
end;
if ImageExportFormat > 0 then
begin
if (ImageExportFormat = PutImageExportFormat) and (EO.Lan in [BAMLan,FBinQBModeLan,ABLan,QBLan,GWLan,PBLan]) then size := size div 2; //we writing basic integers for Image format 1
if (ImageExportFormat = RGBExportFormat) and (EO.Lan =BAMLan) then size := size div 2; //we writing basic integers for BAM RGB format
if (ImageExportFormat = MouseImageExportFormat) and (EO.Lan in [FBinQBModeLan,QBLan,GWLan,PBLan]) then size := size div 2; //we writing basic integers for Image format 1
WriteBasicVariable(data,EO.Lan,EO.Name,'Size',size);
if ((EO.Lan = QB64Lan) or (EO.Lan = QBJSLan) or (EO.Lan = FBLan)) then
begin
if ImageExportFormat in [RGBAFuchsiaExportFormat,RGBAIndex0ExportFormat,RGBACustomExportFormat,RGBExportFormat,RayLibRGBAFuchsiaExportFormat,RayLibRGBAIndex0ExportFormat,RayLibRGBExportFormat] then
begin
Format:=7;
if ImageExportFormat in [RGBExportFormat,rayLibRGBExportFormat] then Format:=4;
WriteBasicVariable(data,EO.Lan,EO.Name,'Format',Format); // for QB64/Freebasic RayLib formats
end;
end;
if (ImageExportFormat = RGBExportFormat) and (EO.Lan = BAMLan) then
begin
Format:=4;
WriteBasicVariable(data,EO.Lan,EO.Name,'Format',Format);
end;
WriteBasicVariable(data,EO.Lan,EO.Name,'Width',width);
WriteBasicVariable(data,EO.Lan,EO.Name,'Height',height);
WriteBasicVariable(data,EO.Lan,EO.Name,'Colors',nColors);
WriteBasicVariable(data,EO.Lan,EO.Name,'Id',i);
if (EO.Lan=ABLan) and (ImageExportFormat in [AmigaBOBExportFormat,AmigaVSpriteExportFormat]) then //these are stored in strings so we need a diffent way
begin
WriteAmigaBasicBobVSprite(data,EO.Lan,EO.Name,size);
end
else if (EO.Lan=AQBLan) then
begin
WriteBasicVariable(data,EO.Lan,EO.Name,'Depth',nColorsToBitPlanes(nColors));
WriteAQBImageStub(data,EO.Lan,EO.Image,EO.Mask,EO.Name,size);
end
else if (EO.Lan=FBLan) then
begin
if (ImageExportFormat in [RGBAFuchsiaExportFormat,RGBAIndex0ExportFormat,RGBExportFormat]) then
begin
WriteFBBasicReadStub(data,EO.Lan,EO.Name,size); //FreeBASIC - not QB mode - RGB/RGBA Load code
end;
end
else if (EO.Lan=QB64Lan) then
begin
if (ImageExportFormat in [RGBAFuchsiaExportFormat,RGBAIndex0ExportFormat,RGBACustomExportFormat,RGBExportFormat]) then
begin
WriteQB64ReadStub(data,EO.Lan,EO.Name,size); //QB64 - Use Internal Graphics
end
else if (ImageExportFormat in [RayLibRGBAFuchsiaExportFormat,RayLibRGBAIndex0ExportFormat,RayLibRGBACustomExportFormat,RayLibRGBExportFormat]) then
begin
WriteQB64RayLibReadStub(data,EO.Lan,EO.Name,size); //QB64 - Use RayLib Graphics
end;
end
else if (EO.Lan=BAMLan) then
begin
WriteBasicDimReadStub(data,EO.Lan,EO.Name,size); //loading stub for putimage code.
end
else if (EO.Lan=QBJSLan) then
begin
if (ImageExportFormat in [RGBAFuchsiaExportFormat,RGBAIndex0ExportFormat,RGBACustomExportFormat,RGBExportFormat]) then
begin
WriteQBJSReadStub(data,EO.Lan,EO.Name,size); //QBJS
end;
end
else
begin
if (ImageExportFormat in[PutImageExportFormat,MouseImageExportFormat]) then WriteBasicDimReadStub(data,EO.Lan,EO.Name,size); //loading stub for putimage code.
end;
end;
if (ImageExportFormat = PutImageExportFormat) and (EO.Mask > 0) then //we have putimage mask - except for
begin
WriteBasicVariable(data,EO.Lan,EO.Name+'Mask','Size',size);
WriteBasicVariable(data,EO.Lan,EO.Name+'Mask','Width',width);
WriteBasicVariable(data,EO.Lan,EO.Name+'Mask','Height',height);
WriteBasicVariable(data,EO.Lan,EO.Name+'Mask','Colors',nColors);
WriteBasicVariable(data,EO.Lan,EO.Name+'Mask','Id',i);
if (EO.LAN<>AQBLan) then WriteBasicDimReadStub(data,EO.Lan,EO.Name+'Mask',size); //aqb does need this. it uses different format for mask
end;
end;
end;
//write map info
count:=MapCoreBase.GetMapCount;
For i:=0 to count-1 do
begin
MapCoreBase.GetMapProps(i,MP);
MapCoreBase.GetMapExportProps(i,MPE);
mwidth:=MapCoreBase.GetExportWidth(i);
mheight:=MapCoreBase.GetExportHeight(i);
size:=mwidth*mheight+4;
if ((MPE.Lan=BasicLan) or (MPE.Lan=BAMBasicLan) or (MPE.Lan=AQBBasicLan) or (MPE.Lan=FBBasicLan) or (MPE.Lan=QB64BasicLan) or (MPE.Lan=BasicLnLan)) and (MPE.MapFormat=1) then //hack alert - fix FBBasicLan
begin
Lan:=QBLan;
if MPE.Lan = BasicLnLan then
begin
Lan:=GWLan;
end
else if MPE.Lan = FBBasicLan then
begin
Lan:=FBLan;
end
else if MPE.Lan = AQBBasicLan then
begin
Lan:=AQBLan;
end
else if MPE.Lan = BAMBasicLan then
begin
Lan:=BAMLan;
end;
WriteBasicVariable(data,Lan,MPE.Name+'Map','Size',size);
WriteBasicVariable(data,Lan,MPE.Name+'Map','Width',mwidth);
WriteBasicVariable(data,Lan,MPE.Name+'Map','Height',mheight);
WriteBasicVariable(data,Lan,MPE.Name+'Map','TileWidth',MP.tilewidth);
WriteBasicVariable(data,Lan,MPE.Name+'Map','TileHeight',MP.tileheight);
WriteBasicVariable(data,Lan,MPE.Name+'Map','Id',i);
if (Lan = FBLan) or (Lan = AQBLan) then
begin
WriteFBBasicDimReadStub(data,Lan,MPE.Name+'Map',size);
end
else
begin
WriteBasicDimReadStub(data,Lan,MPE.Name+'Map',size)
end;
end;
end;
end;
//exportonlyindex means export only the index, none of the other images.palette maps
Function RESInclude(filename:string; index : integer; ExportOnlyIndex : Boolean):word;
var
data : BufferRec;
EO : ImageExportFormatRec;
ImageExportFormat : integer;
i : integer;
count : integer;
width : integer;
height : integer;
StartIndex : integer;
begin
SetThumbActive; // we are getting pixel data from core object ThumbBase
SetGWStartLineNumber(1000); // this is only used for exporting GWBASIC/PCBASIC code
assign(data.fText,filename);
{$I-}
rewrite(data.fText);
if ExportOnlyIndex then
begin
StartIndex:=index;
count:=StartIndex+1;
end
else
begin
WriteBasicRMinit(data); //generates the dims, variable assignments, and loader code for all the basic languages
StartIndex:=0;
count:=ImageThumbBase.GetCount;
end;
for i:=StartIndex to count-1 do
begin
width:=ImageThumbBase.GetExportWidth(i);
height:=ImageThumbBase.GetExportHeight(i);
ImageThumbBase.GetExportOptions(i,EO);
ImageExportFormat:=ImageIndexToFormat(EO.Lan,EO.Image);
SetThumbIndex(i); //important - otherwise the GetMaxColor and GetPixel functions will not get the right data
if (EO.Lan>0) and (EO.Palette > 0) then
begin
WriteBasicLabel(data,EO.Lan,EO.Name+'Pal');
WritePalToArrayBuffer(data,EO.Name+'Pal',EO.Lan,EO.Palette);
end;
case EO.Lan of TPLan,TMTLan,TCLan,FPLan,FBinQBModeLan,BAMLan,QBLan,GWLan,QCLan,QPLan,PBLan,OWLan:
begin
// if EO.Image = 1 then //put image format
if ImageExportFormat = PutImageExportFormat then //put image format
begin
WriteBasicLabel(data,EO.Lan,EO.Name); //checks if it's basic lan then writes lable - ignoes other lan
WriteXGFCodeToBuffer(data,0,0,width-1,height-1,EO.Lan,0,EO.Name);
end;
// if (EO.Image = 1) and (EO.Mask=1) and (EO.Lan<>AQBLan) then //put image mask
if (ImageExportFormat = PutImageExportFormat) and (EO.Mask=1) and (EO.Lan<>AQBLan) then //put image mask
begin
WriteBasicLabel(data,EO.Lan,EO.Name+'Mask');
WriteXGFCodeToBuffer(data,0,0,width-1,height-1,EO.Lan,1,EO.Name+'Mask');
end;
if (ImageExportFormat = MouseImageExportFormat) then
begin
WriteBasicLabel(data,EO.Lan,EO.Name);
WriteMShapeCodeToBuffer(data,0,0,EO.Lan,i,EO.Name);
end;
end;
end;
// if (EO.LAN=TPLan) AND (EO.Image = 2) then // XLib LBM
if (EO.LAN=TPLan) AND (ImageExportFormat = XLibLBMExportFormat) then // XLib LBM
begin
WriteTPLBMCodeToBuffer(data,0,0,width-1,height-1,i,EO.Name);
end;
if (EO.LAN=TPLan) AND (ImageExportFormat = XLibPBMExportFormat) then // XLib PBM
begin
WriteTPPBMCodeToBuffer(data,0,0,width-1,height-1,i,EO.Name);
end;
if (EO.LAN=TCLan) AND (ImageExportFormat = XLibLBMExportFormat) then // XLib LBM
begin
WriteTCLBMCodeToBuffer(data,0,0,width-1,height-1,i,EO.Name);
end;
if (EO.LAN=TCLan) AND (ImageExportFormat = XLibPBMExportFormat) then // XLib PBM
begin
WriteTCPBMCodeToBuffer(data,0,0,width-1,height-1,i,EO.Name);
end;
if (EO.LAN=ABLan) and (ImageExportFormat = PutImageExportFormat) then
begin
WriteBasicLabel(data,EO.Lan,EO.Name);
WriteAmigaBasicXGFDataBuffer(0,0,width-1,height-1,0,data,EO.Name); // put
end;
if (EO.LAN=ABLan) and (ImageExportFormat = PutImageExportFormat) and (EO.Mask=1) then
begin
WriteBasicLabel(data,EO.Lan,EO.Name+'Mask');
WriteAmigaBasicXGFDataBuffer(0,0,width-1,height-1,1,data,EO.Name+'Mask'); // mask
end;
if (EO.LAN=ABLan) and (ImageExportFormat = AmigaBOBExportFormat) then
begin
WriteBasicLabel(data,EO.Lan,EO.Name);
WriteAmigaBasicBobDataBuffer(0,0,width-1,height-1,data,EO.Name,false); //bob
end;
if (EO.LAN=ABLan) and (ImageExportFormat = AmigaVSpriteExportFormat) then
begin
WriteBasicLabel(data,EO.Lan,EO.Name);
WriteAmigaBasicBobDataBuffer(0,0,width-1,height-1,data,EO.Name,true); // vsprite
end;
if (EO.LAN=ACLan) and (ImageExportFormat = AmigaBOBExportFormat) then WriteAmigaCBobCodeToBuffer(0,0,width-1,height-1,EO.Name,data,false); // bob
if (EO.LAN=ACLan) and (ImageExportFormat = AmigaVSpriteExportFormat) then WriteAmigaCBobCodeToBuffer(0,0,width-1,height-1,EO.Name,data,true); //vsprite
if (EO.LAN=APLan) and (ImageExportFormat = AmigaBOBExportFormat) then WriteAmigaPascalBobCodeToBuffer(0,0,height-1,width-1,EO.Name,data,false); // bob
if (EO.LAN=APLan) and (ImageExportFormat = AmigaVSpriteExportFormat) then WriteAmigaPascalBobCodeToBuffer(0,0,height-1,width-1,EO.Name,data,true); //vsprite
if (EO.LAN=AQBLan) and (ImageExportFormat in [AmigaBOBExportFormat,AmigaVSpriteExportFormat,PutImageExportFormat]) then
begin
WriteBasicLabel(data,EO.Lan,EO.Name);
WriteAQBBitMapCodeToBuffer(data.fText,0,0,height-1,width-1,EO.Name);
end;
if (EO.LAN=BAMLan) and (ImageExportFormat = RGBExportFormat) then