Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def getLoaders(screenCols:Int, screenRows:Int, tooltipId:WindowId):Coroutine[WorldPanel] = {
- val seed = 0//System.nanoTime
- val worldSize = 256
- val cols = worldSize
- val rows = worldSize
- val minimapSize = WorldPanel.minimapSize
- val bgColor = Color.Blue
- println("Seed: " + seed + "L")
- val date = DateConstants(framesPerDay = 60*60*24*60)
- val perlin = PerlinParams(worldSize/4, 8, worldSize, seed)
- val worldParams = WorldParams(minimapSize, perlin, date)
- import loading._
- Yield(0, "Loading region data", () => {
- val (altRegions, latRegions, surfaceRegions) = Loads.loadRegionMaps.get
- val latMap = new LatitudeMap(cols, rows, latRegions)
- Yield(12, "Loading biome data", () => {
- val biomes = Loads.loadBiomes(latRegions, altRegions, surfaceRegions).get
- Yield(25, "Generating noise", () => {
- val noise = new PerlinNoise(worldParams.perlin).render
- Yield(34, "Generating surface features", () => {
- val surface = new SurfaceMap(noise, worldParams.perlin, surfaceRegions)
- Yield(50, "Generating wind currents", () => {
- val windMap = new StaticWindMap(surface.heightMap, 10000, 1, seed)
- Yield(62, "Plotting average rainfall", () => {
- val moistureMap = new MoistureMap(surface, latMap.latitude, windMap.arrows, 0.5, cols/2, seed)
- Yield(75, "Choosing biomes", () => {
- val biomeMap = new BiomeMap(moistureMap, surface, latMap, altRegions, biomes)
- Yield(88, "Constructing ecosphere", () => {
- val eco = Ecosphere.buildEcosphere(worldParams, latMap, noise, surface, windMap, moistureMap, biomeMap, surfaceRegions, latRegions, altRegions, Vector())
- val world = World.create(worldParams, eco)
- val mapWidth = WorldPanel.computeMapWidth(screenCols)
- val sideWidth = WorldPanel.computeSideWidth(screenCols)
- val mapRect = Recti(sideWidth + 2, 1, mapWidth - 3, screenRows - 2)
- val worldPanel = WorldPanel.create(mapRect, minimapSize, worldSize, world, worldParams, tooltipId)
- Return(() => {
- worldPanel
- })
- })
- })
- })
- })
- })
- })
- })
- })
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement