@ -451,8 +451,8 @@ void AiL::HandleUserInput(float fElapsedTime){
int truncatedPlayerY = int ( player - > GetY ( ) ) / game - > GetCurrentMapData ( ) . tilewidth ;
int tileID = layer . tiles [ truncatedPlayerY ] [ truncatedPlayerX ] ;
TilesheetData dat = GetTileSheet ( GetCurrentLevel ( ) , tileID ) ;
if ( dat . tileset - > staircaseTiles . find ( tileID ) ! = dat . tileset - > staircaseTiles . end ( ) ) {
return dat . tileset - > staircaseTiles [ tileID ] . data [ " value " ] ;
if ( dat . tileset . staircaseTiles . find ( tileID ) ! = dat . tileset . staircaseTiles . end ( ) ) {
return dat . tileset . staircaseTiles . at ( tileID ) . data . at ( " value " ) ;
}
}
return std : : string ( " NONE " ) ;
@ -475,10 +475,10 @@ void AiL::HandleUserInput(float fElapsedTime){
player - > SetY ( player - > GetY ( ) - " Player.StaircaseClimbSpd " _F * fElapsedTime * player - > GetMoveSpdMult ( ) ) ;
player - > movementVelocity . y + = - " Player.StaircaseClimbSpd " _F * fElapsedTime * player - > GetMoveSpdMult ( ) ;
} else
if ( staircaseDirection = = " LEFT " ) {
player - > SetY ( player - > GetY ( ) + " Player.StaircaseClimbSpd " _F * fElapsedTime * player - > GetMoveSpdMult ( ) ) ;
player - > movementVelocity . y + = " Player.StaircaseClimbSpd " _F * fElapsedTime * player - > GetMoveSpdMult ( ) ;
}
if ( staircaseDirection = = " LEFT " ) {
player - > SetY ( player - > GetY ( ) + " Player.StaircaseClimbSpd " _F * fElapsedTime * player - > GetMoveSpdMult ( ) ) ;
player - > movementVelocity . y + = " Player.StaircaseClimbSpd " _F * fElapsedTime * player - > GetMoveSpdMult ( ) ;
}
newAimingAngle + = vf2d { 1 , 0 } ;
@ -934,52 +934,52 @@ void AiL::PopulateRenderLists(){
void AiL : : RenderTile ( vi2d pos , TilesheetData tileSheet , int tileSheetIndex , vi2d tileSheetPos ) {
Pixel tempCol = worldColorFunc ( pos * game - > GetCurrentMapData ( ) . tilewidth ) ;
if ( tileSheet . tileset - > animationData . count ( tileSheetIndex ) ) {
int animationDuration_ms = int ( tileSheet . tileset - > animationData [ tileSheetIndex ] . size ( ) * " animation_tile_precision " _I ) ;
int animatedIndex = tileSheet . tileset - > animationData [ tileSheetIndex ] [ size_t ( fmod ( levelTime * 1000.f , animationDuration_ms ) / " animation_tile_precision " _I ) ] ;
int tileSheetWidth = tileSheet . tileset - > tileset - > Sprite ( ) - > width / tileSheet . tileset - > tilewidth ;
if ( tileSheet . tileset . animationData . count ( tileSheetIndex ) ) {
int animationDuration_ms = int ( tileSheet . tileset . animationData . at ( tileSheetIndex ) . size ( ) * " animation_tile_precision " _I ) ;
int animatedIndex = tileSheet . tileset . animationData . at ( tileSheetIndex ) [ size_t ( fmod ( levelTime * 1000.f , animationDuration_ms ) / " animation_tile_precision " _I ) ] ;
int tileSheetWidth = tileSheet . tileset . tileset - > Sprite ( ) - > width / tileSheet . tileset . tilewidth ;
int tileSheetX = animatedIndex % tileSheetWidth ;
int tileSheetY = animatedIndex / tileSheetWidth ;
if ( tileSheet . tileset - > tileRepeatData . count ( tileSheetIndex ) ) {
for ( int y = 0 ; y < tileSheet . tileset - > tileRepeatData [ tileSheetIndex ] . y ; y + + ) {
for ( int x = 0 ; x < tileSheet . tileset - > tileRepeatData [ tileSheetIndex ] . x ; x + + ) {
view . DrawPartialDecal ( pos * game - > GetCurrentMapData ( ) . tilewidth + vf2d { float ( x ) , float ( y ) } * game - > GetCurrentMapData ( ) . tilewidth / vf2d { tileSheet . tileset - > tileRepeatData [ tileSheetIndex ] } , vf2d { float ( tileSheet . tileset - > tilewidth ) , float ( tileSheet . tileset - > tileheight ) } / vf2d { tileSheet . tileset - > tileRepeatData [ tileSheetIndex ] } , tileSheet . tileset - > tileset - > Decal ( ) , vi2d { tileSheetX , tileSheetY } * tileSheet . tileset - > tilewidth , { float ( tileSheet . tileset - > tilewidth ) , float ( tileSheet . tileset - > tileheight ) } , tempCol ) ;
if ( tileSheet . tileset . tileRepeatData . count ( tileSheetIndex ) ) {
for ( int y = 0 ; y < tileSheet . tileset . tileRepeatData . at ( tileSheetIndex ) . y ; y + + ) {
for ( int x = 0 ; x < tileSheet . tileset . tileRepeatData . at ( tileSheetIndex ) . x ; x + + ) {
view . DrawPartialDecal ( pos * game - > GetCurrentMapData ( ) . tilewidth + vf2d { float ( x ) , float ( y ) } * game - > GetCurrentMapData ( ) . tilewidth / vf2d { tileSheet . tileset . tileRepeatData . at ( tileSheetIndex ) } , vf2d { float ( tileSheet . tileset . tilewidth ) , float ( tileSheet . tileset . tileheight ) } / vf2d { tileSheet . tileset . tileRepeatData . at ( tileSheetIndex ) } , tileSheet . tileset . tileset - > Decal ( ) , vi2d { tileSheetX , tileSheetY } * tileSheet . tileset . tilewidth , { float ( tileSheet . tileset . tilewidth ) , float ( tileSheet . tileset . tileheight ) } , tempCol ) ;
}
}
} else view . DrawPartialDecal ( pos * game - > GetCurrentMapData ( ) . tilewidth , { float ( tileSheet . tileset - > tilewidth ) , float ( tileSheet . tileset - > tileheight ) } , tileSheet . tileset - > tileset - > Decal ( ) , vi2d { tileSheetX , tileSheetY } * tileSheet . tileset - > tilewidth , { float ( tileSheet . tileset - > tilewidth ) , float ( tileSheet . tileset - > tileheight ) } , tempCol ) ;
} else view . DrawPartialDecal ( pos * game - > GetCurrentMapData ( ) . tilewidth , { float ( tileSheet . tileset . tilewidth ) , float ( tileSheet . tileset . tileheight ) } , tileSheet . tileset . tileset - > Decal ( ) , vi2d { tileSheetX , tileSheetY } * tileSheet . tileset . tilewidth , { float ( tileSheet . tileset . tilewidth ) , float ( tileSheet . tileset . tileheight ) } , tempCol ) ;
} else {
if ( tileSheet . tileset - > tileRepeatData . count ( tileSheetIndex ) ) {
for ( int y = 0 ; y < tileSheet . tileset - > tileRepeatData [ tileSheetIndex ] . y ; y + + ) {
for ( int x = 0 ; x < tileSheet . tileset - > tileRepeatData [ tileSheetIndex ] . x ; x + + ) {
view . DrawPartialDecal ( pos * game - > GetCurrentMapData ( ) . tilewidth + vi2d { x , y } * game - > GetCurrentMapData ( ) . tilewidth / tileSheet . tileset - > tileRepeatData [ tileSheetIndex ] , { float ( tileSheet . tileset - > tilewidth ) , float ( tileSheet . tileset - > tileheight ) } , tileSheet . tileset - > tileset - > Decal ( ) , tileSheetPos * tileSheet . tileset - > tilewidth , vf2d { float ( tileSheet . tileset - > tilewidth ) , float ( tileSheet . tileset - > tileheight ) } / tileSheet . tileset - > tileRepeatData [ tileSheetIndex ] , tempCol ) ;
if ( tileSheet . tileset . tileRepeatData . count ( tileSheetIndex ) ) {
for ( int y = 0 ; y < tileSheet . tileset . tileRepeatData . at ( tileSheetIndex ) . y ; y + + ) {
for ( int x = 0 ; x < tileSheet . tileset . tileRepeatData . at ( tileSheetIndex ) . x ; x + + ) {
view . DrawPartialDecal ( pos * game - > GetCurrentMapData ( ) . tilewidth + vi2d { x , y } * game - > GetCurrentMapData ( ) . tilewidth / tileSheet . tileset . tileRepeatData . at ( tileSheetIndex ) , { float ( tileSheet . tileset . tilewidth ) , float ( tileSheet . tileset . tileheight ) } , tileSheet . tileset . tileset - > Decal ( ) , tileSheetPos * tileSheet . tileset . tilewidth , vf2d { float ( tileSheet . tileset . tilewidth ) , float ( tileSheet . tileset . tileheight ) } / tileSheet . tileset . tileRepeatData . at ( tileSheetIndex ) , tempCol ) ;
}
}
} else view . DrawPartialDecal ( pos * game - > GetCurrentMapData ( ) . tilewidth , { float ( tileSheet . tileset - > tilewidth ) , float ( tileSheet . tileset - > tileheight ) } , tileSheet . tileset - > tileset - > Decal ( ) , tileSheetPos * tileSheet . tileset - > tilewidth , { float ( tileSheet . tileset - > tilewidth ) , float ( tileSheet . tileset - > tileheight ) } , tempCol ) ;
} else view . DrawPartialDecal ( pos * game - > GetCurrentMapData ( ) . tilewidth , { float ( tileSheet . tileset . tilewidth ) , float ( tileSheet . tileset . tileheight ) } , tileSheet . tileset . tileset - > Decal ( ) , tileSheetPos * tileSheet . tileset . tilewidth , { float ( tileSheet . tileset . tilewidth ) , float ( tileSheet . tileset . tileheight ) } , tempCol ) ;
}
}
void AiL : : RenderTile ( TileRenderData & tileSheet , Pixel col ) {
if ( tileSheet . tileSheet . tileset - > animationData . count ( tileSheet . tileID % 1000000 ) ) {
int animationDuration_ms = int ( tileSheet . tileSheet . tileset - > animationData [ tileSheet . tileID % 1000000 ] . size ( ) * " animation_tile_precision " _I ) ;
int animatedIndex = tileSheet . tileSheet . tileset - > animationData [ tileSheet . tileID % 1000000 ] [ size_t ( fmod ( levelTime * 1000.f , animationDuration_ms ) / " animation_tile_precision " _I ) ] ;
int tileSheetWidth = tileSheet . tileSheet . tileset - > tileset - > Sprite ( ) - > width / tileSheet . tileSheet . tileset - > tilewidth ;
if ( tileSheet . tileSheet . tileset . animationData . count ( tileSheet . tileID % 1000000 ) ) {
int animationDuration_ms = int ( tileSheet . tileSheet . tileset . animationData . at ( tileSheet . tileID % 1000000 ) . size ( ) * " animation_tile_precision " _I ) ;
int animatedIndex = tileSheet . tileSheet . tileset . animationData . at ( tileSheet . tileID % 1000000 ) [ size_t ( fmod ( levelTime * 1000.f , animationDuration_ms ) / " animation_tile_precision " _I ) ] ;
int tileSheetWidth = tileSheet . tileSheet . tileset . tileset - > Sprite ( ) - > width / tileSheet . tileSheet . tileset . tilewidth ;
int tileSheetX = animatedIndex % tileSheetWidth ;
int tileSheetY = animatedIndex / tileSheetWidth ;
if ( tileSheet . tileSheet . tileset - > tileRepeatData . count ( animatedIndex ) ) {
for ( int y = 0 ; y < tileSheet . tileSheet . tileset - > tileRepeatData [ animatedIndex ] . y ; y + + ) {
for ( int x = 0 ; x < tileSheet . tileSheet . tileset - > tileRepeatData [ animatedIndex ] . x ; x + + ) {
view . DrawPartialDecal ( tileSheet . pos + vi2d { x , y } * game - > GetCurrentMapData ( ) . tilewidth / tileSheet . tileSheet . tileset - > tileRepeatData [ animatedIndex ] , { float ( tileSheet . tileSheet . tileset - > tilewidth ) , float ( tileSheet . tileSheet . tileset - > tileheight ) } , tileSheet . tileSheet . tileset - > tileset - > Decal ( ) , vi2d { tileSheetX , tileSheetY } * vf2d { float ( tileSheet . tileSheet . tileset - > tilewidth ) , float ( tileSheet . tileSheet . tileset - > tileheight ) } , vf2d { float ( tileSheet . tileSheet . tileset - > tilewidth ) , float ( tileSheet . tileSheet . tileset - > tileheight ) } / tileSheet . tileSheet . tileset - > tileRepeatData [ animatedIndex ] , col ) ;
if ( tileSheet . tileSheet . tileset . tileRepeatData . count ( animatedIndex ) ) {
for ( int y = 0 ; y < tileSheet . tileSheet . tileset . tileRepeatData . at ( animatedIndex ) . y ; y + + ) {
for ( int x = 0 ; x < tileSheet . tileSheet . tileset . tileRepeatData . at ( animatedIndex ) . x ; x + + ) {
view . DrawPartialDecal ( tileSheet . pos + vi2d { x , y } * game - > GetCurrentMapData ( ) . tilewidth / tileSheet . tileSheet . tileset . tileRepeatData . at ( animatedIndex ) , { float ( tileSheet . tileSheet . tileset . tilewidth ) , float ( tileSheet . tileSheet . tileset . tileheight ) } , tileSheet . tileSheet . tileset . tileset - > Decal ( ) , vi2d { tileSheetX , tileSheetY } * vf2d { float ( tileSheet . tileSheet . tileset . tilewidth ) , float ( tileSheet . tileSheet . tileset . tileheight ) } , vf2d { float ( tileSheet . tileSheet . tileset . tilewidth ) , float ( tileSheet . tileSheet . tileset . tileheight ) } / tileSheet . tileSheet . tileset . tileRepeatData . at ( animatedIndex ) , col ) ;
}
}
} else view . DrawPartialDecal ( tileSheet . pos , { float ( tileSheet . tileSheet . tileset - > tilewidth ) , float ( tileSheet . tileSheet . tileset - > tileheight ) } , tileSheet . tileSheet . tileset - > tileset - > Decal ( ) , vi2d { tileSheetX , tileSheetY } * vf2d { float ( tileSheet . tileSheet . tileset - > tilewidth ) , float ( tileSheet . tileSheet . tileset - > tileheight ) } , { float ( tileSheet . tileSheet . tileset - > tilewidth ) , float ( tileSheet . tileSheet . tileset - > tileheight ) } , col ) ;
} else view . DrawPartialDecal ( tileSheet . pos , { float ( tileSheet . tileSheet . tileset . tilewidth ) , float ( tileSheet . tileSheet . tileset . tileheight ) } , tileSheet . tileSheet . tileset . tileset - > Decal ( ) , vi2d { tileSheetX , tileSheetY } * vf2d { float ( tileSheet . tileSheet . tileset . tilewidth ) , float ( tileSheet . tileSheet . tileset . tileheight ) } , { float ( tileSheet . tileSheet . tileset . tilewidth ) , float ( tileSheet . tileSheet . tileset . tileheight ) } , col ) ;
} else {
if ( tileSheet . tileSheet . tileset - > tileRepeatData . count ( tileSheet . tileID ) ) {
for ( int y = 0 ; y < tileSheet . tileSheet . tileset - > tileRepeatData [ tileSheet . tileID ] . y ; y + + ) {
for ( int x = 0 ; x < tileSheet . tileSheet . tileset - > tileRepeatData [ tileSheet . tileID ] . x ; x + + ) {
view . DrawPartialDecal ( tileSheet . pos + vi2d { x , y } * game - > GetCurrentMapData ( ) . tilewidth / tileSheet . tileSheet . tileset - > tileRepeatData [ tileSheet . tileID ] , { float ( tileSheet . tileSheet . tileset - > tilewidth ) , float ( tileSheet . tileSheet . tileset - > tileheight ) } , tileSheet . tileSheet . tileset - > tileset - > Decal ( ) , tileSheet . tileSheetPos , vf2d { float ( tileSheet . tileSheet . tileset - > tilewidth ) , float ( tileSheet . tileSheet . tileset - > tileheight ) } / tileSheet . tileSheet . tileset - > tileRepeatData [ tileSheet . tileID ] , col ) ;
if ( tileSheet . tileSheet . tileset . tileRepeatData . count ( tileSheet . tileID ) ) {
for ( int y = 0 ; y < tileSheet . tileSheet . tileset . tileRepeatData . at ( tileSheet . tileID ) . y ; y + + ) {
for ( int x = 0 ; x < tileSheet . tileSheet . tileset . tileRepeatData . at ( tileSheet . tileID ) . x ; x + + ) {
view . DrawPartialDecal ( tileSheet . pos + vi2d { x , y } * game - > GetCurrentMapData ( ) . tilewidth / tileSheet . tileSheet . tileset . tileRepeatData . at ( tileSheet . tileID ) , { float ( tileSheet . tileSheet . tileset . tilewidth ) , float ( tileSheet . tileSheet . tileset . tileheight ) } , tileSheet . tileSheet . tileset . tileset - > Decal ( ) , tileSheet . tileSheetPos , vf2d { float ( tileSheet . tileSheet . tileset . tilewidth ) , float ( tileSheet . tileSheet . tileset . tileheight ) } / tileSheet . tileSheet . tileset . tileRepeatData . at ( tileSheet . tileID ) , col ) ;
}
}
} else view . DrawPartialDecal ( tileSheet . pos , { float ( tileSheet . tileSheet . tileset - > tilewidth ) , float ( tileSheet . tileSheet . tileset - > tileheight ) } , tileSheet . tileSheet . tileset - > tileset - > Decal ( ) , tileSheet . tileSheetPos , { float ( tileSheet . tileSheet . tileset - > tilewidth ) , float ( tileSheet . tileSheet . tileset - > tileheight ) } , col ) ;
} else view . DrawPartialDecal ( tileSheet . pos , { float ( tileSheet . tileSheet . tileset . tilewidth ) , float ( tileSheet . tileSheet . tileset . tileheight ) } , tileSheet . tileSheet . tileset . tileset - > Decal ( ) , tileSheet . tileSheetPos , { float ( tileSheet . tileSheet . tileset . tilewidth ) , float ( tileSheet . tileSheet . tileset . tileheight ) } , col ) ;
}
}
@ -1086,8 +1086,8 @@ void AiL::RenderWorld(float fElapsedTime){
int tileID = layer . tiles [ y ] [ x ] - 1 ;
if ( tileID ! = - 1 ) {
TilesheetData tileSheet = GetTileSheet ( currentLevel , tileID ) ;
int tileSheetWidth = tileSheet . tileset - > tileset - > Sprite ( ) - > width / tileSheet . tileset - > tilewidth ;
int tileSheetHeight = tileSheet . tileset - > tileset - > Sprite ( ) - > height / tileSheet . tileset - > tileheight ;
int tileSheetWidth = tileSheet . tileset . tileset - > Sprite ( ) - > width / tileSheet . tileset . tilewidth ;
int tileSheetHeight = tileSheet . tileset . tileset - > Sprite ( ) - > height / tileSheet . tileset . tileheight ;
int tileSheetIndex = tileID - ( tileSheet . firstgid - 1 ) ;
int tileSheetX = tileSheetIndex % tileSheetWidth ;
int tileSheetY = tileSheetIndex / tileSheetWidth ;
@ -1117,8 +1117,8 @@ void AiL::RenderWorld(float fElapsedTime){
int tileID = layer . tiles [ y ] [ x ] - 1 ;
if ( tileID ! = - 1 ) {
TilesheetData tileSheet = GetTileSheet ( currentLevel , tileID ) ;
int tileSheetWidth = tileSheet . tileset - > tileset - > Sprite ( ) - > width / tileSheet . tileset - > tilewidth ;
int tileSheetHeight = tileSheet . tileset - > tileset - > Sprite ( ) - > height / tileSheet . tileset - > tileheight ;
int tileSheetWidth = tileSheet . tileset . tileset - > Sprite ( ) - > width / tileSheet . tileset . tilewidth ;
int tileSheetHeight = tileSheet . tileset . tileset - > Sprite ( ) - > height / tileSheet . tileset . tileheight ;
int tileSheetIndex = tileID - ( tileSheet . firstgid - 1 ) ;
int tileSheetX = tileSheetIndex % tileSheetWidth ;
int tileSheetY = tileSheetIndex / tileSheetWidth ;
@ -1230,12 +1230,12 @@ void AiL::RenderWorld(float fElapsedTime){
tile . group = & group ;
# pragma region Unhiding tile detection
auto it = tile . tileSheet . tileset - > foregroundTiles . find ( tile . tileID ) ; //We're looking for tiles that are marked as should not be faded away by a tile group.
if ( it ! = tile . tileSheet . tileset - > foregroundTiles . end ( ) ) {
auto it = tile . tileSheet . tileset . foregroundTiles . find ( tile . tileID ) ; //We're looking for tiles that are marked as should not be faded away by a tile group.
if ( it ! = tile . tileSheet . tileset . foregroundTiles . end ( ) ) {
if ( ! ( * it ) . second . hide ) tile . tileOpacity = 0.f ;
}
# pragma endregion
if ( tile . tileSheet . tileset - > collision . find ( tile . tileID ) ! = tile . tileSheet . tileset - > collision . end ( ) ) {
if ( tile . tileSheet . tileset . collision . find ( tile . tileID ) ! = tile . tileSheet . tileset . collision . end ( ) ) {
tilesWithCollision . push_back ( & tile ) ;
} else {
tilesWithoutCollision . push_back ( & tile ) ; //Tiles without collision are assumed to always be in the foreground. They don't have any depth rules.
@ -1357,8 +1357,8 @@ void AiL::RenderWorld(float fElapsedTime){
# pragma endregion
RenderTile ( * tile , { 255 , 255 , 255 , uint8_t ( 255 - tile - > tileOpacity / TileGroup : : FADE_TIME * TileGroup : : FADE_AMT ) } ) ;
float distToPlayer = geom2d : : line < float > ( player - > GetPos ( ) , tile - > pos + vf2d { 12 , 12 } ) . length ( ) ;
if ( GameSettings : : TerrainCollisionBoxesEnabled ( ) & & distToPlayer < 24 * 3 & & tile - > tileOpacity > 0 & & tile - > tileSheet . tileset - > collision . find ( tile - > tileID ) ! = tile - > tileSheet . tileset - > collision . end ( ) ) {
geom2d : : rect < float > collision = tile - > tileSheet . tileset - > collision [ tile - > tileID ] . collision ;
if ( GameSettings : : TerrainCollisionBoxesEnabled ( ) & & distToPlayer < 24 * 3 & & tile - > tileOpacity > 0 & & tile - > tileSheet . tileset . collision . find ( tile - > tileID ) ! = tile - > tileSheet . tileset . collision . end ( ) ) {
const geom2d : : rect < float > collision = const_cast < TilesetData & > ( tile - > tileSheet . tileset ) . collision . at ( tile - > tileID ) . collision ;
distToPlayer / = 4 ;
if ( distToPlayer < 1 ) { distToPlayer = 1 ; }
view . FillRectDecal ( tile - > pos + collision . pos , collision . size , { 255 , 0 , 0 , uint8_t ( 128 * tile - > tileOpacity / sqrt ( distToPlayer ) ) } ) ;
@ -1411,8 +1411,8 @@ void AiL::RenderWorld(float fElapsedTime){
for ( TileRenderData * tile : tilesWithoutCollision ) {
RenderTile ( * tile , { 255 , 255 , 255 , uint8_t ( 255 - tile - > tileOpacity / TileGroup : : FADE_TIME * TileGroup : : FADE_AMT ) } ) ;
float distToPlayer = geom2d : : line < float > ( player - > GetPos ( ) , tile - > pos + vf2d { 12 , 12 } ) . length ( ) ;
if ( distToPlayer < 24 * 3 & & tile - > tileOpacity > 0 & & tile - > tileSheet . tileset - > collision . find ( tile - > tileID ) ! = tile - > tileSheet . tileset - > collision . end ( ) ) {
geom2d : : rect < float > collision = tile - > tileSheet . tileset - > collision [ tile - > tileID ] . collision ;
if ( distToPlayer < 24 * 3 & & tile - > tileOpacity > 0 & & tile - > tileSheet . tileset . collision . find ( tile - > tileID ) ! = tile - > tileSheet . tileset . collision . end ( ) ) {
const geom2d : : rect < float > collision = const_cast < TilesetData & > ( tile - > tileSheet . tileset ) . collision . at ( tile - > tileID ) . collision ;
distToPlayer / = 4 ;
if ( distToPlayer < 1 ) { distToPlayer = 1 ; }
view . FillRectDecal ( tile - > pos + collision . pos , collision . size , { 255 , 0 , 0 , uint8_t ( 128 * tile - > tileOpacity / sqrt ( distToPlayer ) ) } ) ;
@ -1440,12 +1440,12 @@ void AiL::RenderWorld(float fElapsedTime){
int tileID = bridgeLayer - > tiles [ y ] [ x ] - 1 ;
if ( tileID ! = - 1 ) {
TilesheetData tileSheet = GetTileSheet ( currentLevel , tileID ) ;
int tileSheetWidth = tileSheet . tileset - > tileset - > Sprite ( ) - > width / tileSheet . tileset - > tilewidth ;
int tileSheetHeight = tileSheet . tileset - > tileset - > Sprite ( ) - > height / tileSheet . tileset - > tileheight ;
int tileSheetWidth = tileSheet . tileset . tileset - > Sprite ( ) - > width / tileSheet . tileset . tilewidth ;
int tileSheetHeight = tileSheet . tileset . tileset - > Sprite ( ) - > height / tileSheet . tileset . tileheight ;
int tileSheetIndex = tileID - ( tileSheet . firstgid - 1 ) ;
int tileSheetX = tileSheetIndex % tileSheetWidth ;
int tileSheetY = tileSheetIndex / tileSheetWidth ;
view . DrawPartialDecal ( vi2d { x , y } * game - > GetCurrentMapData ( ) . tilewidth , { float ( tileSheet . tileset - > tilewidth ) , float ( tileSheet . tileset - > tileheight ) } , tileSheet . tileset - > tileset - > Decal ( ) , vi2d { tileSheetX , tileSheetY } * game - > GetCurrentMapData ( ) . tilewidth , { float ( tileSheet . tileset - > tilewidth ) , float ( tileSheet . tileset - > tileheight ) } , { 255 , 255 , 255 , uint8_t ( 255 - bridgeFadeFactor / TileGroup : : FADE_TIME * TileGroup : : FADE_AMT ) } ) ;
view . DrawPartialDecal ( vi2d { x , y } * game - > GetCurrentMapData ( ) . tilewidth , { float ( tileSheet . tileset . tilewidth ) , float ( tileSheet . tileset . tileheight ) } , tileSheet . tileset . tileset - > Decal ( ) , vi2d { tileSheetX , tileSheetY } * game - > GetCurrentMapData ( ) . tilewidth , { float ( tileSheet . tileset . tilewidth ) , float ( tileSheet . tileset . tileheight ) } , { 255 , 255 , 255 , uint8_t ( 255 - bridgeFadeFactor / TileGroup : : FADE_TIME * TileGroup : : FADE_AMT ) } ) ;
# ifdef _DEBUG
if ( " debug_collision_boxes " _I ) {
if ( tileSheet . tileset - > collision . find ( tileSheetIndex ) ! = tileSheet . tileset - > collision . end ( ) ) {
@ -1485,13 +1485,13 @@ void AiL::RenderWorld(float fElapsedTime){
tile . group = & group ;
# pragma region Unhiding tile detection
auto it = tile . tileSheet . tileset - > upperForegroundTiles . find ( tile . tileID ) ; //We're looking for tiles that are marked as should not be faded away by a tile group.
if ( it ! = tile . tileSheet . tileset - > upperForegroundTiles . end ( ) ) {
auto it = tile . tileSheet . tileset . upperForegroundTiles . find ( tile . tileID ) ; //We're looking for tiles that are marked as should not be faded away by a tile group.
if ( it ! = tile . tileSheet . tileset . upperForegroundTiles . end ( ) ) {
if ( ! ( * it ) . second . hide ) tile . tileOpacity = 0.f ;
}
# pragma endregion
if ( tile . tileSheet . tileset - > collision . find ( tile . tileID ) ! = tile . tileSheet . tileset - > collision . end ( ) ) {
if ( tile . tileSheet . tileset . collision . find ( tile . tileID ) ! = tile . tileSheet . tileset . collision . end ( ) ) {
tilesWithCollision . push_back ( & tile ) ;
} else {
tilesWithoutCollision . push_back ( & tile ) ;
@ -1613,8 +1613,8 @@ void AiL::RenderWorld(float fElapsedTime){
# pragma endregion
RenderTile ( * tile , { 255 , 255 , 255 , uint8_t ( 255 - tile - > tileOpacity / TileGroup : : FADE_TIME * TileGroup : : FADE_AMT ) } ) ;
float distToPlayer = geom2d : : line < float > ( player - > GetPos ( ) , tile - > pos + vf2d { 12 , 12 } ) . length ( ) ;
if ( GameSettings : : TerrainCollisionBoxesEnabled ( ) & & distToPlayer < 24 * 3 & & tile - > tileOpacity > 0 & & tile - > tileSheet . tileset - > collision . find ( tile - > tileID ) ! = tile - > tileSheet . tileset - > collision . end ( ) ) {
geom2d : : rect < float > collision = tile - > tileSheet . tileset - > collision [ tile - > tileID ] . collision ;
if ( GameSettings : : TerrainCollisionBoxesEnabled ( ) & & distToPlayer < 24 * 3 & & tile - > tileOpacity > 0 & & tile - > tileSheet . tileset . collision . find ( tile - > tileID ) ! = tile - > tileSheet . tileset . collision . end ( ) ) {
const geom2d : : rect < float > collision = const_cast < TilesetData & > ( tile - > tileSheet . tileset ) . collision . at ( tile - > tileID ) . collision ;
distToPlayer / = 4 ;
if ( distToPlayer < 1 ) { distToPlayer = 1 ; }
view . FillRectDecal ( tile - > pos + collision . pos , collision . size , { 255 , 0 , 0 , uint8_t ( 128 * tile - > tileOpacity / sqrt ( distToPlayer ) ) } ) ;
@ -1659,8 +1659,8 @@ void AiL::RenderWorld(float fElapsedTime){
for ( TileRenderData * tile : tilesWithoutCollision ) {
RenderTile ( * tile , { 255 , 255 , 255 , uint8_t ( 255 - tile - > tileOpacity / TileGroup : : FADE_TIME * TileGroup : : FADE_AMT ) } ) ;
float distToPlayer = geom2d : : line < float > ( player - > GetPos ( ) , tile - > pos + vf2d { 12 , 12 } ) . length ( ) ;
if ( distToPlayer < 24 * 3 & & tile - > tileOpacity > 0 & & tile - > tileSheet . tileset - > collision . find ( tile - > tileID ) ! = tile - > tileSheet . tileset - > collision . end ( ) ) {
geom2d : : rect < float > collision = tile - > tileSheet . tileset - > collision [ tile - > tileID ] . collision ;
if ( distToPlayer < 24 * 3 & & tile - > tileOpacity > 0 & & tile - > tileSheet . tileset . collision . find ( tile - > tileID ) ! = tile - > tileSheet . tileset . collision . end ( ) ) {
const geom2d : : rect < float > collision = const_cast < TilesetData & > ( tile - > tileSheet . tileset ) . collision . at ( tile - > tileID ) . collision ;
distToPlayer / = 4 ;
if ( distToPlayer < 1 ) { distToPlayer = 1 ; }
view . FillRectDecal ( tile - > pos + collision . pos , collision . size , { 255 , 0 , 0 , uint8_t ( 128 * tile - > tileOpacity / sqrt ( distToPlayer ) ) } ) ;
@ -2107,13 +2107,13 @@ void AiL::InitializeLevel(std::string mapFile,MapName map){
int tileID = layer . tiles [ y ] [ x ] - 1 ;
if ( tileID ! = - 1 ) {
TilesheetData tileSheet = GetTileSheet ( map , tileID ) ;
int tileSheetWidth = tileSheet . tileset - > tileset - > Sprite ( ) - > width / tileSheet . tileset - > tilewidth ;
int tileSheetHeight = tileSheet . tileset - > tileset - > Sprite ( ) - > height / tileSheet . tileset - > tileheight ;
int tileSheetWidth = tileSheet . tileset . tileset - > Sprite ( ) - > width / tileSheet . tileset . tilewidth ;
int tileSheetHeight = tileSheet . tileset . tileset - > Sprite ( ) - > height / tileSheet . tileset . tileheight ;
int tileSheetIndex = tileID - ( tileSheet . firstgid - 1 ) ;
int tileSheetX = tileSheetIndex % tileSheetWidth ;
int tileSheetY = tileSheetIndex / tileSheetWidth ;
vi2d pos = vi2d { x , y } * tileSheet . tileset - > tilewidth ;
DrawPartialSprite ( pos , tileSheet . tileset - > tileset - > Sprite ( ) , vi2d { tileSheetX , tileSheetY } * tileSheet . tileset - > tilewidth , { tileSheet . tileset - > tilewidth , tileSheet . tileset - > tileheight } ) ;
vi2d pos = vi2d { x , y } * tileSheet . tileset . tilewidth ;
DrawPartialSprite ( pos , tileSheet . tileset . tileset - > Sprite ( ) , vi2d { tileSheetX , tileSheetY } * tileSheet . tileset . tilewidth , { tileSheet . tileset . tilewidth , tileSheet . tileset . tileheight } ) ;
}
}
}
@ -2276,8 +2276,8 @@ void AiL::_PrepareLevel(MapName map,MusicChange changeMusic){
int tileID = layer . tiles [ y ] [ x ] - 1 ;
if ( tileID ! = - 1 ) {
TilesheetData tileSheet = GetTileSheet ( currentLevel , tileID ) ;
int tileSheetWidth = tileSheet . tileset - > tileset - > Sprite ( ) - > width / tileSheet . tileset - > tilewidth ;
int tileSheetHeight = tileSheet . tileset - > tileset - > Sprite ( ) - > height / tileSheet . tileset - > tileheight ;
int tileSheetWidth = tileSheet . tileset . tileset - > Sprite ( ) - > width / tileSheet . tileset . tilewidth ;
int tileSheetHeight = tileSheet . tileset . tileset - > Sprite ( ) - > height / tileSheet . tileset . tileheight ;
int tileSheetIndex = tileID - ( tileSheet . firstgid - 1 ) ;
int realTileSheetIndex = ( tileID % 1000000 ) - ( tileSheet . firstgid - 1 ) ;
int tileSheetX = realTileSheetIndex % tileSheetWidth ;
@ -2302,8 +2302,8 @@ void AiL::_PrepareLevel(MapName map,MusicChange changeMusic){
if ( ! loopAll & & & layer = = & layer2 ) { layer2ID + + ; continue ; } ;
int tileID = layer2 . tiles [ pos . y ] [ pos . x ] - 1 ;
TilesheetData tileSheet = GetTileSheet ( currentLevel , tileID % 1000000 ) ;
int tileSheetWidth = tileSheet . tileset - > tileset - > Sprite ( ) - > width / tileSheet . tileset - > tilewidth ;
int tileSheetHeight = tileSheet . tileset - > tileset - > Sprite ( ) - > height / tileSheet . tileset - > tileheight ;
int tileSheetWidth = tileSheet . tileset . tileset - > Sprite ( ) - > width / tileSheet . tileset . tilewidth ;
int tileSheetHeight = tileSheet . tileset . tileset - > Sprite ( ) - > height / tileSheet . tileset . tileheight ;
int tileSheetIndex = tileID - ( tileSheet . firstgid - 1 ) ;
int realTileSheetIndex = ( tileID % 1000000 ) - ( tileSheet . firstgid - 1 ) ;
int tileSheetX = realTileSheetIndex % tileSheetWidth ;
@ -2389,10 +2389,10 @@ void AiL::_PrepareLevel(MapName map,MusicChange changeMusic){
for ( auto & it = find_tiles . first ; it ! = find_tiles . second ; + + it ) {
//These are all tiles that were found adjacent to the location we are checking for. See if they match a potential group.
TileRenderData & foundTile = ( * it ) . second ;
if ( tile . tileSheet . tileset = = foundTile . tileSheet . tileset ) { //Let's first see if they are even in the same tileset.
if ( & tile . tileSheet . tileset = = & foundTile . tileSheet . tileset ) { //Let's first see if they are even in the same tileset.
//Let's get how many tiles wide this tile sheet is.
int tileWidth = tile . tileSheet . tileset - > tilewidth ;
int tileSheetWidth = tile . tileSheet . tileset - > tileset - > Sprite ( ) - > width / tileWidth ;
int tileWidth = tile . tileSheet . tileset . tilewidth ;
int tileSheetWidth = tile . tileSheet . tileset . tileset - > Sprite ( ) - > width / tileWidth ;
if ( IsAdjacent ( tile . tileID , foundTile . tileID , tileSheetWidth ) ) {
group . insert ( { loc , tile } ) ; //We add this tile to the group! It is adjacent!
groupFound = true ;
@ -2540,32 +2540,32 @@ bool AiL::IsUpperForegroundTile(int tileID){
}
bool AiL : : IsForegroundTile ( TilesheetData sheet , int tileID ) {
return sheet . tileset - > foregroundTiles . find ( tileID ) ! = sheet . tileset - > foregroundTiles . end ( ) ;
return sheet . tileset . foregroundTiles . find ( tileID ) ! = sheet . tileset . foregroundTiles . end ( ) ;
}
TilesheetData AiL : : GetTileSheet ( MapName map , int tileID ) {
std : : vector < XMLTag > & tileData = MAP_DATA [ map ] . TilesetData ;
const TilesheetData AiL : : GetTileSheet ( MapName map , int tileID ) const {
const std : : vector < XMLTag > & tileData = MAP_DATA . at ( map ) . TilesetData ;
if ( tileData . size ( ) = = 1 ) {
size_t slashMarkerSourceDir = tileData [ 0 ] . data [ " source " ] . find_last_of ( ' / ' ) ;
std : : string baseSourceDir = tileData [ 0 ] . data [ " source " ] . substr ( slashMarkerSourceDir + 1 ) ;
return { & MAP_TILESETS [ " assets/maps/ " + baseSourceDir ] , 1 , MAP_TILESETS [ " assets/maps/ " + baseSourceDir ] . tilecols [ tileID ] } ;
size_t slashMarkerSourceDir = tileData [ 0 ] . data . at ( " source " ) . find_last_of ( ' / ' ) ;
std : : string baseSourceDir = tileData [ 0 ] . data . at ( " source " ) . substr ( slashMarkerSourceDir + 1 ) ;
return { MAP_TILESETS . at ( " assets/maps/ " + baseSourceDir ) , 1 , MAP_TILESETS . at ( " assets/maps/ " + baseSourceDir ) . tilecols [ tileID ] } ;
} else {
for ( int i = 1 ; i < tileData . size ( ) ; i + + ) {
int firstgid = stoi ( tileData [ i - 1 ] . data [ " firstgid " ] ) ;
if ( tileID % 1000000 < stoi ( tileData [ i ] . data [ " firstgid " ] ) - 1 ) {
size_t slashMarkerSourceDir = tileData [ size_t ( i - 1 ) ] . data [ " source " ] . find_last_of ( ' / ' ) ;
std : : string baseSourceDir = tileData [ size_t ( i - 1 ) ] . data [ " source " ] . substr ( slashMarkerSourceDir + 1 ) ;
int firstgid = stoi ( tileData [ i - 1 ] . data . at ( " firstgid " ) ) ;
if ( tileID % 1000000 < stoi ( tileData [ i ] . data . at ( " firstgid " ) ) - 1 ) {
size_t slashMarkerSourceDir = tileData [ size_t ( i - 1 ) ] . data . at ( " source " ) . find_last_of ( ' / ' ) ;
std : : string baseSourceDir = tileData [ size_t ( i - 1 ) ] . data . at ( " source " ) . substr ( slashMarkerSourceDir + 1 ) ;
if ( tileID ! = - 1 ) {
return { & MAP_TILESETS [ " assets/maps/ " + baseSourceDir ] , firstgid , MAP_TILESETS [ " assets/maps/ " + baseSourceDir ] . tilecols [ tileID - ( firstgid - 1 ) ] } ;
return { MAP_TILESETS . at ( " assets/maps/ " + baseSourceDir ) , firstgid , MAP_TILESETS . at ( " assets/maps/ " + baseSourceDir ) . tilecols [ tileID - ( firstgid - 1 ) ] } ;
} else {
return { & MAP_TILESETS [ " assets/maps/ " + baseSourceDir ] , firstgid , BLANK } ;
return { MAP_TILESETS . at ( " assets/maps/ " + baseSourceDir ) , firstgid , BLANK } ;
}
}
}
size_t slashMarkerSourceDir = tileData [ tileData . size ( ) - 1 ] . data [ " source " ] . find_last_of ( ' / ' ) ;
std : : string baseSourceDir = tileData [ tileData . size ( ) - 1 ] . data [ " source " ] . substr ( slashMarkerSourceDir + 1 ) ;
int firstgid = stoi ( tileData [ tileData . size ( ) - 1 ] . data [ " firstgid " ] ) ;
return { & MAP_TILESETS [ " assets/maps/ " + baseSourceDir ] , firstgid , MAP_TILESETS [ " assets/maps/ " + baseSourceDir ] . tilecols [ tileID - ( firstgid - 1 ) ] } ;
size_t slashMarkerSourceDir = tileData [ tileData . size ( ) - 1 ] . data . at ( " source " ) . find_last_of ( ' / ' ) ;
std : : string baseSourceDir = tileData [ tileData . size ( ) - 1 ] . data . at ( " source " ) . substr ( slashMarkerSourceDir + 1 ) ;
int firstgid = stoi ( tileData [ tileData . size ( ) - 1 ] . data . at ( " firstgid " ) ) ;
return { MAP_TILESETS . at ( " assets/maps/ " + baseSourceDir ) , firstgid , MAP_TILESETS . at ( " assets/maps/ " + baseSourceDir ) . tilecols [ tileID - ( firstgid - 1 ) ] } ;
}
}
@ -2584,18 +2584,18 @@ bool AiL::IsOverlayLayer(LayerTag&layer){
return layer . tag . data . find ( " class " ) ! = layer . tag . data . end ( ) & & layer . tag . data [ " class " ] = = " Overlay " ;
}
geom2d : : rect < float > AiL : : GetTileCollision ( MapName map , vf2d pos , bool upperLevel ) {
MapTag & mapData = MAP_DATA [ map ] . MapData ;
const geom2d : : rect < float > AiL : : GetTileCollision ( MapName map , vf2d pos , bool upperLevel ) const {
const MapTag & mapData = MAP_DATA . at ( map ) . MapData ;
if ( pos . x < 0 | | pos . y < 0 | | pos . x > = mapData . width * mapData . tilewidth | | pos . y > = mapData . height * mapData . tilewidth ) return NO_COLLISION ;
if ( MAP_DATA [ map ] . optimizedTile ) return NO_COLLISION ; //Overworld map has no collision.
if ( MAP_DATA . at ( map ) . optimizedTile ) return NO_COLLISION ; //Overworld map has no collision.
bool hasTerrain = false ;
for ( const LayerTag & layer : MAP_DATA [ map ] . LayerData ) { //Figure out if any tile at this position is terrain. If so, we have a collision box to check.
for ( const LayerTag & layer : MAP_DATA . at ( map ) . LayerData ) { //Figure out if any tile at this position is terrain. If so, we have a collision box to check.
if ( Unlock : : IsUnlocked ( layer . unlockCondition ) ) {
int tileID = layer . tiles [ pos . y / mapData . tilewidth ] [ pos . x / mapData . tilewidth ] - 1 ;
if ( tileID = = - 1 ) continue ;
const TilesheetData & data = GetTileSheet ( map , tileID ) ;
if ( data . tileset - > isTerrain ) {
if ( data . tileset . isTerrain ) {
hasTerrain = true ;
break ;
}
@ -2604,8 +2604,8 @@ geom2d::rect<float>AiL::GetTileCollision(MapName map,vf2d pos,bool upperLevel){
if ( ! hasTerrain ) return geom2d : : rect < float > ( { 0.f , 0.f } , { float ( mapData . tilewidth ) , float ( mapData . tilewidth ) } ) ; //We assume no terrain means we can't walk on this.
# pragma region Lower Bridge Collision Check
if ( ! upperLevel ) { //We are looking for lower bridge collisions.
for ( ZoneData & zone : MAP_DATA [ map ] . ZoneData [ " LowerBridgeCollision " ] ) {
if ( ! upperLevel & & MAP_DATA . at ( map ) . ZoneData . count ( " LowerBridgeCollision " ) ) { //We are looking for lower bridge collisions.
for ( const ZoneData & zone : MAP_DATA . at ( map ) . ZoneData . at ( " LowerBridgeCollision " ) ) {
if ( geom2d : : contains ( zone . zone , pos ) ) {
return { { 0 , 0 } , { float ( mapData . tilewidth ) , float ( mapData . tilewidth ) } } ;
}
@ -2614,22 +2614,22 @@ geom2d::rect<float>AiL::GetTileCollision(MapName map,vf2d pos,bool upperLevel){
# pragma endregion
//The logic here is, if there's a tile on the bridge, we respect that tile instead if we're on the upper level. So we don't check other layers when we are on the upper level and there is a tile below us.
if ( upperLevel & & bridgeLayerIndex ! = - 1 ) {
int tileID = MAP_DATA [ map ] . LayerData [ bridgeLayerIndex ] . tiles [ int ( pos . y ) / mapData . tilewidth ] [ int ( pos . x ) / mapData . tilewidth ] - 1 ;
int tileID = MAP_DATA . at ( map ) . LayerData [ bridgeLayerIndex ] . tiles [ int ( pos . y ) / mapData . tilewidth ] [ int ( pos . x ) / mapData . tilewidth ] - 1 ;
if ( tileID ! = - 1 ) {
if ( GetTileSheet ( map , tileID % 1000000 ) . tileset - > collision . find ( tileID % 1000000 - GetTileSheet ( map , tileID % 1000000 ) . firstgid + 1 ) ! = GetTileSheet ( map , tileID % 1000000 ) . tileset - > collision . end ( ) ) {
return GetTileSheet ( map , tileID % 1000000 ) . tileset - > collision [ tileID % 1000000 - GetTileSheet ( map , tileID % 1000000 ) . firstgid + 1 ] . collision ;
if ( GetTileSheet ( map , tileID % 1000000 ) . tileset . collision . find ( tileID % 1000000 - GetTileSheet ( map , tileID % 1000000 ) . firstgid + 1 ) ! = GetTileSheet ( map , tileID % 1000000 ) . tileset . collision . end ( ) ) {
return const_cast < TilesetData & > ( GetTileSheet ( map , tileID % 1000000 ) . tileset ) . collision . at ( tileID % 1000000 - GetTileSheet ( map , tileID % 1000000 ) . firstgid + 1 ) . collision ;
}
return NO_COLLISION ;
}
}
geom2d : : rect < float > foundRect = NO_COLLISION ;
for ( int counter = 0 ; LayerTag & layer : MAP_DATA [ map ] . LayerData ) {
for ( int counter = 0 ; const LayerTag & layer : MAP_DATA . at ( map ) . LayerData ) {
if ( Unlock : : IsUnlocked ( layer . unlockCondition ) ) {
//auto HasNoClass=[&](){return layer.tag.data.find("class")==layer.tag.data.end();};
if ( counter ! = bridgeLayerIndex ) {
int tileID = layer . tiles [ int ( pos . y ) / mapData . tilewidth ] [ int ( pos . x ) / mapData . tilewidth ] - 1 ;
if ( tileID ! = - 1 & & GetTileSheet ( map , tileID % 1000000 ) . tileset - > collision . find ( tileID % 1000000 - GetTileSheet ( map , tileID % 1000000 ) . firstgid + 1 ) ! = GetTileSheet ( map , tileID % 1000000 ) . tileset - > collision . end ( ) ) {
geom2d : : rect < float > collisionRect = GetTileSheet ( map , tileID % 1000000 ) . tileset - > collision [ tileID % 1000000 - GetTileSheet ( map , tileID % 1000000 ) . firstgid + 1 ] . collision ;
if ( tileID ! = - 1 & & GetTileSheet ( map , tileID % 1000000 ) . tileset . collision . find ( tileID % 1000000 - GetTileSheet ( map , tileID % 1000000 ) . firstgid + 1 ) ! = GetTileSheet ( map , tileID % 1000000 ) . tileset . collision . end ( ) ) {
const geom2d : : rect < float > collisionRect = const_cast < TilesetData & > ( GetTileSheet ( map , tileID % 1000000 ) . tileset ) . collision . at ( tileID % 1000000 - GetTileSheet ( map , tileID % 1000000 ) . firstgid + 1 ) . collision ;
if ( foundRect = = NO_COLLISION ) {
foundRect = collisionRect ;
} else {
@ -2981,7 +2981,7 @@ void AiL::OutputDebugInfo(const char*key,std::size_t len){
}
bool AiL : : IsReflectiveTile ( TilesheetData tileSheet , int tileID ) {
return tileSheet . tileset - > reflectiveData . find ( tileID ) ! = tileSheet . tileset - > reflectiveData . end ( ) ;
return tileSheet . tileset . reflectiveData . find ( tileID ) ! = tileSheet . tileset . reflectiveData . end ( ) ;
}
bool AiL : : OnUserDestroy ( ) {