if a
end;
begin
TopX: = Max (0, Min (x1, x2));
BotX: = Min (GetMaxX, Max (x1, x2));
TopY: = Max (0, Min (y1, y2));
BotY: = Min (GetMaxY, Max (y1, y2));
end;
Procedure DrawTSpr;
Var
fx, fy, x1, y1, x2, y2: Word;
c: Byte;
begin
if (x + w-1 BotX) or (y> BotY) then Exit;
if x
if y
if x + w> BotX then x2: = BotX-x else x2: = w-1;
if y + h> BotY then y2: = BotY-y else y2: = h-1;
for fy: = y1 to y2 do
for fx: = x1 to x2 do
begin
c: = BA (Image ^) [fy * w + fx];
if c <> 0 then Mem [Base: ((y + fy) shl 8) + ((y + fy) shl 6) + (x + fx)]: = c;
end;
end;
Procedure DrawOSpr;
Var
fx, fy, x1, y1, x2, y2: Word;
begin
if (x + w-1 BotX) or (y> BotY) then Exit;
if x
if y
if x + w> BotX then x2: = BotX-x else x2: = w-1;
if y + h> BotY then y2: = BotY-y else y2: = h-1;
for fy: = y1 to y2 do
for fx: = x1 to x2 do
Mem [Base: ((y + fy) shl 8) + ((y + fy) shl 6) + (x + fx)]: = BA (Image ^) [fy * w + fx];
end;
BEGIN
SetClipRect (0,0, GetMaxX, GetMaxY);
END.