Loading

Revision differences

Old revision #p41r06sx1New revision #p9z28syhz
1/**  1/**  
2 * Append an orthogonal area of cleared tiles in _cleared_object_areas, then return with the list.  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 object to be cleared.  3 * @param cleared_tile The tile being cleared, which then causes the whole area to be cleared.
4 * @param coa_tile The top most tile of the area to be appended as cleared.  4 * @param ta_tile The top most tile of the area to be appended as cleared.
5 * @param coa_w The width (x) of the area to be appended as cleared.  5 * @param w The width (x) of the area to be appended as cleared.
6 * @param coa_h The height (y) of the area to be appended as cleared.  6 * @param h The height (y) of the area to be appended as cleared.
7 * @return coa The _cleared_object_areas with the appended cleared area.  7 * @return The pointer to _cleared_object_areas with the appended cleared area.
8 */  8 */  
9ClearedObjectArea *MakeClearedObjectArea(TileIndex cleared_tile, TileIndex coa_tile, uint coa_w, uint coa_h)  9ClearedObjectArea *MakeClearedObjectArea(TileIndex cleared_tile, TileIndex ta_tile, uint w, uint h)
10{  10{  
11    ClearedObjectArea *coa = FindClearedObject(cleared_tile);  11    ClearedObjectArea *coa = FindClearedObject(cleared_tile);  
12    if (coa == NULL) {  12    if (coa == NULL) {  
13        coa = _cleared_object_areas.Append();  13        coa = _cleared_object_areas.Append();  
14        coa->first_tile = cleared_tile;  14        coa->first_tile = cleared_tile;  
15        coa->area = TileArea(coa_tile, coa_w, coa_h);  15        coa->area = TileArea(ta_tile, w, h);
16    }  16    }  
17    return coa;  17    return coa;  
18} 18}