home *** CD-ROM | disk | FTP | other *** search
- /*
- * sc.c - fractalish terrain generator.
- *
- * Date: March 5, 1987 (original version sometime in 1985)
- * Author: Chris Gray
- * Language: C
- * System: Amiga
- */
-
- /*
- * Badly hacked for 3d and Dynamic allocation under 16-bit integer Manx:
- *
- * Date: July 26, 1987
- * Barbarian: Howard Hull
- * Implements: (some) Dynamic allocation code from Ray Bovet, and
- * (considerable) custom requester code from John Draper's
- * gadget tutorial.
- * Devil's Post Pile relief generator whipped up by yours
- * truly on the spot.
- *
- * Structured design? Structured design is for lords and
- * prima donas. The rest of us have to make do, even the
- * geniuses among us:
- * "Hold up! Spare me that nonsense. It's dangerous. We're
- * set up for direct current in America. People like it,
- * and it's all I'll ever fool with. But maybe I could
- * give you a job. Can you fix a ship's lighting plant?"
- * Thomas Edison to Nikola Tesla, 1884.
- */
-
- /*
- * Gray: (continued, but edited for current content)
- *
- * The nature of the terrain can be changed by playing with the numbers
- * in 'Range'. If you change SIZE, you must also change the number of
- * values given for 'Range'. Also, if you use the graphics HIRES flag
- * to get 640 pixel width screens, it is advisable to use numbers that
- * are approximately half what give good results for 320 pixel width
- * screens. The way this is set up, the created terrain for SIZE = 8
- * and XGEOM set to SINGLES is 256 pixels by 256 pixels, which doesn't
- * fit on a non-interlaced screen. Only the top 200 pixels are shown.
- * The terrain is a torus, i.e. wraps around both horizontally as well as
- * vertically.
- *
- * In this modified program, to see the whole torus in a rectangular
- * format, use SIZE = 7 and set XGEOM to DOUBLES, YGEOM to SINGLES.
- * For other combinations of SIZE, X and Y GEOM, Range, SCREEN_HEIGHT
- * and SCREEN_WIDTH, DEPTH and ColourMap, see instructions
- * below. One of the more outrageous combinations, 256 wide by 400 high,
- * (384 pixels plus 16 for terrain relief), with 16 colors, can be set up
- * by using SIZE = 7, XGEOM = DOUBLES, YGEOM = TRIPLES, 7 value Range table,
- * SCREEN_HEIGHT = 400, SCREEN_WIDTH = 320, DEPTH = 4, use the sixteen
- * element ColourMap, and set NewWindow flag = LACE. This is also the
- * fastest Devil's Post Pile configuration, since the posts are shorter.
- * The disadvantage is that the scale of the terrain is smaller.
- */
-
- /*
- * Gray goes on to add:
- * Feel free to use this algorithm in any games you write, so long as you
- * give me [Gray] credit for it. (I THINK I invented it, since I've never
- * heard of anything similar, and other programs I've seen use much slower
- * methods.)
- */
-
- /*
- * Of course, by adding the 3d algorithm to Gray's code (that has a familiar
- * ring, somehow) things did get somewhat slower, so it's a good thing that
- * Gray decided to make the code fast!
- */
-