---------------------------------------------------------------------------------
| 181 | |
| 182 | //--------------------------------------------------------------------------------- |
| 183 | static inline void consolePosition(int x, int y) { |
| 184 | //--------------------------------------------------------------------------------- |
| 185 | // invalid position |
| 186 | if(x < 0 || y < 0) |
| 187 | return; |
| 188 | |
| 189 | // 1-based, but we'll take a 0 |
| 190 | if(x < 1) |
| 191 | x = 1; |
| 192 | if(y < 1) |
| 193 | y = 1; |
| 194 | |
| 195 | // clip to console edge |
| 196 | if(x > currentConsole->windowWidth) |
| 197 | x = currentConsole->windowWidth; |
| 198 | if(y > currentConsole->windowHeight) |
| 199 | y = currentConsole->windowHeight; |
| 200 | |
| 201 | currentConsole->cursorX = x; |
| 202 | currentConsole->cursorY = y; |
| 203 | } |
| 204 | |
| 205 | #define _ANSI_MAXARGS 16 |
| 206 |