landscape.c
changeset 1202 4d2a20c50760
parent 1193 edf70d2a5ea6
child 1209 2e00193652b2
equal deleted inserted replaced
1201:ac4524600c0b 1202:4d2a20c50760
   654 {
   654 {
   655 	int i,flag;
   655 	int i,flag;
   656 	uint32 r;
   656 	uint32 r;
   657 
   657 
   658 	if (_opt.landscape == LT_HILLY) {
   658 	if (_opt.landscape == LT_HILLY) {
   659 		i = ((Random() & 0x7F) + 950) * LANDSCAPE_SIZE_FACTOR;
   659 		i = ScaleByMapSize((Random() & 0x7F) + 950);
   660 		do {
   660 		do {
   661 			GenerateTerrain(2, 0);
   661 			GenerateTerrain(2, 0);
   662 		} while (--i);
   662 		} while (--i);
   663 
   663 
   664 		r = Random();
   664 		r = Random();
   665 		flag = (r & 3) | 4;
   665 		flag = (r & 3) | 4;
   666 		i = (((r >> 16) & 0x7F) + 450) * LANDSCAPE_SIZE_FACTOR;
   666 		i = ScaleByMapSize(((r >> 16) & 0x7F) + 450);
   667 		do {
   667 		do {
   668 			GenerateTerrain(4, flag);
   668 			GenerateTerrain(4, flag);
   669 		} while (--i);
   669 		} while (--i);
   670 	} else if (_opt.landscape == LT_DESERT) {
   670 	} else if (_opt.landscape == LT_DESERT) {
   671 		i = ((Random()&0x7F) + 170) * LANDSCAPE_SIZE_FACTOR;
   671 		i = ScaleByMapSize((Random()&0x7F) + 170);
   672 		do {
   672 		do {
   673 			GenerateTerrain(0, 0);
   673 			GenerateTerrain(0, 0);
   674 		} while (--i);
   674 		} while (--i);
   675 
   675 
   676 		r = Random();
   676 		r = Random();
   677 		flag = (r & 3) | 4;
   677 		flag = (r & 3) | 4;
   678 		i = (((r >> 16) & 0xFF) + 1700) * LANDSCAPE_SIZE_FACTOR;
   678 		i = ScaleByMapSize(((r >> 16) & 0xFF) + 1700);
   679 		do {
   679 		do {
   680 			GenerateTerrain(0, flag);
   680 			GenerateTerrain(0, flag);
   681 		} while (--i);
   681 		} while (--i);
   682 
   682 
   683 		flag ^= 2;
   683 		flag ^= 2;
   684 
   684 
   685 		i = ((Random() & 0x7F) + 410) * LANDSCAPE_SIZE_FACTOR;
   685 		i = ScaleByMapSize((Random() & 0x7F) + 410);
   686 		do {
   686 		do {
   687 			GenerateTerrain(3, flag);
   687 			GenerateTerrain(3, flag);
   688 		} while (--i);
   688 		} while (--i);
   689 	} else {
   689 	} else {
   690 		i = ((Random() & 0x7F) + (3 - _opt.diff.quantity_sea_lakes)*256 + 100) * LANDSCAPE_SIZE_FACTOR;
   690 		i = ScaleByMapSize((Random() & 0x7F) + (3 - _opt.diff.quantity_sea_lakes) * 256 + 100);
   691 		do {
   691 		do {
   692 			GenerateTerrain(_opt.diff.terrain_type, 0);
   692 			GenerateTerrain(_opt.diff.terrain_type, 0);
   693 		} while (--i);
   693 		} while (--i);
   694 	}
   694 	}
   695 
   695