equal
deleted
inserted
replaced
57 * @param amount Cargo amount |
57 * @param amount Cargo amount |
58 * @param rating ratings data for that particular cargo */ |
58 * @param rating ratings data for that particular cargo */ |
59 static void StationsWndShowStationRating(int x, int y, CargoID type, uint amount, byte rating) |
59 static void StationsWndShowStationRating(int x, int y, CargoID type, uint amount, byte rating) |
60 { |
60 { |
61 const CargoSpec *cs = GetCargo(type); |
61 const CargoSpec *cs = GetCargo(type); |
62 if (cs->bitnum == 0xFF) return; |
62 if (!cs->IsValid()) return; |
63 |
63 |
64 int colour = cs->rating_colour; |
64 int colour = cs->rating_colour; |
65 uint w = (minu(amount, 576) + 5) / 36; |
65 uint w = (minu(amount, 576) + 5) / 36; |
66 |
66 |
67 /* Draw total cargo (limited) on station (fits into 16 pixels) */ |
67 /* Draw total cargo (limited) on station (fits into 16 pixels) */ |
326 |
326 |
327 for (i = 0; i < NUM_CARGO; i++) { |
327 for (i = 0; i < NUM_CARGO; i++) { |
328 cg_ofst = IsWindowWidgetLowered(w, i + STATIONLIST_WIDGET_CARGOSTART) ? 2 : 1; |
328 cg_ofst = IsWindowWidgetLowered(w, i + STATIONLIST_WIDGET_CARGOSTART) ? 2 : 1; |
329 |
329 |
330 const CargoSpec *cs = GetCargo(i); |
330 const CargoSpec *cs = GetCargo(i); |
331 if (cs->bitnum != 0xFF) { |
331 if (cs->IsValid()) { |
332 GfxFillRect(x + cg_ofst, y + cg_ofst, x + cg_ofst + 10 , y + cg_ofst + 7, cs->rating_colour); |
332 GfxFillRect(x + cg_ofst, y + cg_ofst, x + cg_ofst + 10 , y + cg_ofst + 7, cs->rating_colour); |
333 DrawStringCentered(x + 6 + cg_ofst, y + cg_ofst, cs->abbrev, 0x10); |
333 DrawStringCentered(x + 6 + cg_ofst, y + cg_ofst, cs->abbrev, 0x10); |
334 } |
334 } |
335 x += 14; |
335 x += 14; |
336 } |
336 } |