| 98 | } |
| 99 | |
| 100 | static SDL_Cursor* |
| 101 | init_system_cursor(const char *image[]) |
| 102 | { |
| 103 | int i, row, col; |
| 104 | Uint8 data[4*32]; |
| 105 | Uint8 mask[4*32]; |
| 106 | int hot_x, hot_y; |
| 107 | |
| 108 | i = -1; |
| 109 | for (row=0; row<32; ++row) { |
| 110 | for (col=0; col<32; ++col) { |
| 111 | if (col % 8) { |
| 112 | data[i] <<= 1; |
| 113 | mask[i] <<= 1; |
| 114 | } else { |
| 115 | ++i; |
| 116 | data[i] = mask[i] = 0; |
| 117 | } |
| 118 | switch (image[4+row][col]) { |
| 119 | case 'X': |
| 120 | data[i] |= 0x01; |
| 121 | mask[i] |= 0x01; |
| 122 | break; |
| 123 | case '.': |
| 124 | mask[i] |= 0x01; |
| 125 | break; |
| 126 | case ' ': |
| 127 | break; |
| 128 | } |
| 129 | } |
| 130 | } |
| 131 | sscanf(image[4+row], "%d,%d", &hot_x, &hot_y); |
| 132 | return SDL_CreateCursor(data, mask, 32, 32, hot_x, hot_y); |
| 133 | } |
| 134 | |
| 135 | static SDLTest_CommonState *state; |
| 136 | int done; |
no test coverage detected