Update extents handling to use building_extents_type

develop
lethosor 2020-11-03 14:56:16 -05:00
parent 58079217d9
commit 1d0e2dc6bc
No known key found for this signature in database
GPG Key ID: 76A269552F4F58C1
1 changed files with 7 additions and 7 deletions

@ -103,7 +103,7 @@ struct CoordHash {
static unordered_map<df::coord, int32_t, CoordHash> locationToBuilding;
static uint8_t *getExtentTile(df::building_extents &extent, df::coord2d tile)
static df::building_extents_type *getExtentTile(df::building_extents &extent, df::coord2d tile)
{
if (!extent.extents)
return NULL;
@ -600,7 +600,7 @@ bool Buildings::checkFreeTiles(df::coord pos, df::coord2d size,
for (int dy = 0; dy < size.y; dy++)
{
df::coord tile = pos + df::coord(dx,dy,0);
uint8_t *etile = NULL;
df::building_extents_type *etile = NULL;
// Exclude using extents
if (ext && ext->extents)
@ -640,7 +640,7 @@ bool Buildings::checkFreeTiles(df::coord pos, df::coord2d size,
if (!ext->extents)
{
ext->extents = new uint8_t[size.x*size.y];
ext->extents = new df::building_extents_type[size.x*size.y];
ext->x = pos.x;
ext->y = pos.y;
ext->width = size.x;
@ -653,7 +653,7 @@ bool Buildings::checkFreeTiles(df::coord pos, df::coord2d size,
if (!etile)
return false;
*etile = 0;
*etile = df::building_extents_type::None;
}
}
}
@ -710,7 +710,7 @@ bool Buildings::containsTile(df::building *bld, df::coord2d tile, bool room)
if (bld->room.extents && (room || bld->isExtentShaped()))
{
uint8_t *etile = getExtentTile(bld->room, tile);
df::building_extents_type *etile = getExtentTile(bld->room, tile);
if (!etile || !*etile)
return false;
}
@ -842,7 +842,7 @@ static void markBuildingTiles(df::building *bld, bool remove)
if (use_extents)
{
uint8_t *etile = getExtentTile(bld->room, tile);
df::building_extents_type *etile = getExtentTile(bld->room, tile);
if (!etile || !*etile)
continue;
}
@ -883,7 +883,7 @@ static void linkRooms(df::building *bld)
if (!room->is_room || room->z != bld->z)
continue;
uint8_t *pext = getExtentTile(room->room, df::coord2d(bld->x1, bld->y1));
df::building_extents_type *pext = getExtentTile(room->room, df::coord2d(bld->x1, bld->y1));
if (!pext || !*pext)
continue;