clear_cmd.c
changeset 2051 e369160ce2f3
parent 2049 538e73c53f54
child 2140 a04d0142ad65
equal deleted inserted replaced
2050:3b37e813823a 2051:e369160ce2f3
   772 	uint32 r;
   772 	uint32 r;
   773 
   773 
   774 	/* add hills */
   774 	/* add hills */
   775 	i = ScaleByMapSize((Random() & 0x3FF) + 0x400);
   775 	i = ScaleByMapSize((Random() & 0x3FF) + 0x400);
   776 	do {
   776 	do {
   777 		tile = TILE_MASK(Random());
   777 		tile = RandomTile();
   778 		if (IsTileType(tile, MP_CLEAR))
   778 		if (IsTileType(tile, MP_CLEAR))
   779 			_m[tile].m5 = (byte)((_m[tile].m5 & ~(3<<2)) | (1<<2));
   779 			_m[tile].m5 = (byte)((_m[tile].m5 & ~(3<<2)) | (1<<2));
   780 	} while (--i);
   780 	} while (--i);
   781 
   781 
   782 	/* add grey squares */
   782 	/* add grey squares */
   783 	i = ScaleByMapSize((Random() & 0x7F) + 0x80);
   783 	i = ScaleByMapSize((Random() & 0x7F) + 0x80);
   784 	do {
   784 	do {
   785 		r = Random();
   785 		r = Random();
   786 		tile = TILE_MASK(r);
   786 		tile = RandomTileSeed(r);
   787 		if (IsTileType(tile, MP_CLEAR)) {
   787 		if (IsTileType(tile, MP_CLEAR)) {
   788 			j = ((r >> 16) & 0xF) + 5;
   788 			j = ((r >> 16) & 0xF) + 5;
   789 			for(;;) {
   789 			for(;;) {
   790 				TileIndex tile_new;
   790 				TileIndex tile_new;
   791 
   791