Курсовая работа по информатике



бет7/7
Дата22.06.2022
өлшемі201,5 Kb.
#146948
түріКурсовая
1   2   3   4   5   6   7
Байланысты:
kursovik
ответы по гигиене
UNIT VGASpr;
INTERFACE
Uses VGA13h;
Type
BA=Array [0..$FFF0] of Byte;
Var
TopX,TopY,BotX,BotY:Integer;
Procedure SetClipRect(x1,y1,x2,y2:Integer);
Procedure DrawTSpr(Base:Word;x,y:Integer;h,w:Word;Image:Pointer); Procedure DrawOSpr(Base:Word;x,y:Integer;h,w:Word;Image:Pointer); IMPLEMENTATION
Procedure SetClipRect;
Function Max(a,b:Integer):Integer;
begin
if a>b then Max:=a else Max:=b;
end;
Function Min(a,b:Integer):Integer;
begin
if aend;
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-1BotX) or (y>BotY) then Exit;
if xif yif 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-1BotX) or (y>BotY) then Exit;
if xif yif 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.


Достарыңызбен бөлісу:
1   2   3   4   5   6   7




©engime.org 2024
әкімшілігінің қараңыз

    Басты бет