landscape.c
changeset 851 a4d26deb136b
parent 840 10fbbdd22777
child 856 918759cedca8
equal deleted inserted replaced
850:7a9b9f01d5f0 851:a4d26deb136b
   442 	_map_extra_bits[tile >> 2] |= (bits&3) << ((tile&3)*2);
   442 	_map_extra_bits[tile >> 2] |= (bits&3) << ((tile&3)*2);
   443 }
   443 }
   444 
   444 
   445 uint GetMapExtraBits(uint tile)
   445 uint GetMapExtraBits(uint tile)
   446 {
   446 {
   447 	return (_map_extra_bits[tile >> 2] >> (tile&3)*2)&3;
   447 	if (GET_TILE_X(tile) < MapSizeX() && GET_TILE_Y(tile) < MapSizeY() &&
       
   448 			GET_TILE_X(tile) > 0 && GET_TILE_Y(tile) > 0)
       
   449 		return (_map_extra_bits[tile >> 2] >> (tile&3)*2)&3;
       
   450 	else
       
   451 		return 0;
   448 }
   452 }
   449 
   453 
   450 #define TILELOOP_BITS 4
   454 #define TILELOOP_BITS 4
   451 #define TILELOOP_SIZE (1 << TILELOOP_BITS)
   455 #define TILELOOP_SIZE (1 << TILELOOP_BITS)
   452 #define TILELOOP_ASSERTMASK ((TILELOOP_SIZE-1) + ((TILELOOP_SIZE-1) << TILE_X_BITS))
   456 #define TILELOOP_ASSERTMASK ((TILELOOP_SIZE-1) + ((TILELOOP_SIZE-1) << TILE_X_BITS))