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

Function genl_status_update

src/windows.c:933–1115  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

931}
932
933DISABLE_WARNING_FORMAT_NONLITERAL
934
935/* call once for each field, then call with BL_FLUSH to output the result */
936void
937genl_status_update(
938 int idx,
939 genericptr_t ptr,
940 int chg UNUSED, int percent UNUSED,
941 int color UNUSED, unsigned long *colormasks UNUSED)
942{
943 char newbot1[MAXCO], newbot2[MAXCO];
944 long cond, *condptr = (long *) ptr;
945 int i;
946 unsigned pass, lndelta;
947 enum statusfields idx1, idx2, *fieldlist;
948 char *nb, *text = (char *) ptr;
949
950 static enum statusfields fieldorder[][15] = {
951 /* line one */
952 { BL_TITLE, BL_STR, BL_DX, BL_CO, BL_IN, BL_WI, BL_CH, BL_ALIGN,
953 BL_SCORE, BL_FLUSH, BL_FLUSH, BL_FLUSH, BL_FLUSH, BL_FLUSH,
954 BL_FLUSH },
955 /* line two, default order */
956 { BL_LEVELDESC, BL_GOLD,
957 BL_HP, BL_HPMAX, BL_ENE, BL_ENEMAX, BL_AC,
958 BL_XP, BL_EXP, BL_HD,
959 BL_TIME,
960 BL_HUNGER, BL_CAP, BL_CONDITION,
961 BL_FLUSH },
962 /* move time to the end */
963 { BL_LEVELDESC, BL_GOLD,
964 BL_HP, BL_HPMAX, BL_ENE, BL_ENEMAX, BL_AC,
965 BL_XP, BL_EXP, BL_HD,
966 BL_HUNGER, BL_CAP, BL_CONDITION,
967 BL_TIME, BL_FLUSH },
968 /* move experience and time to the end */
969 { BL_LEVELDESC, BL_GOLD,
970 BL_HP, BL_HPMAX, BL_ENE, BL_ENEMAX, BL_AC,
971 BL_HUNGER, BL_CAP, BL_CONDITION,
972 BL_XP, BL_EXP, BL_HD, BL_TIME, BL_FLUSH },
973 /* move level description plus gold and experience and time to end */
974 { BL_HP, BL_HPMAX, BL_ENE, BL_ENEMAX, BL_AC,
975 BL_HUNGER, BL_CAP, BL_CONDITION,
976 BL_LEVELDESC, BL_GOLD, BL_XP, BL_EXP, BL_HD, BL_TIME, BL_FLUSH },
977 };
978
979 /* in case interface is using genl_status_update() but has not
980 specified WC2_FLUSH_STATUS (status_update() for field values
981 is buffered so final BL_FLUSH is needed to produce output) */
982 windowprocs.wincap2 |= WC2_FLUSH_STATUS;
983
984 if (idx >= 0) {
985 if (!status_activefields[idx])
986 return;
987 switch (idx) {
988 case BL_CONDITION:
989 cond = condptr ? *condptr : 0L;
990 nb = status_vals[idx];

Callers

nothing calls this directly

Calls 2

eosFunction · 0.85
mungspacesFunction · 0.85

Tested by

no test coverage detected