src/map_func.h
changeset 8380 174326093caa
parent 8348 4d7c1c5055b3
child 8391 193b256c681c
equal deleted inserted replaced
8379:94fcc26a241a 8380:174326093caa
   242 	assert(IsValidDiagDirection(dir));
   242 	assert(IsValidDiagDirection(dir));
   243 	return _tileoffs_by_diagdir[dir];
   243 	return _tileoffs_by_diagdir[dir];
   244 }
   244 }
   245 
   245 
   246 /**
   246 /**
       
   247  * Returns the TileIndexDiffC offset from a Direction.
       
   248  *
       
   249  * @param dir The given direction
       
   250  * @return The offset as TileIndexDiffC value
       
   251  */
       
   252 static inline TileIndexDiffC TileIndexDiffCByDir(Direction dir)
       
   253 {
       
   254 	extern const TileIndexDiffC _tileoffs_by_dir[DIR_END];
       
   255 
       
   256 	assert(IsValidDirection(dir));
       
   257 	return _tileoffs_by_dir[dir];
       
   258 }
       
   259 
       
   260 /**
   247  * Add a TileIndexDiffC to a TileIndex and returns the new one.
   261  * Add a TileIndexDiffC to a TileIndex and returns the new one.
   248  *
   262  *
   249  * Returns tile + the diff given in diff. If the result tile would end up
   263  * Returns tile + the diff given in diff. If the result tile would end up
   250  * outside of the map, INVALID_TILE is returned instead.
   264  * outside of the map, INVALID_TILE is returned instead.
   251  *
   265  *