Takes two points and a plane, and clips.
| 1652 | |
| 1653 | // Takes two points and a plane, and clips. |
| 1654 | void ClipRadEdge(int plane_flag, rad_point *on_pnt, rad_point *off_pnt) { |
| 1655 | if (plane_flag & CC_OFF_TOP) { |
| 1656 | float percent_on = 1.0 - ((off_pnt->pos.y - rad_ClipTop->y) / (off_pnt->pos.y - on_pnt->pos.y)); |
| 1657 | GlobalTempRadPoint.pos = on_pnt->pos + ((off_pnt->pos - on_pnt->pos) * percent_on); |
| 1658 | } |
| 1659 | |
| 1660 | if (plane_flag & CC_OFF_RIGHT) { |
| 1661 | float percent_on = 1.0 - ((off_pnt->pos.x - rad_ClipRight->x) / (off_pnt->pos.x - on_pnt->pos.x)); |
| 1662 | GlobalTempRadPoint.pos = on_pnt->pos + ((off_pnt->pos - on_pnt->pos) * percent_on); |
| 1663 | } |
| 1664 | |
| 1665 | if (plane_flag & CC_OFF_LEFT) { |
| 1666 | float percent_on = 1.0 - ((off_pnt->pos.x - rad_ClipLeft->x) / (off_pnt->pos.x - on_pnt->pos.x)); |
| 1667 | GlobalTempRadPoint.pos = on_pnt->pos + ((off_pnt->pos - on_pnt->pos) * percent_on); |
| 1668 | } |
| 1669 | |
| 1670 | if (plane_flag & CC_OFF_BOT) { |
| 1671 | float percent_on = 1.0 - ((off_pnt->pos.y - rad_ClipBottom->y) / (off_pnt->pos.y - on_pnt->pos.y)); |
| 1672 | GlobalTempRadPoint.pos = on_pnt->pos + ((off_pnt->pos - on_pnt->pos) * percent_on); |
| 1673 | } |
| 1674 | |
| 1675 | CodeRadPoint(&GlobalTempRadPoint); |
| 1676 | } |
| 1677 | |
| 1678 | // Adds color spectrums together |
| 1679 | void AddSpectra(spectra *dest, spectra *a, spectra *b) { |
no test coverage detected