* Applies right clipping to a line. * @param x1 Pointer to the X-coordinate of the begin of the line. * @param y1 Pointer to the Y-coordinate of the begin of the line. * @param x2 The X-coordinate of the end of the line. * @param y2 The Y-coordinate of the end of the line. */
| 2467 | * @param y2 The Y-coordinate of the end of the line. |
| 2468 | */ |
| 2469 | static void ClipRight(int16 *x1, int16 *y1, int16 x2, int16 y2) |
| 2470 | { |
| 2471 | *y1 += (y2 - *y1) * (*x1 - g_clipping.right) / (*x1 - x2); |
| 2472 | *x1 = g_clipping.right; |
| 2473 | } |
| 2474 | |
| 2475 | /** |
| 2476 | * Draws a line from (x1, y1) to (x2, y2) using given colour. |