Example #1
0
void CFlarePainter::PaintFlare (CG32bitImage &Dest, int x, int y, int iRadius, CG32bitPixel rgbColor, bool bSpikes, SViewportPaintCtx &Ctx)

//	PaintFlare
//
//	Paints a flare

{
    int i;

    if (iRadius > 0)
    {
        //	Paint each of the spikes first

        if (bSpikes)
        {
            int iAngle = 360 / MAIN_SPIKE_COUNT;
            for (i = 0; i < MAIN_SPIKE_COUNT; i++)
            {
                SPoint Spike[4];
                m_pCreator->CreateFlareSpike(i * iAngle, iRadius, iRadius / MAIN_SPIKE_WIDTH_RATIO, Spike);

                CG16bitBinaryRegion Region;
                Region.CreateFromSimplePolygon(4, Spike);
                Region.Fill(Dest, x, y, CG32bitPixel(rgbColor, MAIN_SPIKE_OPACITY));
            }
        }

        //	Paint the extended glow

        CGDraw::CircleGradient(Dest, x, y, iRadius, rgbColor);
    }
}
Example #2
0
void CAniSolidFill::Fill (SAniPaintCtx &Ctx, int x, int y, const CG16bitBinaryRegion &Region)

//	Fill
//
//	Fills the region

	{
	Region.Fill(Ctx.Dest, x, y, CG32bitPixel(m_rgbColor, (BYTE)m_dwOpacity));
	}
Example #3
0
void CPolyflashPainter::Paint (CG32bitImage &Dest, int x, int y, SViewportPaintCtx &Ctx)

//	Paint
//
//	Paints the flash

	{
	CG16bitBinaryRegion Region;
	SPoint Poly[6];

	//	Create the broad outer flame

	CreateFlame(Ctx.iRotation, 40, Poly);
	Region.CreateFromConvexPolygon(6, Poly);
	Region.Fill(Dest, x, y, CG32bitPixel(0xff, 0x80, 0x40, 0x80));

	//	Create the central bright area

	CreateFlame(Ctx.iRotation, 30, Poly);
	Region.CreateFromConvexPolygon(6, Poly);
	Region.Fill(Dest, x, y, CG32bitPixel(0xff, 0xff, 0xa0));
	}