| 1862 | } |
| 1863 | |
| 1864 | void |
| 1865 | cursor_on(winid window) |
| 1866 | { |
| 1867 | int x, y; |
| 1868 | struct amii_WinDesc *cw; |
| 1869 | struct Window *w; |
| 1870 | struct RastPort *rp; |
| 1871 | unsigned char ch; |
| 1872 | long dmode; |
| 1873 | short apen, bpen; |
| 1874 | |
| 1875 | if (window == WIN_ERR || (cw = amii_wins[window]) == NULL) { |
| 1876 | /* tty does this differently - is this OK? */ |
| 1877 | iflags.window_inited = 0; |
| 1878 | panic(winpanicstr, window, "cursor_on"); |
| 1879 | } |
| 1880 | |
| 1881 | /*printf("CURSOR ON: %d %d\n",cw->win->RPort->cp_x, |
| 1882 | * cw->win->RPort->cp_y);*/ |
| 1883 | if ((cw->wflags & FLMAP_CURSUP)) |
| 1884 | cursor_off(window); |
| 1885 | |
| 1886 | w = cw->win; |
| 1887 | |
| 1888 | if (!w) |
| 1889 | return; |
| 1890 | |
| 1891 | cw->wflags |= FLMAP_CURSUP; |
| 1892 | rp = w->RPort; |
| 1893 | |
| 1894 | /* Save the current information */ |
| 1895 | |
| 1896 | #ifdef DISPMAP |
| 1897 | if (WINVERS_AMIV && cw->type == NHW_MAP && !Is_rogue_level(&u.uz)) |
| 1898 | x = cw->cursx = (rp->cp_x & -8) + 8; |
| 1899 | else |
| 1900 | #endif |
| 1901 | x = cw->cursx = rp->cp_x; |
| 1902 | y = cw->cursy = rp->cp_y; |
| 1903 | apen = rp->FgPen; |
| 1904 | bpen = rp->BgPen; |
| 1905 | dmode = rp->DrawMode; |
| 1906 | |
| 1907 | /* Draw in complement mode. The cursor body will be C_WHITE */ |
| 1908 | |
| 1909 | cw->curs_apen = 0xff; /* Last color/all planes, regardless of depth */ |
| 1910 | cw->curs_bpen = 0xff; |
| 1911 | SetAPen(rp, cw->curs_apen); |
| 1912 | SetBPen(rp, cw->curs_bpen); |
| 1913 | SetDrMd(rp, COMPLEMENT); |
| 1914 | if (WINVERS_AMIV && cw->type == NHW_MAP) { |
| 1915 | cursor_common(rp, x, y); |
| 1916 | } else { |
| 1917 | if (w && x >= 0 && y >= 0 |
| 1918 | && x < w->Width && y < w->Height) { |
| 1919 | Move(rp, x, y); |
| 1920 | ch = CURSOR_CHAR; |
| 1921 | Text(rp, &ch, 1); |
no test coverage detected