home *** CD-ROM | disk | FTP | other *** search
/ The World of Computer Software / World_Of_Computer_Software-02-386-Vol-2of3.iso / g / gametp20.zip / IMAGING.INT < prev    next >
Text File  |  1992-11-05  |  3KB  |  87 lines

  1. Unit Imaging;
  2.  
  3. { Imaging version 1.1 Copyright (C) 1992 Scott D. Ramsay    }
  4. {                                  ramsays@access.digex.com }
  5.  
  6. {   This unit is specifically for Mode 13h (320x200x256).  It is a    }
  7. { lot faster than using the BGI drivers (VGA256.BGI).  Majority of    }
  8. { the code is written using BASM.  This will work on 286 machines or  }
  9. { higher. "I don't know about the P5 chip though." ;)                 }
  10. {   IMAGING.TPU can be used freely in commerical and non-commerical   }
  11. { programs.  As long as you don't give yourself credit for writing    }
  12. { this portion of the code.  When distributing it (free only), please }
  13. { include all files and samples so others may enjoy using the code.   }
  14. { Enjoy.                                                              }
  15. {                                                                     }
  16. { Changes from 1.0:                                                   }
  17. {   Added function to load gif files.  (slow, it my first attempt)    }
  18.  
  19.  
  20. Interface
  21.  
  22. Uses VgaKern;
  23.  
  24. type
  25.   VidHdrType = record
  26.                  position,count : word;  { header block for PTR files }
  27.                end;
  28.  
  29. var
  30.   rgb256         : RGBlist;              { palette of last loaded PCX file }
  31.  
  32. function loadpcx(pfilename:string):integer;
  33. function loadgif(gfilename:string):integer;
  34. procedure DrawPtr(var p;merge:boolean;sz:longint);
  35. function LoadPTR(fn:string;merge:boolean):integer;
  36. function SavePTR(fn:string):integer;
  37.  
  38. Implementation
  39.  
  40. (***********************************************************************)
  41. function loadpcx(pfilename:string):integer;
  42.  
  43.  loads a PCX file from disk to the current page. Returns 0 if no error,
  44.  Make sure its a 320x200 image.
  45.  
  46. (***********************************************************************)
  47. function loadgif(gfilename:string):integer;
  48.  
  49.   loads a GIF file from disk to the current page. Returns 0 if no error,
  50.   Make sure its a 320x200 image.  This procedure is very slow.
  51.  
  52. (***********************************************************************)
  53. procedure DrawPtr(var p;merge:boolean;sz:longint);
  54.  
  55.  loads a PTR file from memory to the current page
  56.     p      : is the PTR location,
  57.    merge   : set to true to overlay image
  58.     sz     : size of PTR file
  59.  
  60. (***********************************************************************)
  61. function LoadPTR(fn:string;merge:boolean):integer;
  62.  
  63.  loads a PTR file from disk to the current page, returns
  64.   0 if no error
  65.  
  66. (***********************************************************************)
  67. function SavePTR(fn:string):integer;
  68.  
  69.  save the current page as a PTR file, returns 0 if no error
  70.  
  71.  
  72. (***********************************************************************)
  73.  
  74. If you have any problems, e-mail at:
  75.  
  76.     ramsays@access.digex.com
  77.  
  78.   Sorry, I don't have permanent snail-mail address yet.  I just moved
  79.    to the Washington DC area.
  80.  
  81.   The TPU units can be used with in your programs.  With out giving
  82.    me credit.  If you want the source code, more samples or swap-talk,
  83.    just e-mail me.  I'll give sample use-code for free.  Actual TPU-source
  84.    code prices can be discussed.
  85.  
  86.  
  87.    Scott D. Ramsay