I couldn't leave this alone....
Decided I wanted to use a macro to create solid fill, and have managed to reverse engineer the required attribute (which is a string attributed named 'DC_FILL' but containing binary data).
The following macro can be used to add solid fill (what I have deduced about the DC_FILL attribute is shown in the filldef record).
Any comments about the advisability of doing this ? (is the definition of the DC_FILL attribute likely to change in future releases?).
Can anybody add anything further to this? (perhaps somebody knows what the 'dunno' fields are used for?)
Code: Select allPROGRAM TestFill;
TYPE
filldef = RECORD
dunno1 : integer; ! seems to be always 272
dunno2 : integer; ! seems to be always 0
fillclr : integer; ! clrnum x 256, +255 if entity clr, (wraps to -ve over clr127)
entclr : integer; ! -1 to fill with entity clr, else 0
filltyp : integer; ! 0..6 multiplied by 256
ptnclr : integer; ! clrnum x 256
END;
atrstr = RECORD
a : integer;
CASE integer of
0 : (s : str80);
1 : (f : filldef);
END;
VAR
res : integer;
mode : mode_type;
key : integer;
ent : entity;
addr : entaddr;
aAddr : atraddr;
atr : attrib;
a : atrstr;
i : integer;
clr : integer;
fd : atrstr;
BEGIN
repeat
res := getmode ('to fill', mode, key);
if res = res_normal then
addr := ent_first (mode);
WHILE ent_get (ent, addr) DO
getclr (clr);
atr_init (atr, atr_str);
fd.f.dunno1 := 272;
fd.f.dunno2 := 0;
fd.f.fillclr := clr*256;
fd.f.entclr := 0;
fd.f.filltyp := 0;
fd.f.ptnclr := 256; ! value doesn't matter for solid fill?
atr.str := fd.s;
atr.name := 'DC_FILL';
atr_add2ent (ent, atr);
ent_draw (ent, drmode_white);
addr := ent_next (ent, mode);
END;
end;
until res <> res_normal;
END TestFill.