Diminish sprites

This commit is contained in:
Miloslav Číž 2019-10-06 17:12:12 +02:00
parent 569882ea29
commit 87b079630f
2 changed files with 16 additions and 3 deletions

12
main.c
View File

@ -399,7 +399,8 @@ void SFG_drawScaledImage(
const uint8_t *image, const uint8_t *image,
int16_t centerX, int16_t centerX,
int16_t centerY, int16_t centerY,
int16_t size) int16_t size,
uint8_t minusValue)
{ {
if ((size > SFG_MAX_SPRITE_SIZE) || (size == 0)) if ((size > SFG_MAX_SPRITE_SIZE) || (size == 0))
return; return;
@ -482,7 +483,13 @@ void SFG_drawScaledImage(
SFG_spriteSamplingPoints[v]); SFG_spriteSamplingPoints[v]);
if (color != SFG_TRANSPARENT_COLOR) if (color != SFG_TRANSPARENT_COLOR)
{
#if SFG_DIMINISH_SPRITES
color = palette_minusValue(color,minusValue);
#endif
SFG_setGamePixel(x,y,color); SFG_setGamePixel(x,y,color);
}
} }
} }
@ -879,7 +886,8 @@ void SFG_draw()
SFG_player.camera); SFG_player.camera);
SFG_drawScaledImage(SFG_sprites[0],p.position.x,p.position.y, SFG_drawScaledImage(SFG_sprites[0],p.position.x,p.position.y,
RCL_perspectiveScale(256,p.depth)); RCL_perspectiveScale(SFG_GAME_RESOLUTION_Y / 2,p.depth),
p.depth / (RCL_UNITS_PER_SQUARE * 2));
} }
} }

View File

@ -89,7 +89,12 @@
Enables or disables fog (darkness) due to distance. Recommended to keep on Enables or disables fog (darkness) due to distance. Recommended to keep on
for good look, but can be turned off for performance. for good look, but can be turned off for performance.
*/ */
#define SFG_ENABLE_FOG 1 #define SFG_ENABLE_FOG 1
/**
Says whether sprites should diminish in fog. This takes more performance but
looks better.
*/
#define SFG_DIMINISH_SPRITES 1
#endif // guard #endif // guard