资 源 简 介
srand[getpid[]]
/* initialize some of the memory */
memset[heightmap, 0, MAPSIZE*MAPSIZE]
memset[vpage, 0, RENDERWIDTH * RENDERHEIGHT]
printf["Creating dx d fractal terrain
", MAPSIZE, MAPSIZE]
heightmap[0] = [rand[] 128] + 64 // initialize starting point on map
CreateFractalMap[0, 0, MAPSIZE, MAPSIZE]
printf["Smoothing terrain
"]
for [i = 0 i < 5 i++]
SmoothMap[]
MakeColorMap[]