| 409 | static GotoRegion _current_region = GOTO_CRT; |
| 410 | |
| 411 | void cgotoxy(int x, int y, GotoRegion region) |
| 412 | { |
| 413 | #if defined(ASSERTS) |
| 414 | if (!valid_cursor_pos(x, y, region)) |
| 415 | { |
| 416 | const coord_def sz = cgetsize(region); |
| 417 | // dprf in case it's not safe |
| 418 | dprf("screen write out of bounds in region %d (old: %d): (%d,%d) into (%d,%d)", |
| 419 | (int) region, (int) _current_region, x, y, sz.x, sz.y); |
| 420 | if (you.on_current_level) |
| 421 | save_game(false); // should be safe (lol) |
| 422 | die( "screen write out of bounds in region %d (old: %d): (%d,%d) into (%d,%d)", |
| 423 | (int) region, (int) _current_region, x, y, sz.x, sz.y); |
| 424 | } |
| 425 | #endif |
| 426 | |
| 427 | const coord_def tl = _cgettopleft(region); |
| 428 | _current_region = region; |
| 429 | gotoxy_sys(tl.x + x - 1, tl.y + y - 1); |
| 430 | |
| 431 | #ifdef USE_TILE_WEB |
| 432 | tiles.cgotoxy(x, y, region); |
| 433 | #endif |
| 434 | } |
| 435 | |
| 436 | GotoRegion get_cursor_region() |
| 437 | { |
nothing calls this directly
no test coverage detected