void CBeam::OnPaint (CG16bitImage &Dest, int x, int y, SViewportPaintCtx &Ctx) // OnPaint // // Paint the beam { // Setup structure SBeamDrawCtx BeamCtx; BeamCtx.xFrom = x + m_xFromOffset; BeamCtx.yFrom = y + m_yFromOffset; if (m_pHit) Ctx.XForm.Transform(m_vPaintTo, &BeamCtx.xTo, &BeamCtx.yTo); else { BeamCtx.xTo = x + m_xToOffset; BeamCtx.yTo = y + m_yToOffset; } BeamCtx.iIntensity = m_pDesc->GetIntensity(); BeamCtx.wBackgroundColor = Ctx.wSpaceColor; BeamCtx.wPrimaryColor = m_pDesc->GetPrimaryColor(); BeamCtx.wSecondaryColor = m_pDesc->GetSecondaryColor(); // Paint a line switch (m_pDesc->GetBeamType()) { case beamLaser: DrawLaserBeam(Dest, BeamCtx); break; } // Draw the head of the beam if we have an image if (!m_pDesc->m_Image.IsEmpty()) { m_pDesc->m_Image.PaintImage(Dest, BeamCtx.xTo, BeamCtx.yTo, m_iTick, 0); } }
void CBeam::OnPaint (CG32bitImage &Dest, int x, int y, SViewportPaintCtx &Ctx) // OnPaint // // Paint the beam { // Setup structure SBeamDrawCtx BeamCtx; BeamCtx.xFrom = x + m_xFromOffset; BeamCtx.yFrom = y + m_yFromOffset; if (m_pHit) Ctx.XForm.Transform(m_vPaintTo, &BeamCtx.xTo, &BeamCtx.yTo); else { BeamCtx.xTo = x + m_xToOffset; BeamCtx.yTo = y + m_yToOffset; } BeamCtx.iIntensity = 1; BeamCtx.rgbBackgroundColor = CG32bitPixel::Null(); BeamCtx.rgbPrimaryColor = CG32bitPixel(0xf1, 0x5f, 0x2a); BeamCtx.rgbSecondaryColor = CG32bitPixel(0xff, 0x00, 0x00); // Paint a line DrawLaserBeam(Dest, BeamCtx); // Draw the head of the beam if we have an image if (m_pDesc->m_Image.IsLoaded()) { m_pDesc->m_Image.PaintImage(Dest, BeamCtx.xTo, BeamCtx.yTo, m_iTick, 0); } }