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

Function vesa_HideCursor

sys/msdos/vidvesa.c:2270–2316  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2268}
2269
2270void
2271vesa_HideCursor(void)
2272{
2273 unsigned x, y, left, top, width, height;
2274 boolean isrogue = Is_rogue_level(&u.uz);
2275 boolean halfwidth =
2276 (isrogue || iflags.over_view || iflags.traditional_view || !inmap);
2277
2278 if (!cursor_type && inmap)
2279 return; /* CURSOR_INVIS - nothing to do */
2280 if (undercursor == NULL)
2281 return;
2282
2283 x = min(curcol, (CO - 1)); /* protection from callers */
2284 y = min(currow, (LI - 1)); /* protection from callers */
2285 if (!halfwidth
2286 && ((x < (unsigned) clipx) || (x > (unsigned) clipxmax)
2287 || (y < (unsigned) clipy)
2288 || (y > (unsigned) clipymax)))
2289 return;
2290 if (inmap) {
2291 x -= clipx;
2292 y -= clipy;
2293 }
2294 /* convert to pixels */
2295 if (!inmap || iflags.traditional_view) {
2296 width = vesa_char_width;
2297 height = vesa_char_height;
2298 } else if (iflags.over_view) {
2299 width = vesa_oview_width;
2300 height = vesa_oview_height;
2301 } else {
2302 width = iflags.wc_tile_width;
2303 height = iflags.wc_tile_height;
2304 }
2305 left = x * width + vesa_x_center;
2306 top = y * height + vesa_y_center;
2307 if (y >= TOP_MAP_ROW) {
2308 top -= (height - vesa_char_height) * TOP_MAP_ROW;
2309 }
2310
2311 for (y = 0; y < height; ++y) {
2312 for (x = 0; x < width; ++x) {
2313 vesa_WritePixel32(left + x, top + y, undercursor[y * width + x]);
2314 }
2315 }
2316}
2317#endif /* SIMULATE_CURSOR */
2318#endif /* SCREEN_VESA */

Callers 1

HideCursorFunction · 0.85

Calls 1

vesa_WritePixel32Function · 0.85

Tested by

no test coverage detected