Mercurial > hg > openttd
comparison src/graph_gui.cpp @ 12415:6a77d1df56e2 draft
(svn r16849) -Codechange: replace GetCargo() by CargoSpec::Get()
author | smatz <smatz@openttd.org> |
---|---|
date | Thu, 16 Jul 2009 19:00:13 +0000 |
parents | 0024ba6bb40e |
children | 0d8340a4c70e |
comparison
equal
deleted
inserted
replaced
12414:5443128573f4 | 12415:6a77d1df56e2 |
---|---|
735 PaymentRatesGraphWindow(const WindowDesc *desc, WindowNumber window_number) : | 735 PaymentRatesGraphWindow(const WindowDesc *desc, WindowNumber window_number) : |
736 BaseGraphWindow(desc, window_number, 2, 24, 200, false, STR_CURRCOMPACT) | 736 BaseGraphWindow(desc, window_number, 2, 24, 200, false, STR_CURRCOMPACT) |
737 { | 737 { |
738 uint num_active = 0; | 738 uint num_active = 0; |
739 for (CargoID c = 0; c < NUM_CARGO; c++) { | 739 for (CargoID c = 0; c < NUM_CARGO; c++) { |
740 if (GetCargo(c)->IsValid()) num_active++; | 740 if (CargoSpec::Get(c)->IsValid()) num_active++; |
741 } | 741 } |
742 | 742 |
743 /* Resize the window to fit the cargo types */ | 743 /* Resize the window to fit the cargo types */ |
744 ResizeWindow(this, 0, max(num_active, 12U) * 8); | 744 ResizeWindow(this, 0, max(num_active, 12U) * 8); |
745 | 745 |
785 int x = 495; | 785 int x = 495; |
786 int y = 24; | 786 int y = 24; |
787 | 787 |
788 uint i = 0; | 788 uint i = 0; |
789 for (CargoID c = 0; c < NUM_CARGO; c++) { | 789 for (CargoID c = 0; c < NUM_CARGO; c++) { |
790 const CargoSpec *cs = GetCargo(c); | 790 const CargoSpec *cs = CargoSpec::Get(c); |
791 if (!cs->IsValid()) continue; | 791 if (!cs->IsValid()) continue; |
792 | 792 |
793 /* Only draw labels for widgets that exist. If the widget doesn't | 793 /* Only draw labels for widgets that exist. If the widget doesn't |
794 * exist then the local company has used the climate cheat or | 794 * exist then the local company has used the climate cheat or |
795 * changed the NewGRF configuration with this window open. */ | 795 * changed the NewGRF configuration with this window open. */ |