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

Function mar_gem_init

outdated/win/gem/wingem1.c:1038–1218  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1036extern int total_tiles_used; /* tile.c */
1037
1038int
1039mar_gem_init()
1040{
1041 int i, bild_fehler = FALSE, fsize;
1042 char *fname;
1043 static MITEM wish_workaround = { FAIL, key(0, 'J'), K_CTRL, W_CYCLE,
1044 FAIL };
1045 OBJECT *z_ob;
1046
1047 if ((i = open_rsc("gem_rsc.rsc", NULL, md, md, md, 0, 0, 0)) <= 0) {
1048 graf_mouse(M_OFF, NULL);
1049 if (i < 0)
1050 form_alert(1, "[3][| Fatal Error | File: GEM_RSC.RSC | not "
1051 "found. ][ grumble ]");
1052 else
1053 form_alert(1, "[3][| Fatal Error | GEM initialisation | failed. "
1054 "][ a pity ]");
1055 return (0);
1056 }
1057 if (planes < 1 || planes > 8) {
1058 form_alert(
1059 1,
1060 "[3][ Color-depth | not supported, | try 2-256 colors. ][ Ok ]");
1061 return (0);
1062 }
1063 MouseBee();
1064
1065 /* MAR -- 17.Mar 2002 NVDI 3.0 or better uses v_ftext */
1066 v_mtext = speedo == 3 ? &v_ftext : &v_gtext;
1067 for (i = 0; i < NHICON; i++)
1068 mar_get_rsc_tree(i, &zz_oblist[i]);
1069
1070 z_ob = zz_oblist[ABOUT];
1071 ob_hide(z_ob, OKABOUT, TRUE);
1072 ob_draw_dialog(z_ob, 0, 0, 0, 0);
1073
1074 mar_get_font(NHW_MESSAGE, &fname, &fsize);
1075 mar_set_font(NHW_MESSAGE, fname, fsize);
1076 mar_get_font(NHW_MAP, &fname, &fsize);
1077 mar_set_font(NHW_MAP, fname, fsize);
1078 mar_get_font(NHW_STATUS, &fname, &fsize);
1079 mar_set_font(NHW_STATUS, fname, fsize);
1080 mar_get_font(NHW_MENU, &fname, &fsize);
1081 mar_set_font(NHW_MENU, fname, fsize);
1082 mar_get_font(NHW_TEXT, &fname, &fsize);
1083 mar_set_font(NHW_TEXT, fname, fsize);
1084 msg_anz = mar_get_msg_history();
1085 mar_set_msg_visible(mar_get_msg_visible());
1086 msg_width = min(max_w / msg_font.cw - 3, MSGLEN);
1087
1088 if (max_w / status_font.cw < COLNO - 1)
1089 mar_set_fontbyid(NHW_STATUS, small_font_id, -small_font);
1090 status_w = min(max_w / status_font.cw - 3, MSGLEN);
1091
1092 if (planes > 0 && planes < 9) {
1093 normal_palette = (short *) m_alloc(3 * colors * sizeof(short));
1094 get_colors(x_handle, normal_palette, colors);
1095 }

Callers 1

Gem_init_nhwindowsFunction · 0.85

Calls 15

mar_get_rsc_treeFunction · 0.85
mar_get_fontFunction · 0.85
mar_set_fontFunction · 0.85
mar_get_msg_historyFunction · 0.85
mar_set_msg_visibleFunction · 0.85
mar_get_msg_visibleFunction · 0.85
mar_set_fontbyidFunction · 0.85
m_allocFunction · 0.85
get_colorsFunction · 0.85
depack_imgFunction · 0.85
img_errorFunction · 0.85
printfFunction · 0.85

Tested by

no test coverage detected