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 ); }
BOOLEAN IsJumpableWindowPresentAtGridNo( INT32 sGridNo, INT8 direction2, BOOLEAN fIntactWindowsAlso ) { STRUCTURE * pStructure; pStructure = FindStructure( sGridNo, STRUCTURE_WALLNWINDOW ); if ( pStructure ) { // anv: additional tile properties hook if(gGameExternalOptions.fAdditionalTileProperties) { LEVELNODE *pNode = FindLevelNodeBasedOnStructure( sGridNo, pStructure ); if(pNode != NULL) { if( gTileDatabase[ pNode->usIndex ].uiAdditionalFlags & ADDITIONAL_TILE_FLAG_BLOCKED_WINDOW ) // special tag disables jumping through specific windows (e.g. barred windows in Tixa) return( FALSE ); } } if ( ( direction2 == SOUTH || direction2 == NORTH ) && (pStructure->ubWallOrientation == OUTSIDE_TOP_LEFT || pStructure->ubWallOrientation == INSIDE_TOP_LEFT ) && pStructure->fFlags & STRUCTURE_WALLNWINDOW && !(pStructure->fFlags & STRUCTURE_SPECIAL) ) { if ( fIntactWindowsAlso || ( pStructure->fFlags & STRUCTURE_OPEN ) ) return( TRUE ); } if ( ( direction2 == EAST || direction2 == WEST ) && ( pStructure->ubWallOrientation == OUTSIDE_TOP_RIGHT || pStructure->ubWallOrientation == INSIDE_TOP_RIGHT ) && pStructure->fFlags & STRUCTURE_WALLNWINDOW && !(pStructure->fFlags & STRUCTURE_SPECIAL) ) { if ( fIntactWindowsAlso || ( pStructure->fFlags & STRUCTURE_OPEN ) ) return( TRUE ); } } return( FALSE ); }
LEVELNODE *IsWallPresentAtGridno( INT16 sGridNo ) { LEVELNODE *pNode = NULL; STRUCTURE * pStructure; pStructure = FindStructure( sGridNo, STRUCTURE_WALLSTUFF ); if ( pStructure != NULL ) { pNode = FindLevelNodeBasedOnStructure( sGridNo, pStructure ); } return( pNode ); }
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 ); }
void ExamineGridNoForSlantRoofExtraGraphic( INT32 sCheckGridNo ) { LEVELNODE *pNode = NULL; STRUCTURE *pStructure, *pBase; UINT8 ubLoop; DB_STRUCTURE_TILE ** ppTile; INT32 sGridNo; UINT16 usIndex; BOOLEAN fChanged = FALSE; // CHECK FOR A SLANTED ROOF HERE.... pStructure = FindStructure( sCheckGridNo, STRUCTURE_SLANTED_ROOF ); if ( pStructure != NULL ) { // We have a slanted roof here ... find base and remove... pBase = FindBaseStructure( pStructure ); // Get LEVELNODE for struct and remove! pNode = FindLevelNodeBasedOnStructure( pBase->sGridNo, pBase ); // Loop through each gridno and see if revealed.... for ( ubLoop = 0; ubLoop < pBase->pDBStructureRef->pDBStructure->ubNumberOfTiles; ubLoop++ ) { ppTile = pBase->pDBStructureRef->ppTile; #if 0//dnl ch83 080114 sGridNo = pBase->sGridNo + ppTile[ ubLoop ]->sPosRelToBase; #else sGridNo = AddPosRelToBase(pBase->sGridNo, ppTile[ubLoop]); #endif if (sGridNo < 0 || sGridNo > WORLD_MAX) { continue; } // Given gridno, // IF NOT REVEALED AND HIDDEN.... if ( !( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REVEALED ) && pNode->uiFlags & LEVELNODE_HIDDEN ) { // Add graphic if one does not already exist.... if ( !TypeExistsInRoofLayer( sGridNo, SLANTROOFCEILING, &usIndex ) ) { // Add AddRoofToHead( sGridNo, SLANTROOFCEILING1 ); fChanged = TRUE; } } // Revealed? if ( gpWorldLevelData[ sGridNo ].uiFlags & MAPELEMENT_REVEALED ) { ///Remove any slant roof items if they exist if ( TypeExistsInRoofLayer( sGridNo, SLANTROOFCEILING, &usIndex ) ) { RemoveRoof( sGridNo, usIndex ); fChanged = TRUE; } } } } if ( fChanged ) { // DIRTY THE WORLD! InvalidateWorldRedundency(); SetRenderFlags(RENDER_FLAG_FULL ); } }
void SetGridNoRevealedFlag( INT32 sGridNo ) { // UINT32 cnt; // ITEM_POOL *pItemPool; // INT16 sX, sY; LEVELNODE *pNode = NULL; STRUCTURE *pStructure, *pBase; // Set hidden flag, for any roofs SetRoofIndexFlagsFromTypeRange( sGridNo, FIRSTROOF, FOURTHROOF, LEVELNODE_HIDDEN ); // ATE: Do this only if we are in a room... if ( gusWorldRoomInfo[ sGridNo ] != NO_ROOM ) { SetStructAframeFlags( sGridNo, LEVELNODE_HIDDEN ); // Find gridno one east as well... if ( ( sGridNo + WORLD_COLS ) < MAX_MAP_POS ) { SetStructAframeFlags( sGridNo + WORLD_COLS, LEVELNODE_HIDDEN ); } if ( ( sGridNo + 1 ) < MAX_MAP_POS ) { SetStructAframeFlags( sGridNo + 1, LEVELNODE_HIDDEN ); } } // Set gridno as revealed gpWorldLevelData[ sGridNo ].uiFlags |= MAPELEMENT_REVEALED; if( gfCaves ) { RemoveFogFromGridNo( sGridNo ); } // ATE: If there are any structs here, we can render them with the obscured flag! // Look for anything but walls pn this gridno! pStructure = gpWorldLevelData[ sGridNo ].pStructureHead; while ( pStructure != NULL ) { if ( pStructure->sCubeOffset == STRUCTURE_ON_GROUND || ( pStructure->fFlags & STRUCTURE_SLANTED_ROOF ) ) { if ( ( (pStructure->fFlags & STRUCTURE_OBSTACLE ) && !( pStructure->fFlags & ( STRUCTURE_PERSON | STRUCTURE_CORPSE ) ) ) || ( pStructure->fFlags & STRUCTURE_SLANTED_ROOF ) ) { pBase = FindBaseStructure( pStructure ); //Ja25: DEF: 10/12/99 Added because ... if( pBase == NULL ) { pStructure = pStructure->pNext; Assert( 0 ); continue; } // Get LEVELNODE for struct and remove! pNode = FindLevelNodeBasedOnStructure( pBase->sGridNo, pBase ); if( pNode ) pNode->uiFlags |= LEVELNODE_SHOW_THROUGH; if ( pStructure->fFlags & STRUCTURE_SLANTED_ROOF ) { AddSlantRoofFOVSlot( pBase->sGridNo ); // Set hidden... pNode->uiFlags |= LEVELNODE_HIDDEN; } } } pStructure = pStructure->pNext; } gubWorldRoomHidden[ gusWorldRoomInfo[ sGridNo ] ] = FALSE; }