@ -156,8 +156,7 @@ InputGroup AiL::KEY_TOGGLE_MAP;
float AiL : : SIZE_CHANGE_SPEED = 1 ;
AiL : : AiL ( )
{
AiL : : AiL ( ) {
debugLogger . open ( " debug.log " ) ;
utils : : datafile : : Read ( DATA , " assets/config/configuration.txt " ) ;
std : : filesystem : : create_directories ( " save_file_path " _S ) ;
@ -820,7 +819,6 @@ void AiL::PopulateRenderLists(){
monstersBeforeLower . clear ( ) ;
monstersAfterLower . clear ( ) ;
monstersBeforeUpper . clear ( ) ;
monstersAfterUpper . clear ( ) ;
bulletsLower . clear ( ) ;
bulletsUpper . clear ( ) ;
backgroundEffectsLower . clear ( ) ;
@ -1267,63 +1265,55 @@ void AiL::RenderWorld(float fElapsedTime){
m . strategyDraw ( this , m , MONSTER_DATA [ m . GetName ( ) ] . GetAIStrategy ( ) ) ;
}
# pragma region Render Background Effects
{
auto it = backgroundEffectsLower . begin ( ) ;
while ( it ! = backgroundEffectsLower . end ( ) ) {
const Effect & e = * * it ;
e . Draw ( ) ;
+ + it ;
}
}
# pragma endregion
auto monstersBeforeLowerIt = monstersBeforeLower . begin ( ) ;
auto monstersAfterLowerIt = monstersAfterLower . begin ( ) ;
auto dropsBeforeLowerIt = dropsBeforeLower . begin ( ) ;
auto dropsAfterLowerIt = dropsAfterLower . begin ( ) ;
# 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 ;
while ( monstersBeforeLowerIt ! = monstersBeforeLower . end ( ) ) {
Monster & m = * * monstersBeforeLowerIt ;
if ( m . pos . y < topTileY ) {
m . Draw ( ) ;
+ + monstersBeforeLowerIt ;
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 ;
while ( dropsBeforeLowerIt ! = dropsBeforeLower . end ( ) ) {
const ItemDrop & drop = ItemDrop : : drops [ * dropsBeforeLowerIt ] ;
if ( drop . pos . y < topTileY ) {
drop . Draw ( ) ;
+ + dropsBeforeLowerIt ;
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 ;
if ( ! player - > rendered & & ! player - > upperLevel & & player - > GetPos ( ) . y < topTileY ) {
//If we are supposed to render the player, everything else before must be rendered at this point.
while ( monstersBeforeLowerIt ! = monstersBeforeLower . end ( ) ) {
Monster & m = * * monstersBeforeLowerIt ;
m . Draw ( ) ;
+ + monstersBeforeLowerIt ;
}
}
{
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 ;
while ( dropsBeforeLowerIt ! = dropsBeforeLower . end ( ) ) {
const ItemDrop & drop = ItemDrop : : drops [ * dropsBeforeLowerIt ] ;
drop . Draw ( ) ;
+ + dropsBeforeLowerIt ;
}
}
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 ) ;
@ -1331,44 +1321,23 @@ void AiL::RenderWorld(float fElapsedTime){
}
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 ;
while ( monstersAfterLowerIt ! = monstersAfterLower . end ( ) ) {
Monster & m = * * monstersAfterLowerIt ;
if ( m . pos . y < topTileY ) {
m . Draw ( ) ;
+ + monstersAfterLowerIt ;
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 ;
while ( dropsAfterLowerIt ! = dropsAfterLower . end ( ) ) {
const ItemDrop & drop = ItemDrop : : drops [ * dropsAfterLowerIt ] ;
if ( drop . pos . y < topTileY ) {
drop . Draw ( ) ;
+ + dropsAfterLowerIt ;
continue ;
}
break ;
}
# pragma endregion
}
@ -1376,59 +1345,18 @@ void AiL::RenderWorld(float fElapsedTime){
# pragma region Foreground Rendering w / Depth
for ( TileRenderData * tile : tilesWithCollision ) {
# pragma region Depth Ordered Rendering
{
auto it = monstersBeforeLower . begin ( ) ;
while ( it ! = monstersBeforeLower . end ( ) ) {
Monster & m = * * it ;
if ( m . pos . y < tile - > group - > GetCollisionRange ( ) . middle ( ) . y ) {
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 < tile - > group - > GetCollisionRange ( ) . middle ( ) . y ) {
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 < tile - > group - > GetCollisionRange ( ) . middle ( ) . y ) {
e . Draw ( ) ;
it = backgroundEffectsLower . erase ( it ) ;
if ( it = = backgroundEffectsLower . end ( ) ) break ;
continue ;
}
break ;
if ( ! player - > rendered & & ! player - > upperLevel & & player - > GetPos ( ) . y < tile - > group - > GetCollisionRange ( ) . middle ( ) . y ) {
//If we are supposed to render the player, everything else before must be rendered at this point.
while ( monstersBeforeLowerIt ! = monstersBeforeLower . end ( ) ) {
Monster & m = * * monstersBeforeLowerIt ;
m . Draw ( ) ;
+ + monstersBeforeLowerIt ;
}
}
{
auto it = dropsBeforeLower . begin ( ) ;
while ( it ! = dropsBeforeLower . end ( ) ) {
const ItemDrop & drop = ItemDrop : : drops [ * it ] ;
if ( drop . pos . y < tile - > group - > GetCollisionRange ( ) . middle ( ) . y ) {
drop . Draw ( ) ;
it = dropsBeforeLower . erase ( it ) ;
if ( it = = dropsBeforeLower . end ( ) ) break ;
continue ;
}
break ;
while ( dropsBeforeLowerIt ! = dropsBeforeLower . end ( ) ) {
const ItemDrop & drop = ItemDrop : : drops [ * dropsBeforeLowerIt ] ;
drop . Draw ( ) ;
+ + dropsBeforeLowerIt ;
}
}
if ( ! player - > rendered & & ! player - > upperLevel & & player - > GetPos ( ) . y < tile - > group - > GetCollisionRange ( ) . middle ( ) . y ) {
player - > rendered = true ;
if ( player - > GetZ ( ) > 0 ) {
vf2d shadowScale = vf2d { 8 * player - > GetSizeMult ( ) / 3.f , 1 } / std : : max ( 1.f , player - > GetZ ( ) / 24 ) ;
@ -1436,44 +1364,23 @@ void AiL::RenderWorld(float fElapsedTime){
}
RenderPlayer ( player - > GetPos ( ) , { 1 , 1 } ) ;
}
{
auto it = monstersAfterLower . begin ( ) ;
while ( it ! = monstersAfterLower . end ( ) ) {
Monster & m = * * it ;
if ( m . pos . y < tile - > group - > GetCollisionRange ( ) . middle ( ) . y ) {
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 < tile - > group - > GetCollisionRange ( ) . middle ( ) . y ) {
drop . Draw ( ) ;
it = dropsAfterLower . erase ( it ) ;
if ( it = = dropsAfterLower . end ( ) ) break ;
continue ;
}
break ;
while ( monstersAfterLowerIt ! = monstersAfterLower . end ( ) ) {
Monster & m = * * monstersAfterLowerIt ;
if ( m . pos . y < tile - > group - > GetCollisionRange ( ) . middle ( ) . y ) {
m . Draw ( ) ;
+ + monstersAfterLowerIt ;
continue ;
}
break ;
}
{
auto it = foregroundEffectsLower . begin ( ) ;
while ( it ! = foregroundEffectsLower . end ( ) ) {
const Effect & e = * * it ;
if ( e . pos . y < tile - > group - > GetCollisionRange ( ) . middle ( ) . y ) {
e . Draw ( ) ;
it = foregroundEffectsLower . erase ( it ) ;
if ( it = = foregroundEffectsLower . end ( ) ) break ;
continue ;
}
break ;
while ( dropsAfterLowerIt ! = dropsAfterLower . end ( ) ) {
const ItemDrop & drop = ItemDrop : : drops [ * dropsAfterLowerIt ] ;
if ( drop . pos . y < tile - > group - > GetCollisionRange ( ) . middle ( ) . y ) {
drop . Draw ( ) ;
+ + dropsAfterLowerIt ;
continue ;
}
break ;
}
# pragma endregion
RenderTile ( * tile , { 255 , 255 , 255 , uint8_t ( 255 - tile - > tileOpacity / TileGroup : : FADE_TIME * TileGroup : : FADE_AMT ) } ) ;
@ -1503,9 +1410,6 @@ void AiL::RenderWorld(float fElapsedTime){
for ( const Effect * const e : backgroundEffectsLower ) {
e - > Draw ( ) ;
}
for ( const Bullet * const b : bulletsLower ) {
b - > Draw ( ) ;
}
for ( const int dropInd : dropsBeforeLower ) {
ItemDrop : : drops [ dropInd ] . Draw ( ) ;
}
@ -1524,6 +1428,9 @@ void AiL::RenderWorld(float fElapsedTime){
for ( const int dropInd : dropsAfterLower ) {
ItemDrop : : drops [ dropInd ] . Draw ( ) ;
}
for ( const Bullet * const b : bulletsLower ) {
b - > Draw ( ) ;
}
for ( const Effect * const e : foregroundEffectsLower ) {
e - > Draw ( ) ;
}
@ -1643,63 +1550,55 @@ void AiL::RenderWorld(float fElapsedTime){
m . strategyDraw ( this , m , MONSTER_DATA [ m . GetName ( ) ] . GetAIStrategy ( ) ) ;
}
# pragma region Render Background Effects
{
auto it = backgroundEffectsUpper . begin ( ) ;
while ( it ! = backgroundEffectsUpper . end ( ) ) {
const Effect & e = * * it ;
e . Draw ( ) ;
+ + it ;
}
}
# pragma endregion
auto monstersBeforeUpperIt = monstersBeforeUpper . begin ( ) ;
auto monstersAfterUpperIt = monstersAfterUpper . begin ( ) ;
auto dropsBeforeUpperIt = dropsBeforeUpper . begin ( ) ;
auto dropsAfterUpperIt = dropsAfterUpper . begin ( ) ;
# 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 ;
while ( monstersBeforeUpperIt ! = monstersBeforeUpper . end ( ) ) {
Monster & m = * * monstersBeforeUpperIt ;
if ( m . pos . y < topTileY ) {
m . Draw ( ) ;
+ + monstersBeforeUpperIt ;
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 ;
while ( dropsBeforeUpperIt ! = dropsBeforeUpper . end ( ) ) {
const ItemDrop & drop = ItemDrop : : drops [ * dropsBeforeUpperIt ] ;
if ( drop . pos . y < topTileY ) {
drop . Draw ( ) ;
+ + dropsBeforeUpperIt ;
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 ;
if ( ! player - > rendered & & ! player - > upperLevel & & player - > GetPos ( ) . y < topTileY ) {
//If we are supposed to render the player, everything else before must be rendered at this point.
while ( monstersBeforeUpperIt ! = monstersBeforeUpper . end ( ) ) {
Monster & m = * * monstersBeforeUpperIt ;
m . Draw ( ) ;
+ + monstersBeforeUpperIt ;
}
}
{
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 ;
while ( dropsBeforeUpperIt ! = dropsBeforeUpper . end ( ) ) {
const ItemDrop & drop = ItemDrop : : drops [ * dropsBeforeUpperIt ] ;
drop . Draw ( ) ;
+ + dropsBeforeUpperIt ;
}
}
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 ) ;
@ -1707,45 +1606,22 @@ void AiL::RenderWorld(float fElapsedTime){
}
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 ;
while ( monstersAfterUpperIt ! = monstersAfterUpper . end ( ) ) {
Monster & m = * * monstersAfterUpperIt ;
if ( m . pos . y < topTileY ) {
m . Draw ( ) ;
+ + monstersAfterUpperIt ;
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 ;
while ( dropsAfterUpperIt ! = dropsAfterUpper . end ( ) ) {
const ItemDrop & drop = ItemDrop : : drops [ * dropsAfterUpperIt ] ;
if ( drop . pos . y < topTileY ) {
drop . Draw ( ) ;
continue ;
}
break ;
}
# pragma endregion
}
@ -1753,59 +1629,36 @@ void AiL::RenderWorld(float fElapsedTime){
# pragma region Upper Foreground Rendering w / Depth
for ( TileRenderData * tile : tilesWithCollision ) {
# pragma region Depth Ordered Upper Rendering
{
auto it = monstersBeforeUpper . begin ( ) ;
while ( it ! = monstersBeforeUpper . end ( ) ) {
Monster & m = * * it ;
if ( m . pos . y < tile - > group - > GetCollisionRange ( ) . middle ( ) . y ) {
m . Draw ( ) ;
it = monstersBeforeUpper . erase ( it ) ;
if ( it = = monstersBeforeUpper . end ( ) ) break ;
continue ;
}
break ;
while ( monstersBeforeUpperIt ! = monstersBeforeUpper . end ( ) ) {
Monster & m = * * monstersBeforeUpperIt ;
if ( m . pos . y < tile - > group - > GetCollisionRange ( ) . middle ( ) . y ) {
m . Draw ( ) ;
+ + monstersBeforeUpperIt ;
continue ;
}
break ;
}
{
auto it = bulletsUpper . begin ( ) ;
while ( it ! = bulletsUpper . end ( ) ) {
const Bullet & b = * * it ;
if ( b . pos . y < tile - > group - > GetCollisionRange ( ) . middle ( ) . y ) {
b . Draw ( ) ;
it = bulletsUpper . erase ( it ) ;
if ( it = = bulletsUpper . end ( ) ) break ;
continue ;
}
break ;
while ( dropsBeforeUpperIt ! = dropsBeforeUpper . end ( ) ) {
const ItemDrop & drop = ItemDrop : : drops [ * dropsBeforeUpperIt ] ;
if ( drop . pos . y < tile - > group - > GetCollisionRange ( ) . middle ( ) . y ) {
drop . Draw ( ) ;
+ + dropsBeforeUpperIt ;
continue ;
}
break ;
}
{
auto it = backgroundEffectsUpper . begin ( ) ;
while ( it ! = backgroundEffectsUpper . end ( ) ) {
const Effect & e = * * it ;
if ( e . pos . y < tile - > group - > GetCollisionRange ( ) . middle ( ) . y ) {
e . Draw ( ) ;
it = backgroundEffectsUpper . erase ( it ) ;
if ( it = = backgroundEffectsUpper . end ( ) ) break ;
continue ;
}
break ;
if ( ! player - > rendered & & player - > upperLevel & & player - > GetPos ( ) . y < tile - > group - > GetCollisionRange ( ) . middle ( ) . y ) {
//If we are supposed to render the player, everything else before must be rendered at this point.
while ( monstersBeforeUpperIt ! = monstersBeforeUpper . end ( ) ) {
Monster & m = * * monstersBeforeUpperIt ;
m . Draw ( ) ;
+ + monstersBeforeUpperIt ;
}
}
{
auto it = dropsBeforeUpper . begin ( ) ;
while ( it ! = dropsBeforeUpper . end ( ) ) {
const ItemDrop & drop = ItemDrop : : drops [ * it ] ;
if ( drop . pos . y < tile - > group - > GetCollisionRange ( ) . middle ( ) . y ) {
drop . Draw ( ) ;
it = dropsBeforeUpper . erase ( it ) ;
if ( it = = dropsBeforeUpper . end ( ) ) break ;
continue ;
}
break ;
while ( dropsBeforeUpperIt ! = dropsBeforeUpper . end ( ) ) {
const ItemDrop & drop = ItemDrop : : drops [ * dropsBeforeUpperIt ] ;
drop . Draw ( ) ;
+ + dropsBeforeUpperIt ;
}
}
if ( ! player - > rendered & & player - > upperLevel & & player - > GetPos ( ) . y < tile - > group - > GetCollisionRange ( ) . middle ( ) . y ) {
player - > rendered = true ;
if ( player - > GetZ ( ) > 0 ) {
vf2d shadowScale = vf2d { 8 * player - > GetSizeMult ( ) / 3.f , 1 } / std : : max ( 1.f , player - > GetZ ( ) / 24 ) ;
@ -1813,44 +1666,23 @@ void AiL::RenderWorld(float fElapsedTime){
}
RenderPlayer ( player - > GetPos ( ) , { 1 , 1 } ) ;
}
{
auto it = monstersAfterUpper . begin ( ) ;
while ( it ! = monstersAfterUpper . end ( ) ) {
Monster & m = * * it ;
if ( m . pos . y < tile - > group - > GetCollisionRange ( ) . middle ( ) . y ) {
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 < tile - > group - > GetCollisionRange ( ) . middle ( ) . y ) {
drop . Draw ( ) ;
it = dropsAfterUpper . erase ( it ) ;
if ( it = = dropsAfterUpper . end ( ) ) break ;
continue ;
}
break ;
while ( monstersAfterUpperIt ! = monstersAfterUpper . end ( ) ) {
Monster & m = * * monstersAfterUpperIt ;
if ( m . pos . y < tile - > group - > GetCollisionRange ( ) . middle ( ) . y ) {
m . Draw ( ) ;
+ + monstersAfterUpperIt ;
continue ;
}
break ;
}
{
auto it = foregroundEffectsUpper . begin ( ) ;
while ( it ! = foregroundEffectsUpper . end ( ) ) {
const Effect & e = * * it ;
if ( e . pos . y < tile - > group - > GetCollisionRange ( ) . middle ( ) . y ) {
e . Draw ( ) ;
it = foregroundEffectsUpper . erase ( it ) ;
if ( it = = foregroundEffectsUpper . end ( ) ) break ;
continue ;
}
break ;
while ( dropsAfterUpperIt ! = dropsAfterUpper . end ( ) ) {
const ItemDrop & drop = ItemDrop : : drops [ * dropsAfterUpperIt ] ;
if ( drop . pos . y < tile - > group - > GetCollisionRange ( ) . middle ( ) . y ) {
drop . Draw ( ) ;
+ + dropsAfterUpperIt ;
continue ;
}
break ;
}
# pragma endregion
RenderTile ( * tile , { 255 , 255 , 255 , uint8_t ( 255 - tile - > tileOpacity / TileGroup : : FADE_TIME * TileGroup : : FADE_AMT ) } ) ;
@ -1872,9 +1704,6 @@ void AiL::RenderWorld(float fElapsedTime){
for ( const Effect * const e : backgroundEffectsUpper ) {
e - > Draw ( ) ;
}
for ( const Bullet * const b : bulletsUpper ) {
b - > Draw ( ) ;
}
for ( const int dropInd : dropsBeforeUpper ) {
ItemDrop : : drops [ dropInd ] . Draw ( ) ;
}
@ -1893,6 +1722,9 @@ void AiL::RenderWorld(float fElapsedTime){
for ( const int dropInd : dropsAfterUpper ) {
ItemDrop : : drops [ dropInd ] . Draw ( ) ;
}
for ( const Bullet * const b : bulletsUpper ) {
b - > Draw ( ) ;
}
for ( const Effect * const e : foregroundEffectsUpper ) {
e - > Draw ( ) ;
}
@ -2130,6 +1962,8 @@ void AiL::RenderHud(){
}
# endif
hudOverlay . Draw ( ) ;
Pixel vignetteOverlayColor = " Interface.Vignette Color " _Pixel ;
const float vignetteTotalDisplayTime = " Interface.Vignette Appearance Time " _F + " Interface.Vignette Fadeout Time " _F ;
if ( vignetteDisplayTime < " Interface.Vignette Fadeout Time " _F ) vignetteOverlayColor . a = util : : lerp ( 0 , 255 , vignetteDisplayTime / " Interface.Vignette Fadeout Time " _F ) ;
@ -2431,6 +2265,7 @@ void AiL::_PrepareLevel(MapName map,MusicChange changeMusic){
MONSTER_LIST . clear ( ) ;
BULLET_LIST . clear ( ) ;
DAMAGENUMBER_LIST . clear ( ) ;
hudOverlay . Reset ( ) ;
backgroundEffects . clear ( ) ;
foregroundEffects . clear ( ) ;
ItemDrop : : drops . clear ( ) ;
@ -4431,3 +4266,11 @@ void AiL::AMonsterIsMarkedForDeletion(){
void AiL : : SetBossIndicatorPos ( const vf2d pos ) {
bossIndicatorPos = pos ;
}
Overlay & AiL : : GetOverlay ( ) {
return hudOverlay ;
}
void AiL : : SetOverlay ( std : : string animationName , Pixel overlayCol ) {
hudOverlay = Overlay { animationName , overlayCol } ;
}