419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
|
void
setupworld(int factor)
{
ssize = 1 << (sfactor = factor);
cubicsize = ssize * ssize;
mipsize = cubicsize * 134 / 100;
sqr *w = world = (sqr *)alloc(mipsize * sizeof(sqr));
loopi(LARGEST_FACTOR * 2)
{
wmip[i] = w;
w += cubicsize >> (i * 2);
}
}
void
empty_world(
int factor, bool force) // main empty world creation routine, if passed
// factor -1 will enlarge old world by 1
{
if (!force && noteditmode())
return;
cleardlights();
pruneundos();
sqr *oldworld = world;
bool copy = false;
|
|
>
>
|
<
<
|
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
|
void
setupworld(int factor)
{
ssize = 1 << (sfactor = factor);
cubicsize = ssize * ssize;
mipsize = cubicsize * 134 / 100;
sqr *w = world = (sqr *)OFAllocZeroedMemory(mipsize, sizeof(sqr));
loopi(LARGEST_FACTOR * 2)
{
wmip[i] = w;
w += cubicsize >> (i * 2);
}
}
// main empty world creation routine, if passed factor -1 will enlarge old
// world by 1
void
empty_world(int factor, bool force)
{
if (!force && noteditmode())
return;
cleardlights();
pruneundos();
sqr *oldworld = world;
bool copy = false;
|
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
|
block b = { 8, 8, ssize - 16, ssize - 16 };
edittypexy(SPACE, b);
}
calclight();
startmap(@"base/unnamed");
if (oldworld) {
free(oldworld);
toggleedit();
execute(@"fullbright 1");
}
}
void
mapenlarge()
|
|
|
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
|
block b = { 8, 8, ssize - 16, ssize - 16 };
edittypexy(SPACE, b);
}
calclight();
startmap(@"base/unnamed");
if (oldworld) {
OFFreeMemory(oldworld);
toggleedit();
execute(@"fullbright 1");
}
}
void
mapenlarge()
|