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

Function mar_set_tile_mode

outdated/win/gem/wingem1.c:2853–2885  ·  view source on GitHub ↗
(tiles)

Source from the content-addressed store, hash-verified

2851int mar_set_rogue(int);
2852
2853int
2854mar_set_tile_mode(tiles)
2855int tiles;
2856{
2857 static int tile_mode = TRUE;
2858 static GRECT prev;
2859 WIN *z_w = WIN_MAP != WIN_ERR ? Gem_nhwindow[WIN_MAP].gw_window : NULL;
2860
2861 if (tiles < 0)
2862 return (tile_mode);
2863 else if (!z_w)
2864 tile_mode = tiles;
2865 else if (tile_mode == tiles || (mar_set_rogue(FAIL) && tiles))
2866 return (FAIL);
2867 else {
2868 GRECT tmp;
2869
2870 tile_mode = tiles;
2871 scroll_map.px_hline = tiles ? Tile_width : map_font.cw;
2872 scroll_map.px_vline = tiles ? Tile_heigth : map_font.ch;
2873 window_border(MAP_GADGETS, 0, 0, scroll_map.px_hline * (COLNO - 1),
2874 scroll_map.px_vline * ROWNO, &tmp);
2875 z_w->max.g_w = tmp.g_w;
2876 z_w->max.g_h = tmp.g_h;
2877 if (tiles)
2878 z_w->curr = prev;
2879 else
2880 prev = z_w->curr;
2881
2882 window_reinit(z_w, md, md, NULL, FALSE, FALSE);
2883 }
2884 return (FAIL);
2885}
2886
2887int
2888mar_set_rogue(what)

Callers 8

Gem_init_nhwindowsFunction · 0.85
Gem_print_glyphFunction · 0.85
Gem_preference_updateFunction · 0.85
rearrange_windowsFunction · 0.85
win_draw_mapFunction · 0.85
mar_gem_initFunction · 0.85
mar_nh_poskeyFunction · 0.85
mar_set_rogueFunction · 0.85

Calls 1

mar_set_rogueFunction · 0.85

Tested by

no test coverage detected