| 1237 | } |
| 1238 | |
| 1239 | void |
| 1240 | DisplayData(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); |
no test coverage detected