ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/server/quadland.C
(Generate patch)

Comparing deliantra/server/server/quadland.C (file contents):
Revision 1.3 by root, Sun May 1 16:59:41 2011 UTC vs.
Revision 1.23 by root, Sat Nov 17 23:40:04 2018 UTC

1/* 1/*
2 * This file is part of Deliantra, the Roguelike Realtime MMORPG. 2 * This file is part of Deliantra, the Roguelike Realtime MMORPG.
3 * 3 *
4 * Copyright (©) 2017,2018 Marc Alexander Lehmann / the Deliantra team
4 * Copyright (©) 2011 Marc Alexander Lehmann / Robin Redeker / the Deliantra team 5 * Copyright (©) 2011,2012,2013,2014,2015,2016 Marc Alexander Lehmann / Robin Redeker / the Deliantra team
5 * 6 *
6 * Deliantra is free software: you can redistribute it and/or modify it under 7 * Deliantra is free software: you can redistribute it and/or modify it under
7 * the terms of the Affero GNU General Public License as published by the 8 * the terms of the Affero GNU General Public License as published by the
8 * Free Software Foundation, either version 3 of the License, or (at your 9 * Free Software Foundation, either version 3 of the License, or (at your
9 * option) any later version. 10 * option) any later version.
10 * 11 *
11 * This program is distributed in the hope that it will be useful, 12 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details. 15 * GNU General Public License for more details.
15 * 16 *
16 * You should have received a copy of the Affero GNU General Public License 17 * You should have received a copy of the Affero GNU General Public License
17 * and the GNU General Public License along with this program. If not, see 18 * and the GNU General Public License along with this program. If not, see
18 * <http://www.gnu.org/licenses/>. 19 * <http://www.gnu.org/licenses/>.
19 * 20 *
20 * The authors can be reached via e-mail to <support@deliantra.net> 21 * The authors can be reached via e-mail to <support@deliantra.net>
21 */ 22 */
22 23
23#include <global.h> 24#include <global.h>
24 25
25#include "noise.h" 26#include "noise.h"
26 27
28/////////////////////////////////////////////////////////////////////////////
29
30static bool
31has_floor (maptile *m, sint16 x, sint16 y)
32{
33 mapxy pos (m, x, y);
34
35 if (!pos.normalise ())
36 return true;
37
38 mapspace &ms = pos.ms ();
39
40 for (object *ob = ms.bot; ob; ob = ob->above)
41 if (ob->arch->archname == shstr_quad_open_space)
42 return false;
43 else if (ob->flag [FLAG_IS_FLOOR])
44 return true;
45
46 return false;
47}
48
49void
50move_into_wall (object *ob, object *wall)
51{
52 bool visible = !wall->invisible && !ob->flag [FLAG_BLIND];
53
54 if (wall->flag [FLAG_IS_QUAD] && visible)
55 {
56 maptile *m = wall->map;
57
58 if (ob->map->tile_path [TILE_UP] && wall->map->tile_path [TILE_UP])
59 {
60 maptile *wall_up = wall->map->tile_available (TILE_UP);
61 maptile *ob_up = ob ->map->tile_available (TILE_UP);
62
63 if (wall_up && ob_up)
64 {
65 if (ob->blocked (ob_up, ob->x, ob->y) || has_floor (ob_up, ob->x, ob->y))
66 ob->failmsg (format ("Ouch, you hit your head while climbing the %s! H<Didn't you see the ceiling? :)>", query_name (wall)));
67 //TODO: reduce health
68 else if (ob->blocked (wall_up, wall->x, wall->y))
69 ob->failmsg (format ("You try to climb up, but the %s is too high for you! H<No free space on top of this block.>", query_name (wall)));
70 //TODO: reduce health
71 else
72 {
73 ob->statusmsg (format ("You successfully climb up the %s.", query_name (wall)));
74 // here we assume that ob is a player...
75 ob->enter_map (wall_up, wall->x, wall->y);
76 }
77 }
78 else
79 ob->failmsg (format ("You try to climb the %s, but you fall down! H<Try again.>", query_name (wall)));
80 }
81 else
82 ob->failmsg (format ("You fail to climb up the %s! H<You cannot climb up here.>", query_name (wall)));
83
84
85 return;
86 }
87
88 if (ob->contr->ns->bumpmsg)
89 {
90 ob->play_sound (sound_find ("bump_wall"));
91
92 ob->statusmsg (visible
93 ? format ("You bump into the %s.", query_name (wall))
94 : "You bump into something."
95 );
96 }
97}
98
99/////////////////////////////////////////////////////////////////////////////
100
101physics_queue::physics_queue ()
102{
103 i = 0;
104}
105
106physics_queue::~physics_queue ()
107{
108 while (object *ob = pop ())
109 ob->refcnt_dec ();
110}
111
112object *
113physics_queue::pop ()
114{
115 if (expect_true (i < size ()))
116 return (*this)[i++];
117
118 i = 0;
119 clear (); //TODO: this frees, but we do not want to free, unless really a lot of objects were queued
120 return 0;
121}
122
123inline unsigned int
124queue_of (tick_t tick)
125{
126 return tick & (PHYSICS_QUEUES - 1);
127}
128
129void update_physics (maptile *m, int x, int y)
130{
131}
132
133// handle physics updates
134void move_physics (object *ob)
135{
136}
137
138// preliminary slots docs
139// level - water level 1..7
140// value - pressure
141//
142
143static object *
144flow_to (maptile *m, sint16 x, sint16 y)
145{
146 if (!xy_normalise (m, x, y))
147 return 0;
148
149 mapspace &ms = m->at (x, y);
150
151 ms.update ();
152 if (ms.move_block & MOVE_WALK)
153 return 0;
154
155 for (object *w = ms.top; w; w = w->below)
156 if (w->type == PHYSICS)
157 if (w->subtype == ST_WATER_SOURCE)
158 return 0;
159 else if (w->subtype == ST_WATER_FLOW)
160 return w;
161
162 printf ("creating flow at %d,%d\n", x, y);//D
163 object *w = archetype::get (shstr_quad_water_flow);
164 w->level = 0;
165 w->value = 0;
166
167 m->insert (w, x, y);
168 m->queue_physics (w, 1);
169
170 return w;
171}
172
173#if 0
174static int
175find_ortho_flow (object *src, object **result)
176{
177 object **res = result;
178
179 for (int dir = 1; dir < 8; dir += 2)
180 {
181 mapxy pos (src->map, src->x, src->y);
182 pos.move (dir);
183 if (pos.normalise ())
184 if (object *w = flow_to (pos.m, pos.x, pos.y))
185 *res++ = w;
186 }
187
188 return res - result;
189}
190#endif
191
192static bool
193water_set (object *w, int level, int pressure = -1)
194{
195 if (!level)
196 {
197 w->destroy ();
198 return true;
199 }
200
201 bool activity = false;
202
203 min_it (level, 7);
204
205 if (level != w->level)
206 {
207 w->level = level;
208 // update face
209 activity = true;
210 }
211
212 if (pressure != w->value && pressure >= 0)
213 {
214 w->value = pressure;
215 activity = true;
216 }
217
218 if (activity) // this is overkill, but...
219 w->map->queue_physics_at (w->x, w->y);
220
221 return activity;
222}
223
224static void
225run_physics (object *ob)
226{
227 //TODO: behaviour objects with virtual methods?
228 switch (ob->subtype)
229 {
230 case ST_WATER_SOURCE:
231 {
232 bool activity = false;
233
234 // water sources generate flowing water "everywhere", but are currently
235 // very simple otherwise.
236 if (!has_floor (ob->map, ob->x, ob->y) && ob->map->tile_path [TILE_DOWN])
237 if (maptile *m = ob->map->tile_available (TILE_DOWN))
238 {
239 if (object *w = flow_to (m, ob->x, ob->y))
240 activity = activity || water_set (w, 7);
241 }
242 else
243 activity = true;
244
245#if 0
246 object *w [4];
247 int w_cnt = find_ortho_flow (ob, w);
248
249 while (w_cnt--)
250 activity = activity || water_set (w [w_cnt], 7);
251
252 if (activity)
253 ob->map->queue_physics (ob, 1);
254#endif
255 }
256 break;
257
258 case ST_WATER_FLOW:
259#if 0
260 // flow down as much as possible
261 if (!has_floor (ob->map, ob->x, ob->y) && ob->map->tile_path [TILE_DOWN])
262 if (maptile *m = ob->map->tile_available (TILE_DOWN))
263 {
264 if (object *w = flow_to (m, ob->x, ob->y))
265 {
266 if (int flow = min (ob->level, 7 - w->level))
267 {
268 water_set (w, w->level + flow);
269 water_set (ob, w->level - flow);
270 if (!ob->level)
271 return; // we escaped downwards
272 }
273 else if (ob->level >= 5) // exert pressure -> does not count as activity
274 water_set (w, w->level, ob->value - 1);
275 }
276 }
277
278 if (ob->level >= 2)
279 {
280 object *ws [4];
281 int w_cnt = find_ortho_flow (ob, ws);
282
283 bool activity = false;
284
285 // distribute 1 to every neighbour that has less - should use some random ordering of course
286
287 while (w_cnt--)
288 {
289 object *w = ws [w_cnt];
290
291 if (w->level < ob->level - 1)
292 {
293 water_set (w, w->level + 1);
294 --ob->level;
295 activity = true;
296 }
297 }
298
299 if (activity)
300 ob->map->queue_physics (ob, 1);
301 }
302 else if (ob->level)
303 ;
304 else
305 ob->destroy ();
306#endif
307
308 // TODO: flow up with pressure
309 break;
310
311 default:
312 LOG (llevError, "object with unsupported physics subtype %d: %s\n", ob->subtype, ob->debug_desc ());
313 break;
314 }
315}
316
317int
318maptile::run_physics (tick_t tick, int max_objects)
319{
320 if (state != MAP_ACTIVE)
321 return 0;
322
323 int orig_max_object = max_objects;
324 physics_queue &q = pq [queue_of (server_tick)];
325
326 //if (q.size()) printf ("q %d < %d\n", q.i, (int)q.size());//D
327
328 while (object *ob = q.pop ())
329 {
330 ob->flag [FLAG_PHYSICS_QUEUE] = false;
331 ob->refcnt_dec ();
332
333 if (ob->map != this)
334 {
335 if (!ob->flag [FLAG_FREED])
336 {
337 LOG (llevError, "%s: physical object on wrong map\n", ob->debug_desc ());
338 //ob->map->queue_physics (ob);
339 }
340 }
341 else
342 {
343 //printf ("handling ob %s\n", ob->debug_desc());//D
344 ::run_physics (ob);
345 }
346
347 if (--max_objects <= 0)
348 break;
349 }
350
351 return orig_max_object - max_objects;
352}
353
354void
355maptile::queue_physics (object *ob, int after)
356{
357 if (!after) after = 14; //D
358 if (!ob->flag [FLAG_PHYSICS_QUEUE])
359 {
360 ob->flag [FLAG_PHYSICS_QUEUE] = true;
361 ob->refcnt_inc ();
362
363 pq [queue_of (server_tick + min (PHYSICS_QUEUES - 2, after))].push_back (ob);
364 }
365}
366
367static void
368queue_physics_at (maptile *m, int x, int y)
369{
370 mapspace &ms = m->at (x, y);
371
372 for (object *ob = ms.bot; ob; ob = ob->above)
373 if (ob->type == PHYSICS)
374 m->queue_physics (ob, 1);
375}
376
377// this mapspace has changed - potentially activate dormant physics objects
378// in the vicinity. vicinity is the 4 spaces around in the same z layer, and above and below.
379// TODO: maybe include diagonals in the same z-layer?
380// TODO: do not go through floors?
381void
382maptile::queue_physics_at (int x, int y)
383{
384 if (maptile *m = tile_available (TILE_DOWN))
385 ::queue_physics_at (m, x, y);
386
387 if (maptile *m = tile_available (TILE_UP))
388 ::queue_physics_at (m, x, y);
389
390 ::queue_physics_at (this, x, y);
391
392 for (int dir = 1; dir < 8; dir += 2)
393 {
394 mapxy pos (this, x, y);
395 pos.move (dir);
396 if (pos.normalise ())
397 ::queue_physics_at (pos.m, pos.x, pos.y);
398 }
399}
400
401void
402maptile::activate_physics ()
403{
404 // most of this is total overkill, but better be safe than sorry, eh?
405
406 coroapi::cede_to_tick ();
407
408 if (maptile *m = tile_map [TILE_UP])
409 for (mapspace *ms = spaces + size (); ms-- > spaces; )
410 ms->invalidate (); // invalidate faces, in case...
411
412 coroapi::cede_to_tick ();
413
414 for (mapspace *ms = spaces + size (); ms-- > spaces; )
415 for (object *op = ms->bot; op; op = op->above)
416 if (op->type == PHYSICS)
417 queue_physics (op, 0);
418}
419
420/////////////////////////////////////////////////////////////////////////////
421
27#define FANCY_GRAPHICS 0 422#define FANCY_GRAPHICS 0
28 423
29static void 424static void
30gen_quadspace (maptile *m, int mx, int my, int x, int y, int z) 425gen_quadspace (maptile *m, int mx, int my, int x, int y, int z)
31{ 426{
38 static frac2d vec_gen1 (6, 2, 0.5, 1); 433 static frac2d vec_gen1 (6, 2, 0.5, 1);
39 static frac2d vec_gen2 (6, 2, 0.5, 2); 434 static frac2d vec_gen2 (6, 2, 0.5, 2);
40 435
41 const float continent_scale = 0.00008; 436 const float continent_scale = 0.00008;
42 437
43 vec2d perturb_pos = pow (P, 1.4) * 1e-5; 438 vec2d perturb_pos = pow (P, vec2d (1.4)) * 1e-5;
44 439
45 vec2d perturb ( 440 vec2d perturb (
46 vec_gen1.fBm (perturb_pos), 441 vec_gen1.fBm (perturb_pos),
47 vec_gen2.fBm (perturb_pos) 442 vec_gen2.fBm (perturb_pos)
48 ); 443 );
62 457
63 const float N = (25000 - 1) * continent_scale; 458 const float N = (25000 - 1) * continent_scale;
64 459
65 // we clip a large border on the perturbed shape, to get irregular coastline 460 // we clip a large border on the perturbed shape, to get irregular coastline
66 // and then clip a smaller border around the real shape 461 // and then clip a smaller border around the real shape
67 continent = border_blend (-1.f, continent, P_continent , N, 400 * continent_scale); 462 //continent = border_blend (-1.f, continent, P_continent , N, 400 * continent_scale);
68 continent = border_blend (-1.f, continent, P * continent_scale + perturb * 0.1, N, 100 * continent_scale); 463 continent = border_blend (-1.f, continent, P * continent_scale + perturb * 0.1, N, 100 * continent_scale);
69 464
70 enum { 465 enum {
71 T_NONE, 466 T_NONE,
72 T_OCEAN, 467 T_OCEAN,
73 T_RIVER, 468 T_RIVER,
74 T_VALLEY, 469 T_VALLEY,
75 T_MOUNTAIN, 470 T_MOUNTAIN,
76 T_UNDERGROUND, 471 T_UNDERGROUND,
472 T_AIR, // unused
77 T_ACQUIFER, 473 T_ACQUIFER,
78 } t = T_NONE; 474 } t = T_NONE;
79 475
80 vec3d c; 476 vec3d c;
81 int h0 = 0; // "water level" 477 int h0 = 0; // "water level"
82 int h = 1000000; // height form heightmap 478 int h = 1000000; // height form heightmap
83 479
84 // the continent increases in height from 0 to ~700 levels in the absence of anything else 480 // the continent increases in height from 0 to ~700 levels in the absence of anything else
85 // thats about one step every 7 maps. 481 // thats about one step every 7 maps.
86 int base_height = blend (0, 300, xy_gradient, 0.2f, 0.9f); 482 int base_height = blend (0, 300, xy_gradient, 0.2f, 0.9f);
87 int river_height = base_height * 9 / 10; 483 int river_height = base_height; // * 9 / 10;
88 484
89 // add this to rivers to "dry them out" 485 // add this to rivers to "dry them out"
90 float dry_out = max (0.f, lerp (xy_gradient, 0.7f, 1.f, 0.f, 0.3f)); 486 float dry_out = max (0.f, lerp (xy_gradient, 0.7f, 1.f, 0.f, 0.3f));
91 487
92 static frac2d river_gen (2); 488 static frac2d river_gen (2);
93 float river1 = abs (river_gen.fBm (P * 0.001 + perturb * 4)) + dry_out; 489 float river1 = abs (river_gen.fBm (P * 0.001 + perturb * 4)) + dry_out;
94 float river2 = river_gen.ridgedmultifractal (P * 0.04, 0.8, 10) - y_gradient * 0.2 - 0.16 - dry_out; 490 float river2 = river_gen.ridgedmultifractal (P * 0.04, 0.8, 10) - y_gradient * 0.2 - 0.16 - dry_out;
95 491
96 float valley = river1 - 0.2f; 492 float valley = river1 - 0.2f;
97 493
98 static frac2d mountain_gen (8, 2.14, 0.5); 494 static frac2d mountain_gen (6, 2.14, 0.5);
99 float mountain = mountain_gen.ridgedmultifractal (P * 0.004); 495 float mountain = mountain_gen.ridgedmultifractal (P * 0.004);
100 496
101 //TODO: mountains should not lower the height, should they? 497 //TODO: mountains should not lower the height, should they?
102 t = valley < 0 ? T_VALLEY : T_MOUNTAIN; 498 t = valley < 0 ? T_VALLEY : T_MOUNTAIN;
103 c = blend0 (vec3d (0, 0.8, 0), vec3d (0.8, 0, 0), valley, 0.1f); 499 c = blend0 (vec3d (0, 0.8, 0), vec3d (0.8, 0, 0), valley, 0.1f);
104 h = blend0 (base_height + continent * 300, base_height + mountain * xy_gradient * 400, valley, 0.1f); 500 h = blend0 (base_height + continent * 0, base_height + mountain * xy_gradient * 100, valley, 0.1f);
105 501
106 if (river1 < 0.01f) 502 if (river1 < 0.01f)
107 { 503 {
108 // main rivers - they cut deeply into the mountains (base_height * 0.9f) 504 // main rivers - they cut deeply into the mountains (base_height * 0.9f)
505 // well, silly, they don't
109 t = T_RIVER; 506 t = T_RIVER;
110 c = vec3d (0.2, 0.2, 1); 507 c = vec3d (0.2, 0.2, 1);
111 h0 = river_height; 508 h0 = river_height;
112 min_it (h, river_height + lerp<float> (river1, 0.f, 0.01f, -20, -1)); 509 min_it (h, river_height + lerp<float> (river1, 0.f, 0.01f, -10, -1));
113 } 510 }
114 511
115 if (river2 > 0) 512 if (river2 > 0)
116 { 513 {
117 t = T_RIVER; 514 t = T_RIVER;
118 c = vec3d (0.2, 0.2, 1); 515 c = vec3d (0.2, 0.2, 1);
119 h0 = river_height; 516 h0 = river_height;
120 min_it (h, river_height + lerp<float> (river1, 0.f, 0.01f, -5, -1)); 517 min_it (h, river_height + max (-5, lerp<float> (river2, 0.01f, 0, -4, -1)));
121 } 518 }
122 519
123 if (continent < 0) 520 if (continent < 0)
124 { 521 {
125 t = T_OCEAN; 522 t = T_OCEAN;
523 h0 = 0;
126 min_it (h, min (continent * 200, -1)); 524 min_it (h, min (continent * 200, -1));
127 c = vec3d (0, 0, 1); 525 c = vec3d (0, 0, 1);
128 } 526 }
129 527
130 // now we have the base height, and base terrain 528 // now we have the base height, and base terrain
135 533
136 max_it (h0, h); 534 max_it (h0, h);
137 535
138 // everything below the surface is underground, or a variant 536 // everything below the surface is underground, or a variant
139 if (z < h) 537 if (z < h)
140 {
141 t = T_UNDERGROUND; 538 t = T_UNDERGROUND;
142 }
143 539
144 // put acquifers a bit below the surface, to reduce them leaking out (will still happen) 540 // put acquifers a bit below the surface, to reduce them leaking out (will still happen)
145 if (z < h - 3) 541 if (z < h - 3)
146 { 542 {
147 static frac3d acquifer_gen (4); 543 static frac3d acquifer_gen (4);
151 { 547 {
152 t = T_ACQUIFER; 548 t = T_ACQUIFER;
153 c = vec3d (1,1,1); 549 c = vec3d (1,1,1);
154 } 550 }
155 } 551 }
552
553 //printf ("+%d+%d %d z %d h %d,%d P%g,%g\n", mx, my, t, z, h,h0, P[0],P[1]);//D
156 554
157 // TODO: caves 555 // TODO: caves
158 // TODO: chees areas 556 // TODO: chees areas
159 // TODO: minerals 557 // TODO: minerals
160 // TODO: monsters 558 // TODO: monsters
168 putc (clamp<int> (255 * c[2], 0, 255), stdout); 566 putc (clamp<int> (255 * c[2], 0, 255), stdout);
169#else 567#else
170 shstr arch_floor = shstr ("quad_open_space"); 568 shstr arch_floor = shstr ("quad_open_space");
171 shstr arch_wall; 569 shstr arch_wall;
172 570
571 // TODO: this is shit - we should never generatea water surface, but only
572 // water above the surface
173 switch (t) 573 switch (t)
174 { 574 {
175 case T_OCEAN: 575 case T_OCEAN:
576 if (z < h0)
577 arch_wall = shstr_quad_water_source;
578 else if (z == h0)
579 arch_floor = shstr ("quad_ocean_floor");
580 break;
581
176 case T_RIVER: 582 case T_RIVER:
177 if (z < h0) 583 if (z < h0)
584 arch_wall = shstr_quad_water_source;
585 else if (z == h0)
178 arch_wall = shstr ("quad_water_wall"); 586 arch_floor = shstr ("quad_water_floor");
179 break; 587 break;
180 588
181 case T_VALLEY: 589 case T_VALLEY:
182 if (z == h) 590 if (z == h)
183 arch_floor = shstr ("quad_dirt_floor"); 591 arch_floor = shstr ("quad_dirt_floor");
190 598
191 case T_UNDERGROUND: 599 case T_UNDERGROUND:
192 // todo, use a fractal 600 // todo, use a fractal
193 if (z < h - 10) 601 if (z < h - 10)
194 { 602 {
603 arch_floor = shstr ("quad_stone_floor");
604 arch_wall = shstr ("quad_stone_wall");
605 }
606 else
607 {
195 arch_floor = shstr ("quad_dirt_floor"); 608 arch_floor = shstr ("quad_dirt_floor");
196 arch_wall = shstr ("quad_dirt_wall"); 609 arch_wall = shstr ("quad_dirt_wall");
197 } 610 }
198 else
199 {
200 arch_floor = shstr ("quad_stone_floor");
201 arch_wall = shstr ("quad_stone_wall");
202 }
203 break; 611 break;
204 612
205 case T_ACQUIFER: 613 case T_ACQUIFER:
206 arch_wall = shstr ("quad_water_wall"); 614 arch_wall = shstr_quad_water_source;
207 break; 615 break;
208 616
209 default: 617 default:
210 abort (); 618 abort ();
211 } 619 }
227 for (int mx = 0; mx < 50; ++mx) 635 for (int mx = 0; mx < 50; ++mx)
228 for (int my = 0; my < 50; ++my) 636 for (int my = 0; my < 50; ++my)
229 gen_quadspace (m, mx, my, x + mx, y + my, z); 637 gen_quadspace (m, mx, my, x + mx, y + my, z);
230} 638}
231 639
640/////////////////////////////////////////////////////////////////////////////
641
232void noise_test (); 642void noise_test ();
233void noise_test () 643void noise_test ()
234{ 644{
235#if 1 645#if 1
236 int Nw = 700; 646 int Nw = 700;
250 { 660 {
251 if (!(y&63))fprintf (stderr, "y %d\n", y * 50 / Nw+50);//D 661 if (!(y&63))fprintf (stderr, "y %d\n", y * 50 / Nw+50);//D
252 662
253 for (int x = 0; x < Nw; ++x) gen_quadspace (0, 0, 0, x + 1000, y + 22000, 0); 663 for (int x = 0; x < Nw; ++x) gen_quadspace (0, 0, 0, x + 1000, y + 22000, 0);
254 for (int x = 0; x < Nw; ++x) gen_quadspace (0, 0, 0, x + 12500, y + 12500, 0); 664 for (int x = 0; x < Nw; ++x) gen_quadspace (0, 0, 0, x + 12500, y + 12500, 0);
255 for (int x = 0; x < Nw; ++x) gen_quadspace (0, 0, 0, x + 22000, y + 22500, 0); 665 for (int x = 0; x < Nw; ++x) gen_quadspace (0, 0, 0, x + 22000, y + 22000, 0);
256 } 666 }
257 667
258 //putc (127 * gen.noise (vec2d (x * 0.01, y * 0.01)) + 128, stdout); 668 //putc (127 * gen.noise (vec2d (x * 0.01, y * 0.01)) + 128, stdout);
259 //putc (256 * gen.terrain2 (x * 0.004, y * 0.004, 8), stdout); 669 //putc (256 * gen.terrain2 (x * 0.004, y * 0.004, 8), stdout);
260 //putc (256 * gen.fBm (vec2d(x * 0.01, y * 0.01), 16), stdout); 670 //putc (256 * gen.fBm (vec2d(x * 0.01, y * 0.01), 16), stdout);
319 } 729 }
320#endif 730#endif
321 731
322 exit (0); 732 exit (0);
323} 733}
734

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines