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

Function DisplayData

sys/amiga/winamenu.c:1239–1419  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1237}
1238
1239void
1240DisplayData(winid win, int start)
1241{
1242 int txwd;
1243 amii_menu_item *mip;
1244 char *t;
1245 struct amii_WinDesc *cw;
1246 struct Window *w;
1247 struct RastPort *rp;
1248 int i, disprow, len, wheight;
1249 int whichcolor = -1;
1250 int col;
1251
1252 if (win == WIN_ERR || !(cw = amii_wins[win]) || !(w = cw->win)) {
1253 panic(winpanicstr, win, "No Window in DisplayData");
1254 }
1255
1256 rp = w->RPort;
1257 SetDrMd(rp, JAM2);
1258 if (WINVERS_AMIV && win == WIN_INVEN) {
1259 wheight = (w->Height - w->BorderTop - w->BorderBottom - 2)
1260 / max(rp->TxHeight, pictdata.ysize + 3);
1261 } else {
1262 wheight =
1263 (w->Height - w->BorderTop - w->BorderBottom - 2) / rp->TxHeight;
1264 }
1265
1266 cw->rows = wheight;
1267 txwd = rp->TxWidth;
1268 if (WINVERS_AMIV) {
1269 if (win == WIN_INVEN) {
1270 cw->cols = (w->Width - w->BorderLeft - w->BorderRight - 4
1271 - pictdata.xsize - 3) / txwd;
1272 } else
1273 cw->cols = (w->Width - w->BorderLeft - w->BorderRight - 4) / txwd;
1274 } else {
1275 cw->cols = (w->Width - w->BorderLeft - w->BorderRight - 4) / txwd;
1276 }
1277
1278 /* Get the real line to display at */
1279 start = FindLine(win, start);
1280
1281 mip = cw->menu.items;
1282 for (i = 0; mip && i < start; ++i) {
1283 mip = mip->next;
1284 }
1285
1286 /* Skip any initial response to a previous line */
1287 if (cw->type == NHW_MESSAGE && mip && mip->selected < 0)
1288 ++start;
1289 if (WINVERS_AMIV && cw->type == NHW_MESSAGE)
1290 SetAPen(rp, amii_msgAPen);
1291
1292 for (disprow = i = start; disprow < wheight + start; i++) {
1293 /* Just erase unused lines in the window */
1294 if (i >= cw->maxrow) {
1295 if (WINVERS_AMIV && win == WIN_INVEN) {
1296 amii_curs(win, 0, disprow - start);

Callers 3

DoMenuScrollFunction · 0.85
ReDisplayDataFunction · 0.85
amii_doprev_messageFunction · 0.85

Calls 5

FindLineFunction · 0.85
amii_cursFunction · 0.85
amiga_print_glyphFunction · 0.85
amii_cl_endFunction · 0.85
panicFunction · 0.70

Tested by

no test coverage detected