diff options
author | rubidium <rubidium@openttd.org> | 2007-08-30 13:03:56 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2007-08-30 13:03:56 +0000 |
commit | 235ad4ab6bf3133517a7a779c398e30f51bdbbad (patch) | |
tree | 141633b357757cb790c904dc033f8479d58ba5e5 /src/train_gui.cpp | |
parent | 6edf2d3a1bd90619d0e5257becfd3df708fe3554 (diff) | |
download | openttd-235ad4ab6bf3133517a7a779c398e30f51bdbbad.tar.xz |
(svn r11003) -Codechange: replace Vehicle->next to Vehicle->Next() and Vehicle->SetNext() so we can trap instances that change a next pointer and (in the future) update the first/previous pointers based on that.
Diffstat (limited to 'src/train_gui.cpp')
-rw-r--r-- | src/train_gui.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/train_gui.cpp b/src/train_gui.cpp index f88ab54ab..cf8dcbc15 100644 --- a/src/train_gui.cpp +++ b/src/train_gui.cpp @@ -100,7 +100,7 @@ void DrawTrainImage(const Vehicle *v, int x, int y, int count, int skip, Vehicle } dx += width; - v = v->next; + v = v->Next(); } while (dx < count && v != NULL); if (highlight_l != highlight_r) { @@ -176,7 +176,7 @@ static void DrawTrainDetailsWindow(Window *w) do { act_cargo[u->cargo_type] += u->cargo.Count(); max_cargo[u->cargo_type] += u->cargo_cap; - } while ((u = u->next) != NULL); + } while ((u = u->Next()) != NULL); /* Set scroll-amount seperately from counting, as to not compute num double * for more carriages of the same type @@ -188,7 +188,7 @@ static void DrawTrainDetailsWindow(Window *w) } else { do { if (!IsArticulatedPart(u) || u->cargo_cap != 0) num++; - } while ((u = u->next) != NULL); + } while ((u = u->Next()) != NULL); } SetVScrollCount(w, num); @@ -249,7 +249,7 @@ static void DrawTrainDetailsWindow(Window *w) SpriteID pal = (v->vehstatus & VS_CRASHED) ? PALETTE_CRASH : GetVehiclePalette(v); DrawSprite(u->GetImage(DIR_W), pal, x + WagonLengthToPixels(4 + dx), y + 6 + (is_custom_sprite(RailVehInfo(u->engine_type)->image_index) ? _traininfo_vehicle_pitch : 0)); dx += u->u.rail.cached_veh_length; - u = u->next; + u = u->Next(); } while (u != NULL && IsArticulatedPart(u) && u->cargo_cap == 0); px = x + WagonLengthToPixels(dx) + 2; @@ -271,7 +271,7 @@ static void DrawTrainDetailsWindow(Window *w) } else { /* Move to the next line */ do { - v = v->next; + v = v->Next(); } while (v != NULL && IsArticulatedPart(v) && v->cargo_cap == 0); } if (v == NULL) return; |