Improved the draw functions for the graphical explosion warning (TIME_BOMB_WARNING = TRUE):

- underlying terrain can still be seen
- Fix: graphical glich while scrolling

git-svn-id: https://ja2svn.mooo.com/source/ja2/trunk/GameSource/ja2_v1.13/Build@8429 3b4a5df2-a311-0410-b5c6-a8a6f20db521
This commit is contained in:
Flugente
2017-07-25 19:08:10 +00:00
parent 8d3d77ad84
commit 1a87aa3b1f
4 changed files with 143 additions and 37 deletions
+19 -9
View File
@@ -352,22 +352,32 @@ void LineDraw( BOOL fClip, int XStart, int YStart, int XEnd, int YEnd, short Col
//Draws a pixel in the specified color
void PixelDraw( BOOLEAN fClip, INT32 xp, INT32 yp, INT16 sColor, UINT8 *pScreen )
{
INT8 col2 = sColor >> 8;
INT8 col1 = sColor & 0x00ff;
if ( fClip )
{
if ( !ClipPoint( xp, yp ) )
return;
}
if ( fClip && !ClipPoint( xp, yp ) )
return;
// point to the bitmap address first pixel to draw
pScreen += yp * giImageWidth + xp * 2;
INT8 col2 = sColor >> 8;
INT8 col1 = sColor & 0x00ff;
pScreen[ 0 ] = col1;
pScreen[ 1 ] = col2;
}
// Flugente: alter the colour of existing pixels instead of fully replacing the colour
void PixelAlterColour(BOOLEAN fClip, INT32 xp, INT32 yp, UINT8 col1, UINT8 col2, UINT8 *pScreen)
{
if ( fClip && !ClipPoint( xp, yp ) )
return;
// point to the bitmap address first pixel to draw
pScreen += yp * giImageWidth + xp * 2;
pScreen[0] |= col1;
pScreen[1] |= col2;
}
/* Draws a horizontal run of pixels, then advances the bitmap pointer to
the first pixel of the next run. */
void DrawHorizontalRun(UINT8 **ScreenPtr, int XAdvance,