LEVELNODE *GetWallLevelNodeAndStructOfSameOrientationAtGridno( INT16 sGridNo, INT8 ubOrientation, STRUCTURE **ppStructure ) { LEVELNODE *pNode = NULL; STRUCTURE * pStructure, * pBaseStructure; (*ppStructure) = NULL; pStructure = FindStructure( sGridNo, STRUCTURE_WALLSTUFF ); while ( pStructure != NULL ) { // Check orientation if ( pStructure->ubWallOrientation == ubOrientation ) { pBaseStructure = FindBaseStructure( pStructure ); if (pBaseStructure) { pNode = FindLevelNodeBasedOnStructure( pBaseStructure->sGridNo, pBaseStructure ); (*ppStructure) = pBaseStructure; return( pNode ); } } pStructure = FindNextStructure( pStructure, STRUCTURE_WALLSTUFF ); } return( NULL ); }
LEVELNODE *GetWallLevelNodeOfSameOrientationAtGridNo( INT32 sGridNo, INT8 ubOrientation ) { LEVELNODE *pNode = NULL; STRUCTURE * pStructure; pStructure = FindStructure( sGridNo, STRUCTURE_WALLSTUFF ); while ( pStructure != NULL ) { // Check orientation if ( pStructure->ubWallOrientation == ubOrientation ) { pNode = FindLevelNodeBasedOnStructure( sGridNo, pStructure ); return( pNode ); } pStructure = FindNextStructure( pStructure, STRUCTURE_WALLSTUFF ); } return( NULL ); }
BOOLEAN WallExistsOfTopRightOrientation( INT16 sGridNo ) { // CJC: changing to search only for normal walls, July 16, 1998 STRUCTURE * pStructure; pStructure = FindStructure( sGridNo, STRUCTURE_WALL ); while ( pStructure != NULL ) { // Check orientation if ( pStructure->ubWallOrientation == INSIDE_TOP_RIGHT || pStructure->ubWallOrientation == OUTSIDE_TOP_RIGHT ) { return( TRUE ); } pStructure = FindNextStructure( pStructure, STRUCTURE_WALL ); } return( FALSE ); }
BOOLEAN OpenLeftOrientedDoorWithDoorOnLeftOfEdgeExists( INT16 sGridNo ) { STRUCTURE * pStructure; pStructure = FindStructure( sGridNo, STRUCTURE_ANYDOOR ); while ( pStructure != NULL && (pStructure->fFlags & STRUCTURE_OPEN) ) { // Check orientation if ( pStructure->ubWallOrientation == INSIDE_TOP_LEFT || pStructure->ubWallOrientation == OUTSIDE_TOP_LEFT ) { if ( (pStructure->fFlags & STRUCTURE_DOOR) || (pStructure->fFlags & STRUCTURE_DDOOR_LEFT) ) { return( TRUE ); } } pStructure = FindNextStructure( pStructure, STRUCTURE_ANYDOOR ); } return( FALSE ); }
BOOLEAN WallOrClosedDoorExistsOfTopRightOrientation( INT16 sGridNo ) { STRUCTURE * pStructure; pStructure = FindStructure( sGridNo, STRUCTURE_WALLSTUFF ); while ( pStructure != NULL ) { // skip it if it's an open door if ( ! ( ( pStructure->fFlags & STRUCTURE_ANYDOOR ) && ( pStructure->fFlags & STRUCTURE_OPEN ) ) ) { // Check orientation if ( pStructure->ubWallOrientation == INSIDE_TOP_RIGHT || pStructure->ubWallOrientation == OUTSIDE_TOP_RIGHT ) { return( TRUE ); } } pStructure = FindNextStructure( pStructure, STRUCTURE_WALLSTUFF ); } return( FALSE ); }