Closed attuska closed 6 years ago
I bet that’s after
--- a/src/Mediator.cpp
+++ b/src/Mediator.cpp
@@ -291,7 +291,6 @@ void Mediator::reshadeWithGridItem( GridItem* item )
// shade floor in this column, if any
if ( room->floor[ column ] != nilPointer )
{
- room->floor[ column ]->binShadyImage();
room->floor[ column ]->setWantShadow( true );
}
}
@@ -328,7 +327,6 @@ void Mediator::reshadeWithFreeItem( FreeItem* item )
// shade floor in this column, if any
if ( room->floor[ column ] != nilPointer )
{
- room->floor[ column ]->binShadyImage();
room->floor[ column ]->setWantShadow( true );
}
}
meet freshShadyImage
+void FloorTile::freshShadyImage ()
+{
+ if ( shadyImage != nilPointer )
+ {
+ allegro::destroyBitmap( shadyImage );
+
+ BITMAP* shady = create_bitmap_ex( 32, rawImage->w, rawImage->h );
+ clear_to_color( shady, Color::colorOfTransparency()->toAllegroColor() );
+ blit( rawImage, shady, 0, 0, 0, 0, rawImage->w, rawImage->h );
+ shadyImage = shady;
+ }
+}
I bet that’s after
It's been already applied in https://github.com/dougmencken/HeadOverHeels/commit/6e5e5e2c30afa8c78d0bc1bc1cc96e3e145ad3c0
I replaced binShadyImage
with freshShadyImage
which doesn’t just bin it, but makes shadyImage the exact copy of raw non~shaded image of tile
@@ -291,7 +291,7 @@ void Mediator::reshadeWithGridItem( GridItem* item )
// shade floor in this column, if any
if ( room->floor[ column ] != nilPointer )
{
- room->floor[ column ]->binShadyImage();
+ room->floor[ column ]->freshShadyImage();
room->floor[ column ]->setWantShadow( true );
}
}
@@ -328,7 +328,7 @@ void Mediator::reshadeWithFreeItem( FreeItem* item )
// shade floor in this column, if any
if ( room->floor[ column ] != nilPointer )
{
- room->floor[ column ]->binShadyImage();
+ room->floor[ column ]->freshShadyImage ();
room->floor[ column ]->setWantShadow( true );
}
}
It's good, you can close issue.