| 1803 | } |
| 1804 | |
| 1805 | void |
| 1806 | cursor_off(winid window) |
| 1807 | { |
| 1808 | struct amii_WinDesc *cw; |
| 1809 | struct Window *w; |
| 1810 | struct RastPort *rp; |
| 1811 | int curx, cury; |
| 1812 | int x, y; |
| 1813 | long dmode; |
| 1814 | short apen, bpen; |
| 1815 | unsigned char ch; |
| 1816 | |
| 1817 | if (window == WIN_ERR || (cw = amii_wins[window]) == NULL) { |
| 1818 | iflags.window_inited = 0; |
| 1819 | panic(winpanicstr, window, "cursor_off"); |
| 1820 | } |
| 1821 | |
| 1822 | if (!(cw->wflags & FLMAP_CURSUP)) |
| 1823 | return; |
| 1824 | |
| 1825 | w = cw->win; |
| 1826 | |
| 1827 | if (!w) |
| 1828 | return; |
| 1829 | |
| 1830 | cw->wflags &= ~FLMAP_CURSUP; |
| 1831 | rp = w->RPort; |
| 1832 | |
| 1833 | /* Save the current information */ |
| 1834 | curx = rp->cp_x; |
| 1835 | cury = rp->cp_y; |
| 1836 | x = cw->cursx; |
| 1837 | y = cw->cursy; |
| 1838 | dmode = rp->DrawMode; |
| 1839 | apen = rp->FgPen; |
| 1840 | bpen = rp->BgPen; |
| 1841 | SetAPen(rp, cw->curs_apen); |
| 1842 | SetBPen(rp, cw->curs_bpen); |
| 1843 | SetDrMd(rp, COMPLEMENT); |
| 1844 | /*printf("CURSOR OFF: %d %d\n",x,y);*/ |
| 1845 | |
| 1846 | if (WINVERS_AMIV && cw->type == NHW_MAP) { |
| 1847 | cursor_common(rp, x, y); |
| 1848 | if (Is_rogue_level(&u.uz)) |
| 1849 | Move(rp, curx, cury); |
| 1850 | } else { |
| 1851 | ch = CURSOR_CHAR; |
| 1852 | Move(rp, x, y); |
| 1853 | Text(rp, &ch, 1); |
| 1854 | |
| 1855 | /* Put back the other stuff */ |
| 1856 | |
| 1857 | Move(rp, curx, cury); |
| 1858 | } |
| 1859 | SetDrMd(rp, dmode); |
| 1860 | SetAPen(rp, apen); |
| 1861 | SetBPen(rp, bpen); |
| 1862 | } |
no test coverage detected