@ -200,29 +200,24 @@ void Creature::drawOutfit(const Rect& destRect, bool resize)
else
else
exactSize = g_things . rawGetThingType ( m_outfit . getAuxId ( ) , m_outfit . getCategory ( ) ) - > getExactSize ( ) ;
exactSize = g_things . rawGetThingType ( m_outfit . getAuxId ( ) , m_outfit . getCategory ( ) ) - > getExactSize ( ) ;
int frameSize ;
if ( ! resize )
frameSize = std : : max < int > ( exactSize * 0.75f , 2 * Otc : : TILE_PIXELS * 0.75f ) ;
else if ( ! ( frameSize = exactSize ) )
return ;
if ( g_graphics . canUseFBO ( ) ) {
if ( g_graphics . canUseFBO ( ) ) {
const FrameBufferPtr & outfitBuffer = g_framebuffers . getTemporaryFrameBuffer ( ) ;
const FrameBufferPtr & outfitBuffer = g_framebuffers . getTemporaryFrameBuffer ( ) ;
outfitBuffer - > resize ( Size ( exactSize , exactSize ) ) ;
outfitBuffer - > resize ( Size ( frameSize, frame Size) ) ;
outfitBuffer - > bind ( ) ;
outfitBuffer - > bind ( ) ;
g_painter - > setAlphaWriting ( true ) ;
g_painter - > setAlphaWriting ( true ) ;
g_painter - > clear ( Color : : alpha ) ;
g_painter - > clear ( Color : : alpha ) ;
internalDrawOutfit ( Point ( exactSize - Otc : : TILE_PIXELS , exact Size - Otc : : TILE_PIXELS ) + getDisplacement ( ) , 1 , false , true , Otc : : South ) ;
internalDrawOutfit ( Point ( frameSize - Otc : : TILE_PIXELS , frame Size - Otc : : TILE_PIXELS ) + getDisplacement ( ) , 1 , false , true , Otc : : South ) ;
outfitBuffer - > release ( ) ;
outfitBuffer - > release ( ) ;
outfitBuffer - > draw ( destRect , Rect ( 0 , 0 , frameSize , frameSize ) ) ;
Rect srcRect ;
if ( resize )
srcRect . resize ( exactSize , exactSize ) ;
else
srcRect . resize ( exactSize * 0.75f , exactSize * 0.75f ) ;
srcRect . moveBottomRight ( Point ( exactSize - 1 , exactSize - 1 ) ) ;
outfitBuffer - > draw ( destRect , srcRect ) ;
} else {
} else {
float scaleFactor ;
float scaleFactor = destRect . width ( ) / ( float ) frameSize ;
if ( resize )
Point dest = destRect . bottomRight ( ) - ( Point ( Otc : : TILE_PIXELS , Otc : : TILE_PIXELS ) - getDisplacement ( ) ) * scaleFactor ;
scaleFactor = destRect . width ( ) / ( float ) exactSize ;
else
scaleFactor = destRect . width ( ) / ( float ) ( exactSize * 0.75f ) ;
Point dest = destRect . bottomRight ( ) - ( Point ( exactSize - Otc : : TILE_PIXELS , exactSize - Otc : : TILE_PIXELS ) - getDisplacement ( ) ) * scaleFactor ;
internalDrawOutfit ( dest , scaleFactor , false , true , Otc : : South ) ;
internalDrawOutfit ( dest , scaleFactor , false , true , Otc : : South ) ;
}
}
}
}