home *** CD-ROM | disk | FTP | other *** search
- Unit Imaging;
-
- { Imaging version 1.0 Copyright (C) 1992 Scott D. Ramsay }
-
- { This unit is specifically for Mode 13h (320x200x256). It is a }
- { lot faster than using the BGI drivers (VGA256.BGI). Majority of }
- { the code is written using BASM. This will work on 286 machines or }
- { higher. "I don't know about the P5 chip though." ;) }
- { IMAGING.TPU can be used freely in commerical and non-commerical }
- { programs. As long as you don't give yourself credit for writing }
- { this portion of the code. When distributing it (free only), please }
- { include all files and samples so others may enjoy using the code. }
- { Enjoy. }
-
- { Please bear with my comments. I'm not a tech-writer. You're more }
- { than welcome to modify the comments in this file for people to }
- { understand. }
-
-
- Interface
-
- Uses VgaKern;
-
- type
- VidHdrType = record
- position,count : word; { header block for PTR files }
- end;
-
- var
- rgb256 : RGBlist; { palette of last loaded PCX file }
-
- function loadpcx(pfilename:string):integer;
- procedure DrawPtr(var p;merge:boolean;sz:longint);
- function LoadPTR(fn:string;merge:boolean):integer;
- function SavePTR(fn:string):integer;
-
- Implementation
-
- (***********************************************************************)
-
- function loadpcx(pfilename:string):integer;
-
- loads a PCX file from disk to the current page. Returns 0 if no error,
- Make sure its a 320x200 image.
-
- (***********************************************************************)
- procedure DrawPtr(var p;merge:boolean;sz:longint);
-
- loads a PTR file from memory to the current page
- p : is the PTR location,
- merge : set to true to overlay image
- sz : size of PTR file
-
- (***********************************************************************)
- function LoadPTR(fn:string;merge:boolean):integer;
-
- loads a PTR file from disk to the current page, returns
- 0 if no error
-
- (***********************************************************************)
- function SavePTR(fn:string):integer;
-
- save the current page as a PTR file, returns 0 if no error
-
-
- (***********************************************************************)
-
- If you have any problems, e-mail at:
-
- ramsays@express.digex.com
-
- Sorry, I don't have permanent snail-mail address yet. I just moved
- to the Washington DC area.
-
- The TPU units can be used with in your programs. With out giving
- me credit. If you want the source code, more samples or swap-talk,
- just e-mail me. I'll give sample use-code for free. Actual TPU-source
- code prices can be discussed.
-
- Also, I have completed the following programs.
-
- GEOMAKER Makes tile-maps quickly.
- VSPMAKER Makes the VSP files.
- BKMAKER A drawing program that can read
- VEW files (my own raw format)
- PTR files (my own compressed format)
- GIF files
- PCX files
-
- The three above programs are specifically designed for the 320x200x256
- (game development). I'll upload them when I think they are ready
- to go. (Bout a week)
-
- (Artwork samples done by me. Freeware. Knock your-self out.
- Plug. Highly recommended. For game programmers, try to get
- Animator Pro by Autodesk. This is an excellent program for
- imaging, sprites and so forth. Very similar to the Animator,
- but has better graphic features. The 3D models are created
- with 3D studio by Autodesk then ported to Animator Pro, then
- scaled down/converted to my VSP files. If you can blow a
- few thousand bucks, buy the 3D studio. You can do some amazing
- 3D animations. I can't afford it, I use it at work.)
-
-
- Scott D. Ramsay