                       WPolyfill Source Code&

        Considerable  effort  went into creating the fastest
     polygon filling routine for the IBM PC.    Our  routine
     does  full  clipping,  can  draw  the border lines in a
     different color, mesh two pixels for total of ten  fill
     colors  (instead  of  just  four), and can even perform
     shaded and  translucent  fillings.    The  clipping  is
     automatic, the other fuctions are controlled by bits in
     the color  word.    The  "C" program, "polygons" simply
     loads up the xypoints array with a regular  polygon  of
     random size,  sides and center point. The color word is
     cycled,decremented, to show all color modes. Just type:

        polygons          Run polygon demo.

        This  program  also may give you some insight to the
     way trigonometric fuctions are used in  the  game.  The
     "mult"  simply  performs a signed multiplication of two
     16 bit words with one radix point to the right  of  the
     12'th bit, in other words, the normal signed product is
     then arithmeticly shifted 12 bits to the right.  One of
     the  two  arguments  of  the "mult" may be thought of a
     scaling variable having a range of -8 to +8 accurate to
     the nearest 1/4096.  In this case, the scaling variable
     is the "sini" or "cosi" look-up table  functions.  This
     means  that  the  trig  functions  will have a range of
     0x1000 (one) to 0xf000 (minus one).

        All of the source to "polygons" is provided  in  the
     two source  modules,  poly.c and poly.asm.  A very good
     starting point for anybody wishing to  develop  graphic
     software on IBM PC's.  You will have the assurance that
     your  implementation will be the WFASTEST& possible since
     the trig is actually 16bit integer math,and the polygon
     filling is the fastest. The same way  as  used  by  the
     game.   Generally,  it is alway best to have the source
     to any underlying graphic  or  sound  primitives,  that
     way,  you'r in control ! In addition to "polyfill", you
     also have  the  source  to  "gline"  the  fastest  line
     drawing routine for the PC, and with complete clipping!

        These two graphic primitives are the only two we use
     or need in  the  game.    The  full  details  of  their
     operation is included in "polydoc" and in the extensive
     inline documentation.  If you were using QNX, you could
     just pull the source off the QNX  free  bulletin board.
     But  you are probably using a DOS "C" and assembler, in
     which case,  you  will  need  to  change  much  of  the
     assembly code mnemonics as outlined in "polydoc". 
