equal
deleted
inserted
replaced
1443 /* draw arrow pointing up/down for ascending/descending sorting */ |
1443 /* draw arrow pointing up/down for ascending/descending sorting */ |
1444 DoDrawString(vl->flags & VL_DESC ? DOWNARROW : UPARROW, 69, 15, 0x10); |
1444 DoDrawString(vl->flags & VL_DESC ? DOWNARROW : UPARROW, 69, 15, 0x10); |
1445 |
1445 |
1446 max = min(w->vscroll.pos + w->vscroll.cap, vl->list_length); |
1446 max = min(w->vscroll.pos + w->vscroll.cap, vl->list_length); |
1447 for (i = w->vscroll.pos; i < max; ++i) { |
1447 for (i = w->vscroll.pos; i < max; ++i) { |
1448 Vehicle *v = GetVehicle(vl->sort_list[i].index); |
1448 const Vehicle* v = vl->sort_list[i]; |
1449 StringID str; |
1449 StringID str; |
1450 |
1450 |
1451 assert(v->type == VEH_Train && v->owner == owner); |
1451 assert(v->type == VEH_Train && v->owner == owner); |
1452 |
1452 |
1453 DrawTrainImage(v, x + 21, y + 6, w->hscroll.cap, 0, INVALID_VEHICLE); |
1453 DrawTrainImage(v, x + 21, y + 6, w->hscroll.cap, 0, INVALID_VEHICLE); |
1496 |
1496 |
1497 id_v += w->vscroll.pos; |
1497 id_v += w->vscroll.pos; |
1498 |
1498 |
1499 if (id_v >= vl->list_length) return; // click out of list bound |
1499 if (id_v >= vl->list_length) return; // click out of list bound |
1500 |
1500 |
1501 v = GetVehicle(vl->sort_list[id_v].index); |
1501 v = vl->sort_list[id_v]; |
1502 |
1502 |
1503 assert(v->type == VEH_Train && IsFrontEngine(v) && v->owner == owner); |
1503 assert(v->type == VEH_Train && IsFrontEngine(v) && v->owner == owner); |
1504 |
1504 |
1505 ShowTrainViewWindow(v); |
1505 ShowTrainViewWindow(v); |
1506 } break; |
1506 } break; |