tree_cmd.c
changeset 0 29654efe3188
child 39 d177340ed556
equal deleted inserted replaced
-1:000000000000 0:29654efe3188
       
     1 #include "stdafx.h"
       
     2 #include "ttd.h"
       
     3 #include "viewport.h"
       
     4 #include "command.h"
       
     5 #include "town.h"
       
     6 
       
     7 static int GetRandomTreeType(uint tile, uint seed)
       
     8 {
       
     9 	byte i;
       
    10 
       
    11 	if (_opt.landscape == LT_NORMAL) {
       
    12 		return seed * 12 >> 8;
       
    13 	} else if (_opt.landscape == LT_HILLY) {
       
    14 		return (seed >> 5) + 12;
       
    15 	} else if (_opt.landscape == LT_DESERT) {
       
    16 		i = GetMapExtraBits(tile);
       
    17 		if (i == 0) {
       
    18 			return (seed >> 6) + 28;
       
    19 		} else if (i == 1) {
       
    20 			if (seed > 12)
       
    21 				return -1;	
       
    22 			return 27;
       
    23 		} else {
       
    24 			return (seed * 7 >> 8) + 20;
       
    25 		}
       
    26 	} else {
       
    27 		return (seed * 9 >> 8) + 32;
       
    28 	}
       
    29 }
       
    30 
       
    31 static void PlaceTree(uint tile, uint32 r, byte m5_or)
       
    32 {
       
    33 	int tree = GetRandomTreeType(tile, (r >> 24));
       
    34 	byte m5;
       
    35 
       
    36 	if (tree >= 0) {
       
    37 		m5 = (byte)(r >> 16);
       
    38 		if(m5==7) m5--;
       
    39 
       
    40 		_map5[tile] = m5 & 0x07;	// growth state;
       
    41 		_map5[tile] |=  m5 & 0xC0;	// amount of trees
       
    42 
       
    43 		_map3_lo[tile] = tree;		// set type of tree
       
    44 		_map3_hi[tile] = 0;		// no hedge
       
    45 
       
    46 		// above snowline?
       
    47 		if( (_opt.landscape == LT_HILLY) && (GetTileZ(tile) - _opt.snow_line > 0) )
       
    48 		{
       
    49 			_map2[tile] = 0xE0;	// set land type to snow
       
    50 			_map2[tile] |= (byte)(r >> 24)&0x07; // randomize counter
       
    51 		}
       
    52 		else
       
    53 		{
       
    54 			_map2[tile] = (byte)(r >> 24)&0x1F; // randomize counter and ground
       
    55 		}
       
    56 
       
    57 
       
    58 		// make it tree class
       
    59 		_map_type_and_height[tile] |= MP_TREES << 4;
       
    60 	}
       
    61 }
       
    62 
       
    63 static void DoPlaceMoreTrees(uint tile)
       
    64 {
       
    65 	int i = 1000;
       
    66 	int x,y;
       
    67 	uint cur_tile;
       
    68 	int dist;
       
    69 
       
    70 	do {
       
    71 		uint32 r = Random();
       
    72 		x = (r & 0x1F) - 16;
       
    73 		y = ((r>>8) & 0x1F) - 16;
       
    74 
       
    75 		dist = myabs(x) + myabs(y);
       
    76 
       
    77 		cur_tile=TILE_MASK(tile + TILE_XY(x,y));
       
    78 
       
    79 		if (dist <= 13 && IS_TILETYPE(cur_tile, MP_CLEAR)) {
       
    80 			PlaceTree(cur_tile, r, dist <= 6 ? 0xC0 : 0);
       
    81 		}
       
    82 	} while (--i);
       
    83 }
       
    84 
       
    85 static void PlaceMoreTrees()
       
    86 {
       
    87 	int i = (Random() & 0x1F) + 25;
       
    88 	do {
       
    89 		DoPlaceMoreTrees(TILE_MASK(Random()));
       
    90 	} while (--i);
       
    91 }
       
    92 
       
    93 void PlaceTreesRandomly()
       
    94 {
       
    95 	int i;
       
    96 	uint32 r;
       
    97 	uint tile;
       
    98 
       
    99 	i = 1000;
       
   100 	do {
       
   101 		r = Random();
       
   102 		tile = TILE_MASK(r);
       
   103 		if (IS_TILETYPE(tile, MP_CLEAR)) {
       
   104 			PlaceTree(tile, r, 0);
       
   105 		}
       
   106 	} while (--i);
       
   107 
       
   108 	/* place extra trees at rainforest area */
       
   109 	if (_opt.landscape == LT_DESERT) {
       
   110 		i = 15000;
       
   111 
       
   112 		do {
       
   113 			r = Random();
       
   114 			tile = TILE_MASK(r);
       
   115 			if (IS_TILETYPE(tile, MP_CLEAR) && GetMapExtraBits(tile) == 2) {
       
   116 				PlaceTree(tile, r, 0);
       
   117 			}
       
   118 		} while (--i);
       
   119 	}
       
   120 }
       
   121 
       
   122 void GenerateTrees()
       
   123 {
       
   124 	int i;
       
   125 
       
   126 	if (_opt.landscape != LT_CANDY) {
       
   127 		PlaceMoreTrees();
       
   128 	}
       
   129 
       
   130 	i = _opt.landscape == LT_HILLY ? 15 : 6;
       
   131 	do {
       
   132 		PlaceTreesRandomly();
       
   133 	} while (--i);
       
   134 }
       
   135 
       
   136 /* Plant a tree
       
   137  * p1 = tree type, -1 means random.
       
   138  * p2 = end tile
       
   139  */
       
   140 
       
   141 int32 CmdPlantTree(int ex, int ey, uint32 flags, uint32 p1, uint32 p2)
       
   142 {
       
   143 	TileInfo ti;
       
   144 	int32 cost;
       
   145 	int sx,sy,x,y;
       
   146 	int treetype;
       
   147 	
       
   148 	SET_EXPENSES_TYPE(EXPENSES_OTHER);
       
   149 
       
   150 	// make sure sx,sy are smaller than ex,ey
       
   151 	sx = GET_TILE_X(p2)*16;
       
   152 	sy = GET_TILE_Y(p2)*16;
       
   153 	if (ex < sx) intswap(ex, sx);
       
   154 	if (ey < sy) intswap(ey, sy);
       
   155 	
       
   156 	cost = 0; // total cost
       
   157 
       
   158 	for(x=sx; x<=ex; x+=16) {
       
   159 		for(y=sy; y<=ey; y+=16) {
       
   160 			FindLandscapeHeight(&ti, x, y);
       
   161 			if (!EnsureNoVehicle(ti.tile))
       
   162 				continue;
       
   163 
       
   164 			if (ti.type == MP_TREES) {
       
   165 				// no more space for trees?
       
   166 				if (_game_mode != GM_EDITOR && (ti.map5 & 0xC0) == 0xC0) {
       
   167 					_error_message = STR_2803_TREE_ALREADY_HERE;
       
   168 					continue;
       
   169 				}
       
   170 
       
   171 				if (flags & DC_EXEC) {
       
   172 					_map5[ti.tile] = ti.map5 + 0x40;
       
   173 					MarkTileDirtyByTile(ti.tile);
       
   174 				}
       
   175 				// 2x as expensive to add more trees to an existing tile
       
   176 				cost += _price.build_trees * 2;
       
   177 			} else {		
       
   178 				// don't allow building on rocks
       
   179 				if (ti.type != MP_CLEAR || _map_owner[ti.tile] != OWNER_NONE || (ti.map5 & 0x1C) == 8) {
       
   180 					_error_message = STR_2804_SITE_UNSUITABLE;
       
   181 					continue;
       
   182 				}
       
   183 
       
   184 				// it's expensive to clear farmland
       
   185 				if ((ti.map5 & 0x1F) == 0xF) cost += _price.clear_3;
       
   186 
       
   187 				if (flags & DC_EXEC) {
       
   188 					int m2;
       
   189 
       
   190 					if (_game_mode != GM_EDITOR && _current_player < MAX_PLAYERS) {
       
   191 						Town *t = ClosestTownFromTile(ti.tile, _patches.dist_local_authority);
       
   192 						if (t != NULL)
       
   193 							ChangeTownRating(t, 7, 220);
       
   194 					}
       
   195 					m2 = 0;
       
   196 					if ( (ti.map5 & 0x1C) == 4 ) {
       
   197 						m2 = 16;
       
   198 					} else if ( (ti.map5 & 0x1C) == 16 ) {
       
   199 						m2 = (ti.map5 << 6) | 0x20;
       
   200 					}
       
   201 
       
   202 					treetype = p1;
       
   203 					if (treetype == -1) {
       
   204 						treetype = GetRandomTreeType(ti.tile, Random()>>24);
       
   205 						if (treetype==-1) treetype=27;
       
   206 					}
       
   207 					
       
   208 					ModifyTile(ti.tile,
       
   209 						MP_SETTYPE(MP_TREES) | 
       
   210 						MP_MAP2 | MP_MAP3LO | MP_MAP3HI_CLEAR | MP_MAP5,
       
   211 						m2, /* map2 */
       
   212 						treetype, /* map3lo */
       
   213 			 			_game_mode == GM_EDITOR ? 3 : 0 /* map5 */
       
   214 					);
       
   215 
       
   216 					if (_game_mode == GM_EDITOR && IS_BYTE_INSIDE(treetype, 0x14, 0x1B)) {
       
   217 						SetMapExtraBits(ti.tile, 2);
       
   218 					}
       
   219 				}
       
   220 				cost += _price.build_trees;
       
   221 			}
       
   222 		}
       
   223 	}
       
   224 	
       
   225 	if (cost == 0) return CMD_ERROR;
       
   226 	return cost;
       
   227 }
       
   228 
       
   229 typedef struct TreeListEnt {
       
   230 	uint32 image;
       
   231 	byte x,y;
       
   232 } TreeListEnt;
       
   233 
       
   234 
       
   235 #include "table/tree_land.h"
       
   236 
       
   237 
       
   238 static void DrawTile_Trees(TileInfo *ti)
       
   239 {
       
   240 	byte m2;
       
   241 	const uint32 *s;
       
   242 	const byte *d;
       
   243 	byte z;
       
   244 	TreeListEnt te[4];
       
   245 
       
   246 	m2 = _map2[ti->tile];
       
   247 
       
   248 	if ( (m2&0x30) == 0) {
       
   249 		DrawClearLandTile(ti, 3);
       
   250 	} else if ((m2&0x30) == 0x20) {
       
   251 		DrawGroundSprite(_tree_sprites_1[m2 >> 6] + _tileh_to_sprite[ti->tileh]);
       
   252 	} else {
       
   253 		DrawHillyLandTile(ti);
       
   254 	}
       
   255 
       
   256 	DrawClearLandFence(ti, _map3_hi[ti->tile] >> 2);
       
   257 
       
   258 	z = ti->z;
       
   259 	if (ti->tileh != 0) {
       
   260 		z += 4;
       
   261 		if (ti->tileh & 0x10)
       
   262 			z += 4;
       
   263 	}
       
   264 
       
   265 	{
       
   266 		uint16 tmp = ti->x;
       
   267 		int index;
       
   268 
       
   269 		tmp = (tmp >> 2) | (tmp << 14);
       
   270 		tmp -= ti->y;
       
   271 		tmp = (tmp >> 3) | (tmp << 13);
       
   272 		tmp -= ti->x;
       
   273 		tmp = (tmp >> 1) | (tmp << 15);
       
   274 		tmp += ti->y;
       
   275 
       
   276 		d = _tree_layout_xy[(tmp & 0x30) >> 4];
       
   277 
       
   278 		index = ((tmp>>6)&3) + (_map3_lo[ti->tile]<<2);
       
   279 		
       
   280 		/* different tree styles above one of the grounds */
       
   281 		if ((m2 & 0xB0) == 0xA0 && index >= 48 && index < 80)
       
   282 			index += 164 - 48;
       
   283 		
       
   284 		assert(index < lengthof(_tree_layout_sprite));		
       
   285 		s = _tree_layout_sprite[index];
       
   286 	}
       
   287 
       
   288 	StartSpriteCombine();
       
   289 
       
   290 	{
       
   291 		int i;
       
   292 
       
   293 		/* put the trees to draw in a list */
       
   294 		i = (ti->map5 >> 6) + 1;
       
   295 		do {
       
   296 			uint32 image = s[0] + (--i==0 ? (ti->map5 & 7) : 3);
       
   297 			if (!(_display_opt & DO_TRANS_BUILDINGS))
       
   298 				image = (image & 0x3FFF) | 0x3224000;
       
   299 			te[i].image = image;
       
   300 			te[i].x = d[0];
       
   301 			te[i].y = d[1];
       
   302 			s++;
       
   303 			d+=2;
       
   304 		} while (i);
       
   305 
       
   306 		/* draw them in a sorted way */
       
   307 		for(;;) {
       
   308 			byte min = 0xFF;
       
   309 			TreeListEnt *tep = NULL;
       
   310 
       
   311 			i = (ti->map5 >> 6) + 1;
       
   312 			do {
       
   313 				if (te[--i].image!=0 && (byte)(te[i].x + te[i].y) < min) {
       
   314 					min = te[i].x + te[i].y;
       
   315 					tep = &te[i];
       
   316 				}
       
   317 			} while (i);
       
   318 
       
   319 			if (tep == NULL)
       
   320 				break;
       
   321 
       
   322 			AddSortableSpriteToDraw(tep->image, ti->x + tep->x, ti->y + tep->y, 5, 5, 0x10, z);
       
   323 			tep->image = 0;
       
   324 		}
       
   325 	}
       
   326 
       
   327 	EndSpriteCombine();
       
   328 }
       
   329 
       
   330 
       
   331 static uint GetSlopeZ_Trees(TileInfo *ti) {
       
   332 	return GetPartialZ(ti->x&0xF, ti->y&0xF, ti->tileh) + ti->z;
       
   333 }
       
   334 
       
   335 static int32 ClearTile_Trees(uint tile, byte flags) {
       
   336 	int num;
       
   337 
       
   338 	if (flags & DC_EXEC && _current_player < MAX_PLAYERS) {
       
   339 		Town *t = ClosestTownFromTile(tile, _patches.dist_local_authority);
       
   340 		if (t != NULL) 
       
   341 			ChangeTownRating(t, -35, -1000);
       
   342 	}
       
   343 
       
   344 	num = (_map5[tile] >> 6) + 1;
       
   345 	if ( (byte)(_map3_lo[tile]-0x14) <= (0x1A-0x14))
       
   346 		num <<= 2;
       
   347 
       
   348 	if (flags & DC_EXEC)
       
   349 		DoClearSquare(tile);
       
   350 
       
   351 	return num * _price.remove_trees;
       
   352 }
       
   353 
       
   354 static void GetAcceptedCargo_Trees(uint tile, AcceptedCargo *ac)
       
   355 {
       
   356 	/* not used */
       
   357 }
       
   358 
       
   359 static void GetTileDesc_Trees(uint tile, TileDesc *td)
       
   360 {
       
   361 	byte b;
       
   362 	StringID str;
       
   363 
       
   364 	td->owner = _map_owner[tile];
       
   365 
       
   366 	b = _map3_lo[tile];
       
   367 	(str=STR_2810_CACTUS_PLANTS, b==0x1B) ||
       
   368 	(str=STR_280F_RAINFOREST, IS_BYTE_INSIDE(b, 0x14, 0x1A+1)) ||
       
   369 	(str=STR_280E_TREES, true);
       
   370 	td->str = str; 
       
   371 }
       
   372 
       
   373 static void AnimateTile_Trees(uint tile)
       
   374 {
       
   375 	/* not used */
       
   376 }
       
   377 
       
   378 static byte _desert_sounds[] = {
       
   379 	66,67,68,72
       
   380 };
       
   381 
       
   382 static void TileLoopTreesDesert(uint tile)
       
   383 {
       
   384 	byte b;
       
   385 
       
   386 	if ((b=GetMapExtraBits(tile)) == 2) {
       
   387 		uint32 r;
       
   388 
       
   389 		if (CHANCE16I(1,200,r=Random())) {
       
   390 			SndPlayTileFx(_desert_sounds[(r >> 16) & 3], tile);
       
   391 		}
       
   392 	} else if (b == 1) {
       
   393 		if ((_map2[tile] & 0x30) != 0x20) {
       
   394 			_map2[tile] &= 0xF;
       
   395 			_map2[tile] |= 0xE0;
       
   396 			MarkTileDirtyByTile(tile);
       
   397 		}
       
   398 	}
       
   399 }
       
   400 
       
   401 static void TileLoopTreesAlps(uint tile)
       
   402 {
       
   403 	byte tmp, m2;
       
   404 	int k;
       
   405 
       
   406 	/* distance from snow line, in steps of 8 */
       
   407 	k = GetTileZ(tile) - _opt.snow_line;
       
   408 
       
   409 	tmp = _map5[tile] & 0xF0;
       
   410 
       
   411 	if (k < -8) {
       
   412 		/* snow_m2_down */
       
   413 		if ((tmp&0x30) != 0x20)
       
   414 			return;
       
   415 		m2 = 0;
       
   416 	} else if (k == -8) {
       
   417 		/* snow_m1 */
       
   418 		m2 = 0x20; 
       
   419 		if (tmp == m2)
       
   420 			return;
       
   421 	} else if (k < 8) {
       
   422 		/* snow_0 */
       
   423 		m2 = 0x60;
       
   424 		if (tmp == m2)
       
   425 			return;
       
   426 	} else if (k == 8) {
       
   427 		/* snow_p1 */
       
   428 		m2 = 0xA0;
       
   429 		if (tmp == m2)
       
   430 			return;
       
   431 	} else {
       
   432 		/* snow_p2_up */
       
   433 		if (tmp == 0xC0) {
       
   434 			uint32 r;
       
   435 			if (CHANCE16I(1,200,r=Random())) {
       
   436 				SndPlayTileFx( (r&0x80000000) ? 57 : 52, tile);
       
   437 			}
       
   438 			return;
       
   439 		} else {
       
   440 			m2 = 0xE0;
       
   441 		}
       
   442 	}
       
   443 
       
   444 	_map2[tile] &= 0xF;
       
   445 	_map2[tile] |= m2;
       
   446 	MarkTileDirtyByTile(tile);
       
   447 }
       
   448 
       
   449 static void TileLoop_Trees(uint tile)
       
   450 {
       
   451 	byte m5, m2;
       
   452 
       
   453 	static const TileIndexDiff _tileloop_trees_dir[] = {
       
   454 		TILE_XY(-1,-1),
       
   455 		TILE_XY(0,-1),
       
   456 		TILE_XY(1,-1),
       
   457 		TILE_XY(-1,0),
       
   458 		TILE_XY(1,0),
       
   459 		TILE_XY(-1,1),
       
   460 		TILE_XY(0,1),
       
   461 		TILE_XY(1,1),
       
   462 	};
       
   463 
       
   464 	if (_opt.landscape == LT_DESERT) {
       
   465 		TileLoopTreesDesert(tile);
       
   466 	} else if (_opt.landscape == LT_HILLY) {
       
   467 		TileLoopTreesAlps(tile);
       
   468 	}
       
   469 
       
   470 	TileLoopClearHelper(tile);
       
   471 
       
   472 	/* increase counter */
       
   473 	{
       
   474 		byte m2 = _map2[tile];
       
   475 		_map2[tile] = m2 = (m2 & 0xF0) | ((m2+1)&0xF);
       
   476 		if (m2 & 0xF)
       
   477 			return;
       
   478 	}
       
   479 
       
   480 	m5 = _map5[tile];
       
   481 	if ((m5&7) == 3) {
       
   482 		/* regular sized tree */
       
   483 		if (_opt.landscape == LT_DESERT && _map3_lo[tile]!=0x1B && GetMapExtraBits(tile)==1) {
       
   484 			m5++; /* start destructing */
       
   485 		} else {
       
   486 			switch(Random() & 0x7) {
       
   487 			case 0: /* start destructing */
       
   488 				m5++;
       
   489 				break;
       
   490 			
       
   491 			case 1: /* add a tree */
       
   492 				if (m5 < 0xC0) {
       
   493 					m5 = (m5 + 0x40) & ~7;
       
   494 					break;
       
   495 				}
       
   496 				/* fall through */
       
   497 
       
   498 			case 2: { /* add a neighbouring tree */
       
   499 				byte m3 = _map3_lo[tile];
       
   500 				
       
   501 				tile += _tileloop_trees_dir[Random() & 7];
       
   502 
       
   503 				if (!IS_TILETYPE(tile, MP_CLEAR))
       
   504 					return;
       
   505 
       
   506 				if ( (_map5[tile] & 0x1C) == 4) {
       
   507 					_map2[tile] = 0x10;
       
   508 				} else if ((_map5[tile] & 0x1C) == 16) {
       
   509 					_map2[tile] = (_map5[tile] << 6) | 0x20;
       
   510 				} else {
       
   511 					if ((_map5[tile] & 0x1F) != 3)
       
   512 						return;
       
   513 					_map2[tile] = 0;
       
   514 				}
       
   515 
       
   516 				_map3_lo[tile] = m3;
       
   517 				_map3_hi[tile] = 0;
       
   518 				_map_type_and_height[tile] &= 0xF;
       
   519 				_map_type_and_height[tile] |= MP_TREES << 4;
       
   520 
       
   521 				m5 = 0;
       
   522 				break;
       
   523 			}	
       
   524 
       
   525 			default:
       
   526 				return;
       
   527 			}
       
   528 		}
       
   529 	} else if ((m5&7) == 6) {
       
   530 		/* final stage of tree destruction */
       
   531 		if (m5 & 0xC0) {
       
   532 			/* more than one tree, delete it? */
       
   533 			m5 = ((m5 - 6) - 0x40) + 3;
       
   534 		} else {
       
   535 			/* just one tree, change type into MP_CLEAR */
       
   536 			_map_type_and_height[tile] = (_map_type_and_height[tile]&~0xF0) | (MP_CLEAR<<4);
       
   537 
       
   538 			m5 = 3;
       
   539 			m2 = _map2[tile];
       
   540 			if ((m2&0x30) != 0) {
       
   541 				m5 = (m2 >> 6) | 0x10;
       
   542 				if (m2 != 0x20)
       
   543 					m5 = 7;
       
   544 			}
       
   545 			_map_owner[tile] = OWNER_NONE;
       
   546 		}
       
   547 	} else {
       
   548 		/* in the middle of a transition, change to next */
       
   549 		m5++;
       
   550 	}
       
   551 
       
   552 	_map5[tile] = m5;
       
   553 	MarkTileDirtyByTile(tile);
       
   554 }
       
   555 
       
   556 void OnTick_Trees()
       
   557 {
       
   558 	uint32 r;
       
   559 	uint tile;
       
   560 	byte m;
       
   561 	int tree;
       
   562 
       
   563 	/* place a tree at a random rainforest spot */
       
   564 	if (_opt.landscape == LT_DESERT && 
       
   565 			(r=Random(),tile=TILE_MASK(r),GetMapExtraBits(tile)==2) &&
       
   566 			IS_TILETYPE(tile, MP_CLEAR) &&
       
   567 			(m=_map5[tile]&0x1C, m<=4) &&
       
   568 			(tree=GetRandomTreeType(tile, r>>24)) >= 0) {
       
   569 		
       
   570 		ModifyTile(tile,
       
   571 			MP_SETTYPE(MP_TREES) | 
       
   572 			MP_MAP2 | MP_MAP3LO | MP_MAP3HI | MP_MAP5,
       
   573 			(m == 4 ? 0x10 : 0),
       
   574 			tree,
       
   575 			_map3_hi[tile] & ~3,
       
   576 			0
       
   577 		);
       
   578 	}
       
   579 
       
   580 	// byte underflow
       
   581 	if (--_trees_tick_ctr)
       
   582 		return;
       
   583 	
       
   584 	/* place a tree at a random spot */
       
   585 	r = Random();
       
   586 	tile = TILE_MASK(r);
       
   587 	if (IS_TILETYPE(tile, MP_CLEAR) &&
       
   588 			(m=_map5[tile]&0x1C, m==0 || m==4 || m==0x10) &&
       
   589 			(tree=GetRandomTreeType(tile, r>>24)) >= 0) {
       
   590 		int m2;
       
   591 			
       
   592 		if (m == 0) {
       
   593 			m2 = 0;
       
   594 		} else if (m == 4) {
       
   595 			m2 = 0x10;
       
   596 		} else {
       
   597 			m2 = (_map5[tile] << 6) | 0x20;
       
   598 		}
       
   599 
       
   600 		ModifyTile(tile,
       
   601 			MP_SETTYPE(MP_TREES) | 
       
   602 			MP_MAP2 | MP_MAP3LO | MP_MAP3HI | MP_MAP5,
       
   603 			m2,
       
   604 			tree,
       
   605 			_map3_hi[tile] & ~3,
       
   606 			0
       
   607 		);
       
   608 	}
       
   609 }
       
   610 
       
   611 static void ClickTile_Trees(uint tile)
       
   612 {
       
   613 	/* not used */
       
   614 }
       
   615 
       
   616 static uint32 GetTileTrackStatus_Trees(uint tile, int mode)
       
   617 {
       
   618 	return 0;
       
   619 }
       
   620 
       
   621 static void ChangeTileOwner_Trees(uint tile, byte old_player, byte new_player)
       
   622 {
       
   623 	/* not used */
       
   624 }
       
   625 
       
   626 void InitializeTrees()
       
   627 {
       
   628 	memset(_sign_list, 0, sizeof(_sign_list));
       
   629 	_trees_tick_ctr = 0;
       
   630 }
       
   631 
       
   632 
       
   633 const TileTypeProcs _tile_type_trees_procs = {
       
   634 	DrawTile_Trees,						/* draw_tile_proc */
       
   635 	GetSlopeZ_Trees,					/* get_slope_z_proc */
       
   636 	ClearTile_Trees,					/* clear_tile_proc */
       
   637 	GetAcceptedCargo_Trees,		/* get_accepted_cargo_proc */
       
   638 	GetTileDesc_Trees,				/* get_tile_desc_proc */
       
   639 	GetTileTrackStatus_Trees,	/* get_tile_track_status_proc */
       
   640 	ClickTile_Trees,					/* click_tile_proc */
       
   641 	AnimateTile_Trees,				/* animate_tile_proc */
       
   642 	TileLoop_Trees,						/* tile_loop_clear */
       
   643 	ChangeTileOwner_Trees,		/* change_tile_owner_clear */
       
   644 	NULL,											/* get_produced_cargo_proc */
       
   645 	NULL,											/* vehicle_enter_tile_proc */
       
   646 	NULL,											/* vehicle_leave_tile_proc */
       
   647 };