home *** CD-ROM | disk | FTP | other *** search
/ Programmer 7500 / MAX_PROGRAMMERS.iso / PASCAL / GAMETP.ZIP / IMAGING.INT < prev    next >
Encoding:
Text File  |  1992-10-29  |  3.9 KB  |  105 lines

  1. Unit Imaging;
  2.  
  3. { Imaging version 1.0 Copyright (C) 1992 Scott D. Ramsay }
  4.  
  5. {   This unit is specifically for Mode 13h (320x200x256).  It is a    }
  6. { lot faster than using the BGI drivers (VGA256.BGI).  Majority of    }
  7. { the code is written using BASM.  This will work on 286 machines or  }
  8. { higher. "I don't know about the P5 chip though." ;)                 }
  9. {   IMAGING.TPU can be used freely in commerical and non-commerical   }
  10. { programs.  As long as you don't give yourself credit for writing    }
  11. { this portion of the code.  When distributing it (free only), please }
  12. { include all files and samples so others may enjoy using the code.   }
  13. { Enjoy.                                                              }
  14.  
  15. { Please bear with my comments.  I'm not a tech-writer.  You're more }
  16. { than welcome to modify the comments in this file for people to     }
  17. { understand.                                                        }
  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. procedure DrawPtr(var p;merge:boolean;sz:longint);
  34. function LoadPTR(fn:string;merge:boolean):integer;
  35. function SavePTR(fn:string):integer;
  36.  
  37. Implementation
  38.  
  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. procedure DrawPtr(var p;merge:boolean;sz:longint);
  48.  
  49.  loads a PTR file from memory to the current page
  50.     p      : is the PTR location,
  51.    merge   : set to true to overlay image
  52.     sz     : size of PTR file
  53.  
  54. (***********************************************************************)
  55. function LoadPTR(fn:string;merge:boolean):integer;
  56.  
  57.  loads a PTR file from disk to the current page, returns
  58.   0 if no error
  59.  
  60. (***********************************************************************)
  61. function SavePTR(fn:string):integer;
  62.  
  63.  save the current page as a PTR file, returns 0 if no error
  64.  
  65.  
  66. (***********************************************************************)
  67.  
  68. If you have any problems, e-mail at:
  69.  
  70.     ramsays@express.digex.com
  71.  
  72.   Sorry, I don't have permanent snail-mail address yet.  I just moved
  73.    to the Washington DC area.
  74.  
  75.   The TPU units can be used with in your programs.  With out giving
  76.    me credit.  If you want the source code, more samples or swap-talk,
  77.    just e-mail me.  I'll give sample use-code for free.  Actual TPU-source
  78.    code prices can be discussed.
  79.  
  80.   Also,  I have completed the following programs.
  81.  
  82.      GEOMAKER        Makes tile-maps quickly.
  83.      VSPMAKER        Makes the VSP files.
  84.      BKMAKER         A drawing program that can read
  85.                       VEW files (my own raw format)
  86.                       PTR files (my own compressed format)
  87.                       GIF files
  88.                       PCX files
  89.  
  90.   The three above programs are specifically designed for the 320x200x256
  91.   (game development).  I'll upload them when I think they are ready
  92.   to go. (Bout a week)
  93.  
  94.   (Artwork samples done by me.  Freeware.  Knock your-self out.
  95.    Plug.  Highly recommended.  For game programmers, try to get
  96.    Animator Pro by Autodesk.  This is an excellent program for
  97.    imaging, sprites and so forth. Very similar to the Animator,
  98.    but has better graphic features.  The 3D models are created
  99.    with 3D studio by Autodesk then ported to Animator Pro, then
  100.    scaled down/converted to my VSP files.  If you can blow a
  101.    few thousand bucks, buy the 3D studio.  You can do some amazing
  102.    3D animations. I can't afford it, I use it at work.)
  103.  
  104.  
  105.    Scott D. Ramsay