Loading

Revision differences

Old revision #pmp6dybbkNew revision #p9z28syhz
1ClearedObjectArea *IHaveNoIdeaFunction(TileIndex findclearedobject_tile, TileIndex coa_first_tile, TileIndex coa_area_tile, uint coa_area_w, uint coa_area_h)  1/**
   2 * Append an orthogonal area of cleared tiles in _cleared_object_areas, then return the pointer.
   3 * @param cleared_tile The tile being cleared, which then causes the whole area to be cleared.
   4 * @param ta_tile The top most tile of the area to be appended as cleared.
   5 * @param w The width (x) of the area to be appended as cleared.
   6 * @param h The height (y) of the area to be appended as cleared.
   7 * @return The pointer to _cleared_object_areas with the appended cleared area.
   8 */
   9ClearedObjectArea *MakeClearedObjectArea(TileIndex cleared_tile, TileIndex ta_tile, uint w, uint h)
2{  10{  
3    ClearedObjectArea *coa = FindClearedObject(findclearedobject_tile);  3    ClearedObjectArea *coa = FindClearedObject(cleared_tile);
4    if (coa == NULL) {  12    if (coa == NULL) {  
5        coa = _cleared_object_areas.Append();  13        coa = _cleared_object_areas.Append();  
6        coa->first_tile = coa_first_tile;  6        coa->first_tile = cleared_tile;
7        coa->area = TileArea(coa_area_tile, coa_area_w, coa_area_h);  7        coa->area = TileArea(ta_tile, w, h);
8    }  16    }  
  17    return coa;  
9} 18}