MCPcopy Create free account
hub / github.com/NetHack/NetHack / tty_cliparound

Function tty_cliparound

win/tty/wintty.c:3817–3842  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3815}
3816
3817void
3818tty_cliparound(int x, int y)
3819{
3820 int oldx = clipx, oldy = clipy;
3821
3822 HUPSKIP();
3823 if (!clipping)
3824 return;
3825 if (x < clipx + 5) {
3826 clipx = max(0, x - 20);
3827 clipxmax = clipx + CO;
3828 } else if (x > clipxmax - 5) {
3829 clipxmax = min(COLNO, clipxmax + 20);
3830 clipx = clipxmax - CO;
3831 }
3832 if (y < clipy + 2) {
3833 clipy = max(0, y - (clipymax - clipy) / 2);
3834 clipymax = clipy + (LI - 1 - iflags.wc2_statuslines);
3835 } else if (y > clipymax - 2) {
3836 clipymax = min(ROWNO, clipymax + (clipymax - clipy) / 2);
3837 clipy = clipymax - (LI - 1 - iflags.wc2_statuslines);
3838 }
3839 if (clipx != oldx || clipy != oldy) {
3840 redraw_map(TRUE); /* ask the core to resend the map window's data */
3841 }
3842}
3843#endif /* CLIPPING */
3844
3845/*

Callers 1

newclippingFunction · 0.85

Calls 1

redraw_mapFunction · 0.85

Tested by

no test coverage detected