Exemplo n.º 1
0
int Segment::updateArea(const Area* area)
{
    Areastore::iterator I = m_areas.lower_bound(area->getLayer());
    Areastore::iterator Iend = m_areas.upper_bound(area->getLayer());
    for (; I != Iend; ++I) {
        if (I->second == area) {
            invalidateSurfaces();
            return 0;
        }
    }
    return -1;
}
Exemplo n.º 2
0
/// \brief Mark the contents of this Segment as stale.
///
/// This is called internally whenever changes occur that mean that the
/// heightfield and surface normal data are no longer valid.
/// If surface normal storage is deallocated, and if the points argument
/// is true the heightfield storage is also deallocated.
void Segment::invalidate(bool points)
{
    if (points) {
        m_heightMap.invalidate();
    }
    if (m_normals) {
        delete [] m_normals;
        m_normals = nullptr;
    }

    invalidateSurfaces();
}