@ -1266,94 +1266,214 @@ void AiL::RenderWorld(float fElapsedTime){
m . strategyDraw ( this , m , MONSTER_DATA [ m . GetName ( ) ] . GetAIStrategy ( ) ) ;
m . strategyDraw ( this , m , MONSTER_DATA [ m . GetName ( ) ] . GetAIStrategy ( ) ) ;
}
}
# pragma region Rendering before Tile Depth Rendering
if ( tilesWithCollision . size ( ) > 0 ) {
const float topTileY = ( * tilesWithCollision . begin ( ) ) - > group - > GetCollisionRange ( ) . middle ( ) . y ;
# pragma region Depth Ordered Rendering
{
auto it = monstersBeforeLower . begin ( ) ;
while ( it ! = monstersBeforeLower . end ( ) ) {
Monster & m = * * it ;
if ( m . pos . y < topTileY ) {
m . Draw ( ) ;
it = monstersBeforeLower . erase ( it ) ;
if ( it = = monstersBeforeLower . end ( ) ) break ;
continue ;
}
break ;
}
}
{
auto it = bulletsLower . begin ( ) ;
while ( it ! = bulletsLower . end ( ) ) {
const Bullet & b = * * it ;
if ( b . pos . y < topTileY ) {
b . Draw ( ) ;
it = bulletsLower . erase ( it ) ;
if ( it = = bulletsLower . end ( ) ) break ;
continue ;
}
break ;
}
}
{
auto it = backgroundEffectsLower . begin ( ) ;
while ( it ! = backgroundEffectsLower . end ( ) ) {
const Effect & e = * * it ;
if ( e . pos . y < topTileY ) {
e . Draw ( ) ;
it = backgroundEffectsLower . erase ( it ) ;
if ( it = = backgroundEffectsLower . end ( ) ) break ;
continue ;
}
break ;
}
}
{
auto it = dropsBeforeLower . begin ( ) ;
while ( it ! = dropsBeforeLower . end ( ) ) {
const ItemDrop & drop = ItemDrop : : drops [ * it ] ;
if ( drop . pos . y < topTileY ) {
drop . Draw ( ) ;
it = dropsBeforeLower . erase ( it ) ;
if ( it = = dropsBeforeLower . end ( ) ) break ;
continue ;
}
break ;
}
}
if ( ! player - > rendered & & ! player - > upperLevel & & player - > GetPos ( ) . y < topTileY ) {
player - > rendered = true ;
if ( player - > GetZ ( ) > 0 ) {
vf2d shadowScale = vf2d { 8 * player - > GetSizeMult ( ) / 3.f , 1 } / std : : max ( 1.f , player - > GetZ ( ) / 24 ) ;
view . DrawDecal ( player - > GetPos ( ) - vf2d { 3 , 3 } * shadowScale / 2 + vf2d { 0 , 6 * player - > GetSizeMult ( ) } , GFX [ " circle.png " ] . Decal ( ) , shadowScale , BLACK ) ;
}
RenderPlayer ( player - > GetPos ( ) , { 1 , 1 } ) ;
}
{
auto it = monstersAfterLower . begin ( ) ;
while ( it ! = monstersAfterLower . end ( ) ) {
Monster & m = * * it ;
if ( m . pos . y < topTileY ) {
m . Draw ( ) ;
it = monstersAfterLower . erase ( it ) ;
if ( it = = monstersAfterLower . end ( ) ) break ;
continue ;
}
break ;
}
}
{
auto it = dropsAfterLower . begin ( ) ;
while ( it ! = dropsAfterLower . end ( ) ) {
const ItemDrop & drop = ItemDrop : : drops [ * it ] ;
if ( drop . pos . y < topTileY ) {
drop . Draw ( ) ;
it = dropsAfterLower . erase ( it ) ;
if ( it = = dropsAfterLower . end ( ) ) break ;
continue ;
}
break ;
}
}
{
auto it = foregroundEffectsLower . begin ( ) ;
while ( it ! = foregroundEffectsLower . end ( ) ) {
const Effect & e = * * it ;
if ( e . pos . y < topTileY ) {
e . Draw ( ) ;
it = foregroundEffectsLower . erase ( it ) ;
if ( it = = foregroundEffectsLower . end ( ) ) break ;
continue ;
}
break ;
}
}
# pragma endregion
}
# pragma endregion
# pragma region Foreground Rendering w / Depth
# pragma region Foreground Rendering w / Depth
for ( TileRenderData * tile : tilesWithCollision ) {
for ( TileRenderData * tile : tilesWithCollision ) {
# pragma region Depth Ordered Rendering
# pragma region Depth Ordered Rendering
for ( auto it = monstersBeforeLower . begin ( ) ; it ! = monstersBeforeLower . end ( ) ; + + it ) {
{
auto it = monstersBeforeLower . begin ( ) ;
while ( it ! = monstersBeforeLower . end ( ) ) {
Monster & m = * * it ;
Monster & m = * * it ;
if ( m . pos . y < tile - > group - > GetCollisionRange ( ) . middle ( ) . y ) {
if ( m . pos . y < tile - > group - > GetCollisionRange ( ) . middle ( ) . y ) {
m . Draw ( ) ;
m . Draw ( ) ;
it = monstersBeforeLower . erase ( it ) ;
it = monstersBeforeLower . erase ( it ) ;
if ( it = = monstersBeforeLower . end ( ) ) break ;
if ( it = = monstersBeforeLower . end ( ) ) break ;
if ( it ! = monstersBeforeLower . begin ( ) ) - - it ;
continue ;
continue ;
}
}
break ;
break ;
}
}
for ( auto it = bulletsLower . begin ( ) ; it ! = bulletsLower . end ( ) ; + + it ) {
}
{
auto it = bulletsLower . begin ( ) ;
while ( it ! = bulletsLower . end ( ) ) {
const Bullet & b = * * it ;
const Bullet & b = * * it ;
if ( b . pos . y < tile - > group - > GetCollisionRange ( ) . middle ( ) . y ) {
if ( b . pos . y < tile - > group - > GetCollisionRange ( ) . middle ( ) . y ) {
b . Draw ( ) ;
b . Draw ( ) ;
it = bulletsLower . erase ( it ) ;
it = bulletsLower . erase ( it ) ;
if ( it = = bulletsLower . end ( ) ) break ;
if ( it = = bulletsLower . end ( ) ) break ;
if ( it ! = bulletsLower . begin ( ) ) - - it ;
continue ;
continue ;
}
}
break ;
break ;
}
}
for ( auto it = backgroundEffectsLower . begin ( ) ; it ! = backgroundEffectsLower . end ( ) ; + + it ) {
}
{
auto it = backgroundEffectsLower . begin ( ) ;
while ( it ! = backgroundEffectsLower . end ( ) ) {
const Effect & e = * * it ;
const Effect & e = * * it ;
if ( e . pos . y < tile - > group - > GetCollisionRange ( ) . middle ( ) . y ) {
if ( e . pos . y < tile - > group - > GetCollisionRange ( ) . middle ( ) . y ) {
e . Draw ( ) ;
e . Draw ( ) ;
it = backgroundEffectsLower . erase ( it ) ;
it = backgroundEffectsLower . erase ( it ) ;
if ( it = = backgroundEffectsLower . end ( ) ) break ;
if ( it = = backgroundEffectsLower . end ( ) ) break ;
if ( it ! = backgroundEffectsLower . begin ( ) ) - - it ;
continue ;
continue ;
}
}
break ;
break ;
}
}
for ( auto it = dropsBeforeLower . begin ( ) ; it ! = dropsBeforeLower . end ( ) ; + + it ) {
}
{
auto it = dropsBeforeLower . begin ( ) ;
while ( it ! = dropsBeforeLower . end ( ) ) {
const ItemDrop & drop = ItemDrop : : drops [ * it ] ;
const ItemDrop & drop = ItemDrop : : drops [ * it ] ;
if ( drop . pos . y < tile - > group - > GetCollisionRange ( ) . middle ( ) . y ) {
if ( drop . pos . y < tile - > group - > GetCollisionRange ( ) . middle ( ) . y ) {
drop . Draw ( ) ;
drop . Draw ( ) ;
it = dropsBeforeLower . erase ( it ) ;
it = dropsBeforeLower . erase ( it ) ;
if ( it = = dropsBeforeLower . end ( ) ) break ;
if ( it = = dropsBeforeLower . end ( ) ) break ;
if ( it ! = dropsBeforeLower . begin ( ) ) - - it ;
continue ;
continue ;
}
}
break ;
break ;
}
}
if ( ! player - > rendered & & ! player - > upperLevel & & player - > GetPos ( ) . y < tile - > group - > GetCollisionRange ( ) . middle ( ) . y ) {
}
player - > rendered = true ;
if ( ! player - > rendered & & ! player - > upperLevel & & player - > GetPos ( ) . y < tile - > group - > GetCollisionRange ( ) . middle ( ) . y ) {
if ( player - > GetZ ( ) > 0 ) {
player - > rendered = true ;
vf2d shadowScale = vf2d { 8 * player - > GetSizeMult ( ) / 3.f , 1 } / std : : max ( 1.f , player - > GetZ ( ) / 24 ) ;
if ( player - > GetZ ( ) > 0 ) {
view . DrawDecal ( player - > GetPos ( ) - vf2d { 3 , 3 } * shadowScale / 2 + vf2d { 0 , 6 * player - > GetSizeMult ( ) } , GFX [ " circle.png " ] . Decal ( ) , shadowScale , BLACK ) ;
vf2d shadowScale = vf2d { 8 * player - > GetSizeMult ( ) / 3.f , 1 } / std : : max ( 1.f , player - > GetZ ( ) / 24 ) ;
}
view . DrawDecal ( player - > GetPos ( ) - vf2d { 3 , 3 } * shadowScale / 2 + vf2d { 0 , 6 * player - > GetSizeMult ( ) } , GFX [ " circle.png " ] . Decal ( ) , shadowScale , BLACK ) ;
RenderPlayer ( player - > GetPos ( ) , { 1 , 1 } ) ;
}
}
for ( auto it = monstersAfterLower . begin ( ) ; it ! = monstersAfterLower . end ( ) ; + + it ) {
RenderPlayer ( player - > GetPos ( ) , { 1 , 1 } ) ;
}
{
auto it = monstersAfterLower . begin ( ) ;
while ( it ! = monstersAfterLower . end ( ) ) {
Monster & m = * * it ;
Monster & m = * * it ;
if ( m . pos . y < tile - > group - > GetCollisionRange ( ) . middle ( ) . y ) {
if ( m . pos . y < tile - > group - > GetCollisionRange ( ) . middle ( ) . y ) {
m . Draw ( ) ;
m . Draw ( ) ;
it = monstersAfterLower . erase ( it ) ;
it = monstersAfterLower . erase ( it ) ;
if ( it = = monstersAfterLower . end ( ) ) break ;
if ( it = = monstersAfterLower . end ( ) ) break ;
if ( it ! = monstersAfterLower . begin ( ) ) - - it ;
continue ;
continue ;
}
}
break ;
break ;
}
}
for ( auto it = dropsAfterLower . begin ( ) ; it ! = dropsAfterLower . end ( ) ; + + it ) {
}
{
auto it = dropsAfterLower . begin ( ) ;
while ( it ! = dropsAfterLower . end ( ) ) {
const ItemDrop & drop = ItemDrop : : drops [ * it ] ;
const ItemDrop & drop = ItemDrop : : drops [ * it ] ;
if ( drop . pos . y < tile - > group - > GetCollisionRange ( ) . middle ( ) . y ) {
if ( drop . pos . y < tile - > group - > GetCollisionRange ( ) . middle ( ) . y ) {
drop . Draw ( ) ;
drop . Draw ( ) ;
it = dropsAfterLower . erase ( it ) ;
it = dropsAfterLower . erase ( it ) ;
if ( it = = dropsAfterLower . end ( ) ) break ;
if ( it = = dropsAfterLower . end ( ) ) break ;
if ( it ! = dropsAfterLower . begin ( ) ) - - it ;
continue ;
continue ;
}
}
break ;
break ;
}
}
for ( auto it = foregroundEffectsLower . begin ( ) ; it ! = foregroundEffectsLower . end ( ) ; + + it ) {
}
{
auto it = foregroundEffectsLower . begin ( ) ;
while ( it ! = foregroundEffectsLower . end ( ) ) {
const Effect & e = * * it ;
const Effect & e = * * it ;
if ( e . pos . y < tile - > group - > GetCollisionRange ( ) . middle ( ) . y ) {
if ( e . pos . y < tile - > group - > GetCollisionRange ( ) . middle ( ) . y ) {
e . Draw ( ) ;
e . Draw ( ) ;
it = foregroundEffectsLower . erase ( it ) ;
it = foregroundEffectsLower . erase ( it ) ;
if ( it = = foregroundEffectsLower . end ( ) ) break ;
if ( it = = foregroundEffectsLower . end ( ) ) break ;
if ( it ! = foregroundEffectsLower . begin ( ) ) - - it ;
continue ;
continue ;
}
}
break ;
break ;
}
}
}
# pragma endregion
# pragma endregion
RenderTile ( * tile , { 255 , 255 , 255 , uint8_t ( 255 - tile - > tileOpacity / TileGroup : : FADE_TIME * TileGroup : : FADE_AMT ) } ) ;
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 ( ) ;
float distToPlayer = geom2d : : line < float > ( player - > GetPos ( ) , tile - > pos + vf2d { 12 , 12 } ) . length ( ) ;
@ -1521,95 +1641,216 @@ void AiL::RenderWorld(float fElapsedTime){
Monster & m = * * it ;
Monster & m = * * it ;
m . strategyDraw ( this , m , MONSTER_DATA [ m . GetName ( ) ] . GetAIStrategy ( ) ) ;
m . strategyDraw ( this , m , MONSTER_DATA [ m . GetName ( ) ] . GetAIStrategy ( ) ) ;
}
}
# pragma region Rendering before Tile Depth Rendering
if ( tilesWithCollision . size ( ) > 0 ) {
const float topTileY = ( * tilesWithCollision . begin ( ) ) - > group - > GetCollisionRange ( ) . middle ( ) . y ;
# pragma region Depth Ordered Rendering
{
auto it = monstersBeforeUpper . begin ( ) ;
while ( it ! = monstersBeforeUpper . end ( ) ) {
Monster & m = * * it ;
if ( m . pos . y < topTileY ) {
m . Draw ( ) ;
it = monstersBeforeUpper . erase ( it ) ;
if ( it = = monstersBeforeUpper . end ( ) ) break ;
continue ;
}
break ;
}
}
{
auto it = bulletsUpper . begin ( ) ;
while ( it ! = bulletsUpper . end ( ) ) {
const Bullet & b = * * it ;
if ( b . pos . y < topTileY ) {
b . Draw ( ) ;
it = bulletsUpper . erase ( it ) ;
if ( it = = bulletsUpper . end ( ) ) break ;
continue ;
}
break ;
}
}
{
auto it = backgroundEffectsUpper . begin ( ) ;
while ( it ! = backgroundEffectsUpper . end ( ) ) {
const Effect & e = * * it ;
if ( e . pos . y < topTileY ) {
e . Draw ( ) ;
it = backgroundEffectsUpper . erase ( it ) ;
if ( it = = backgroundEffectsUpper . end ( ) ) break ;
continue ;
}
break ;
}
}
{
auto it = dropsBeforeUpper . begin ( ) ;
while ( it ! = dropsBeforeUpper . end ( ) ) {
const ItemDrop & drop = ItemDrop : : drops [ * it ] ;
if ( drop . pos . y < topTileY ) {
drop . Draw ( ) ;
it = dropsBeforeUpper . erase ( it ) ;
if ( it = = dropsBeforeUpper . end ( ) ) break ;
continue ;
}
break ;
}
}
if ( ! player - > rendered & & ! player - > upperLevel & & player - > GetPos ( ) . y < topTileY ) {
player - > rendered = true ;
if ( player - > GetZ ( ) > 0 ) {
vf2d shadowScale = vf2d { 8 * player - > GetSizeMult ( ) / 3.f , 1 } / std : : max ( 1.f , player - > GetZ ( ) / 24 ) ;
view . DrawDecal ( player - > GetPos ( ) - vf2d { 3 , 3 } * shadowScale / 2 + vf2d { 0 , 6 * player - > GetSizeMult ( ) } , GFX [ " circle.png " ] . Decal ( ) , shadowScale , BLACK ) ;
}
RenderPlayer ( player - > GetPos ( ) , { 1 , 1 } ) ;
}
{
auto it = monstersAfterUpper . begin ( ) ;
while ( it ! = monstersAfterUpper . end ( ) ) {
Monster & m = * * it ;
if ( m . pos . y < topTileY ) {
m . Draw ( ) ;
it = monstersAfterUpper . erase ( it ) ;
if ( it = = monstersAfterUpper . end ( ) ) break ;
continue ;
}
break ;
}
}
{
auto it = dropsAfterUpper . begin ( ) ;
while ( it ! = dropsAfterUpper . end ( ) ) {
const ItemDrop & drop = ItemDrop : : drops [ * it ] ;
if ( drop . pos . y < topTileY ) {
drop . Draw ( ) ;
it = dropsAfterUpper . erase ( it ) ;
if ( it = = dropsAfterUpper . end ( ) ) break ;
continue ;
}
break ;
}
}
{
auto it = foregroundEffectsUpper . begin ( ) ;
while ( it ! = foregroundEffectsUpper . end ( ) ) {
const Effect & e = * * it ;
if ( e . pos . y < topTileY ) {
e . Draw ( ) ;
it = foregroundEffectsUpper . erase ( it ) ;
if ( it = = foregroundEffectsUpper . end ( ) ) break ;
if ( it ! = foregroundEffectsUpper . begin ( ) ) - - it ;
continue ;
}
break ;
}
}
# pragma endregion
}
# pragma endregion
# pragma region Upper Foreground Rendering w / Depth
# pragma region Upper Foreground Rendering w / Depth
for ( TileRenderData * tile : tilesWithCollision ) {
for ( TileRenderData * tile : tilesWithCollision ) {
# pragma region Depth Ordered Upper Rendering
# pragma region Depth Ordered Upper Rendering
for ( auto it = monstersBeforeUpper . begin ( ) ; it ! = monstersBeforeUpper . end ( ) ; + + it ) {
{
auto it = monstersBeforeUpper . begin ( ) ;
while ( it ! = monstersBeforeUpper . end ( ) ) {
Monster & m = * * it ;
Monster & m = * * it ;
if ( m . pos . y < tile - > group - > GetCollisionRange ( ) . middle ( ) . y ) {
if ( m . pos . y < tile - > group - > GetCollisionRange ( ) . middle ( ) . y ) {
m . Draw ( ) ;
m . Draw ( ) ;
it = monstersBeforeUpper . erase ( it ) ;
it = monstersBeforeUpper . erase ( it ) ;
if ( it = = monstersBeforeUpper . end ( ) ) break ;
if ( it = = monstersBeforeUpper . end ( ) ) break ;
if ( it ! = monstersBeforeUpper . begin ( ) ) - - it ;
continue ;
continue ;
}
}
break ;
break ;
}
}
for ( auto it = bulletsUpper . begin ( ) ; it ! = bulletsUpper . end ( ) ; + + it ) {
}
{
auto it = bulletsUpper . begin ( ) ;
while ( it ! = bulletsUpper . end ( ) ) {
const Bullet & b = * * it ;
const Bullet & b = * * it ;
if ( b . pos . y < tile - > group - > GetCollisionRange ( ) . middle ( ) . y ) {
if ( b . pos . y < tile - > group - > GetCollisionRange ( ) . middle ( ) . y ) {
b . Draw ( ) ;
b . Draw ( ) ;
it = bulletsUpper . erase ( it ) ;
it = bulletsUpper . erase ( it ) ;
if ( it = = bulletsUpper . end ( ) ) break ;
if ( it = = bulletsUpper . end ( ) ) break ;
if ( it ! = bulletsUpper . begin ( ) ) - - it ;
continue ;
continue ;
}
}
break ;
break ;
}
}
for ( auto it = backgroundEffectsUpper . begin ( ) ; it ! = backgroundEffectsUpper . end ( ) ; + + it ) {
}
{
auto it = backgroundEffectsUpper . begin ( ) ;
while ( it ! = backgroundEffectsUpper . end ( ) ) {
const Effect & e = * * it ;
const Effect & e = * * it ;
if ( e . pos . y < tile - > group - > GetCollisionRange ( ) . middle ( ) . y ) {
if ( e . pos . y < tile - > group - > GetCollisionRange ( ) . middle ( ) . y ) {
e . Draw ( ) ;
e . Draw ( ) ;
it = backgroundEffectsUpper . erase ( it ) ;
it = backgroundEffectsUpper . erase ( it ) ;
if ( it = = backgroundEffectsUpper . end ( ) ) break ;
if ( it = = backgroundEffectsUpper . end ( ) ) break ;
if ( it ! = backgroundEffectsUpper . begin ( ) ) - - it ;
continue ;
continue ;
}
}
break ;
break ;
}
}
for ( auto it = dropsBeforeUpper . begin ( ) ; it ! = dropsBeforeUpper . end ( ) ; + + it ) {
}
{
auto it = dropsBeforeUpper . begin ( ) ;
while ( it ! = dropsBeforeUpper . end ( ) ) {
const ItemDrop & drop = ItemDrop : : drops [ * it ] ;
const ItemDrop & drop = ItemDrop : : drops [ * it ] ;
if ( drop . pos . y < tile - > group - > GetCollisionRange ( ) . middle ( ) . y ) {
if ( drop . pos . y < tile - > group - > GetCollisionRange ( ) . middle ( ) . y ) {
drop . Draw ( ) ;
drop . Draw ( ) ;
it = dropsBeforeUpper . erase ( it ) ;
it = dropsBeforeUpper . erase ( it ) ;
if ( it = = dropsBeforeUpper . end ( ) ) break ;
if ( it = = dropsBeforeUpper . end ( ) ) break ;
if ( it ! = dropsBeforeUpper . begin ( ) ) - - it ;
continue ;
continue ;
}
}
break ;
break ;
}
}
if ( ! player - > rendered & & player - > upperLevel & & player - > GetPos ( ) . y < tile - > group - > GetCollisionRange ( ) . middle ( ) . y ) {
}
player - > rendered = true ;
if ( ! player - > rendered & & player - > upperLevel & & player - > GetPos ( ) . y < tile - > group - > GetCollisionRange ( ) . middle ( ) . y ) {
if ( player - > GetZ ( ) > 0 ) {
player - > rendered = true ;
vf2d shadowScale = vf2d { 8 * player - > GetSizeMult ( ) / 3.f , 1 } / std : : max ( 1.f , player - > GetZ ( ) / 24 ) ;
if ( player - > GetZ ( ) > 0 ) {
view . DrawDecal ( player - > GetPos ( ) - vf2d { 3 , 3 } * shadowScale / 2 + vf2d { 0 , 6 * player - > GetSizeMult ( ) } , GFX [ " circle.png " ] . Decal ( ) , shadowScale , BLACK ) ;
vf2d shadowScale = vf2d { 8 * player - > GetSizeMult ( ) / 3.f , 1 } / std : : max ( 1.f , player - > GetZ ( ) / 24 ) ;
}
view . DrawDecal ( player - > GetPos ( ) - vf2d { 3 , 3 } * shadowScale / 2 + vf2d { 0 , 6 * player - > GetSizeMult ( ) } , GFX [ " circle.png " ] . Decal ( ) , shadowScale , BLACK ) ;
RenderPlayer ( player - > GetPos ( ) , { 1 , 1 } ) ;
}
}
for ( auto it = monstersAfterUpper . begin ( ) ; it ! = monstersAfterUpper . end ( ) ; + + it ) {
RenderPlayer ( player - > GetPos ( ) , { 1 , 1 } ) ;
}
{
auto it = monstersAfterUpper . begin ( ) ;
while ( it ! = monstersAfterUpper . end ( ) ) {
Monster & m = * * it ;
Monster & m = * * it ;
if ( m . pos . y < tile - > group - > GetCollisionRange ( ) . middle ( ) . y ) {
if ( m . pos . y < tile - > group - > GetCollisionRange ( ) . middle ( ) . y ) {
m . Draw ( ) ;
m . Draw ( ) ;
it = monstersAfterUpper . erase ( it ) ;
it = monstersAfterUpper . erase ( it ) ;
if ( it = = monstersAfterUpper . end ( ) ) break ;
if ( it = = monstersAfterUpper . end ( ) ) break ;
if ( it ! = monstersAfterUpper . begin ( ) ) - - it ;
continue ;
continue ;
}
}
break ;
break ;
}
}
for ( auto it = dropsAfterUpper . begin ( ) ; it ! = dropsAfterUpper . end ( ) ; + + it ) {
}
{
auto it = dropsAfterUpper . begin ( ) ;
while ( it ! = dropsAfterUpper . end ( ) ) {
const ItemDrop & drop = ItemDrop : : drops [ * it ] ;
const ItemDrop & drop = ItemDrop : : drops [ * it ] ;
if ( drop . pos . y < tile - > group - > GetCollisionRange ( ) . middle ( ) . y ) {
if ( drop . pos . y < tile - > group - > GetCollisionRange ( ) . middle ( ) . y ) {
drop . Draw ( ) ;
drop . Draw ( ) ;
it = dropsAfterUpper . erase ( it ) ;
it = dropsAfterUpper . erase ( it ) ;
if ( it = = dropsAfterUpper . end ( ) ) break ;
if ( it = = dropsAfterUpper . end ( ) ) break ;
if ( it ! = dropsAfterUpper . begin ( ) ) - - it ;
continue ;
continue ;
}
}
break ;
break ;
}
}
for ( auto it = foregroundEffectsUpper . begin ( ) ; it ! = foregroundEffectsUpper . end ( ) ; + + it ) {
}
{
auto it = foregroundEffectsUpper . begin ( ) ;
while ( it ! = foregroundEffectsUpper . end ( ) ) {
const Effect & e = * * it ;
const Effect & e = * * it ;
if ( e . pos . y < tile - > group - > GetCollisionRange ( ) . middle ( ) . y ) {
if ( e . pos . y < tile - > group - > GetCollisionRange ( ) . middle ( ) . y ) {
e . Draw ( ) ;
e . Draw ( ) ;
it = foregroundEffectsUpper . erase ( it ) ;
it = foregroundEffectsUpper . erase ( it ) ;
if ( it = = foregroundEffectsUpper . end ( ) ) break ;
if ( it = = foregroundEffectsUpper . end ( ) ) break ;
if ( it ! = foregroundEffectsUpper . begin ( ) ) - - it ;
continue ;
continue ;
}
}
break ;
break ;
}
}
}
# pragma endregion
# pragma endregion
RenderTile ( * tile , { 255 , 255 , 255 , uint8_t ( 255 - tile - > tileOpacity / TileGroup : : FADE_TIME * TileGroup : : FADE_AMT ) } ) ;
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 ( ) ;
float distToPlayer = geom2d : : line < float > ( player - > GetPos ( ) , tile - > pos + vf2d { 12 , 12 } ) . length ( ) ;
@ -2451,7 +2692,7 @@ void AiL::_PrepareLevel(MapName map,MusicChange changeMusic){
for ( NPCData data : game - > MAP_DATA [ game - > GetCurrentLevel ( ) ] . npcs ) {
for ( NPCData data : game - > MAP_DATA [ game - > GetCurrentLevel ( ) ] . npcs ) {
if ( Unlock : : IsUnlocked ( data . unlockCondition ) ) {
if ( Unlock : : IsUnlocked ( data . unlockCondition ) ) {
MONSTER_LIST . push_back ( std : : make_unique < Monster > ( data . spawnPos , MONSTER_DATA [ data . name ] ) ) ;
MONSTER_LIST . push_back ( std : : make_unique < Monster > ( data . spawnPos , MONSTER_DATA [ data . name ] ) ) ;
MONSTER_LIST . back ( ) - > iframe_timer = INFINITE ;
MONSTER_LIST . back ( ) - > SetIframes ( INFINITE ) ;
MONSTER_LIST . back ( ) - > npcData = data ;
MONSTER_LIST . back ( ) - > npcData = data ;
}
}
}
}