* Draws a pointer-shaped cursor graphic. */
| 82 | * Draws a pointer-shaped cursor graphic. |
| 83 | */ |
| 84 | void Cursor::draw() |
| 85 | { |
| 86 | Surface::draw(); |
| 87 | Uint8 color = _color; |
| 88 | int x1 = 0, y1 = 0, x2 = getWidth() - 1, y2 = getHeight() - 1; |
| 89 | |
| 90 | lock(); |
| 91 | for (int i = 0; i < 4; ++i) |
| 92 | { |
| 93 | drawLine(x1, y1, x1, y2, color); |
| 94 | drawLine(x1, y1, x2, getWidth() - 1, color); |
| 95 | x1++; |
| 96 | y1 += 2; |
| 97 | y2--; |
| 98 | x2--; |
| 99 | color++; |
| 100 | } |
| 101 | this->setPixel(4, 8, --color); |
| 102 | unlock(); |
| 103 | } |
| 104 | |
| 105 | } |