MCPcopy Create free account
hub / github.com/crawl/crawl / cgotoxy

Function cgotoxy

crawl-ref/source/libutil.cc:411–434  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

409static GotoRegion _current_region = GOTO_CRT;
410
411void 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
436GotoRegion get_cursor_region()
437{

Callers

nothing calls this directly

Calls 8

valid_cursor_posFunction · 0.85
cgetsizeFunction · 0.85
dprfFunction · 0.85
save_gameFunction · 0.85
_cgettopleftFunction · 0.85
dieFunction · 0.70
gotoxy_sysFunction · 0.70
cgotoxyMethod · 0.45

Tested by

no test coverage detected