home *** CD-ROM | disk | FTP | other *** search
/ PC Underground / UNDERGROUND.ISO / graphic / voxel.pas < prev    next >
Pascal/Delphi Source File  |  1995-08-01  |  975b  |  33 lines

  1. {$G+}
  2. Uses Crt,Gif,ModeXLib;
  3.  
  4. Var x,y:Integer;                {Coordinates of the trapezoid}
  5.  
  6. Procedure Draw_Voxel;external;
  7. {$l voxel.obj}
  8.  
  9. Begin
  10.   asm mov ax,0; int 33h End;    {reset mouse driver}
  11.   Init_ModeX;                   {enable Mode X}
  12.   LoadGif('landsc3');           {load landscape}
  13.   x:=195;                       {define start coordinate}
  14.   y:=130;
  15.   Repeat
  16.     ClrX($0f);                  {clear screen}
  17.     Draw_Voxel;                 {draw landscape}
  18.     Switch;                     {activate completed video page}
  19.     WaitRetrace;                {wait for retrace}
  20.     asm
  21.       mov ax,000bh              {Function 0bh: read relative coordinates}
  22.       int 33h
  23.       sar cx,2                  {Division by 2}
  24.       sar dx,2
  25.       add x,cx
  26.       add y,dx
  27.     End;
  28.     If x < 0 Then x:=0; If x > 130 Then x:=130;
  29.     If y < 0 Then y:=0; If y > 130 Then y:=130;
  30.   Until KeyPressed;             {until key}
  31.   TextMode(3);
  32. End.
  33.