summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorskidd13 <skidd13@openttd.org>2008-06-19 09:32:25 +0000
committerskidd13 <skidd13@openttd.org>2008-06-19 09:32:25 +0000
commite7f2765f4c52f8182bdbef1becb1c889bbe78485 (patch)
treec204023f0bf0f8272625c18c1d53f9e108966790 /src
parentf2730396da8f8c3d84a3003a4623990d939fdf89 (diff)
downloadopenttd-e7f2765f4c52f8182bdbef1becb1c889bbe78485.tar.xz
(svn r13573) -Codechange: Use smallvec class functions instead of class members
Diffstat (limited to 'src')
-rw-r--r--src/viewport.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/viewport.cpp b/src/viewport.cpp
index a576e7c9f..7b0cfb107 100644
--- a/src/viewport.cpp
+++ b/src/viewport.cpp
@@ -546,7 +546,7 @@ void OffsetGroundSprite(int x, int y)
}
/* _vd.last_child == NULL if foundation sprite was clipped by the viewport bounds */
- if (_vd.last_child != NULL) _vd.foundation[_vd.foundation_part] = _vd.parent_sprites_to_draw.items - 1;
+ if (_vd.last_child != NULL) _vd.foundation[_vd.foundation_part] = _vd.parent_sprites_to_draw.Length() - 1;
_vd.foundation_offset[_vd.foundation_part].x = x;
_vd.foundation_offset[_vd.foundation_part].y = y;
@@ -715,7 +715,7 @@ void AddChildSpriteScreen(SpriteID image, SpriteID pal, int x, int y, bool trans
pal = PALETTE_TO_TRANSPARENT;
}
- *_vd.last_child = _vd.child_screen_sprites_to_draw.items;
+ *_vd.last_child = _vd.child_screen_sprites_to_draw.Length();
ChildScreenSpriteToDraw *cs = _vd.child_screen_sprites_to_draw.Append();
cs->image = image;
@@ -1478,7 +1478,7 @@ void ViewportDoDraw(const ViewPort *vp, int left, int top, int right, int bottom
ViewportAddSigns(&_vd.dpi);
ViewportAddWaypoints(&_vd.dpi);
- if (_vd.tile_sprites_to_draw.items != 0) ViewportDrawTileSprites(&_vd.tile_sprites_to_draw);
+ if (_vd.tile_sprites_to_draw.Length() != 0) ViewportDrawTileSprites(&_vd.tile_sprites_to_draw);
ParentSpriteToDraw *psd_end = _vd.parent_sprites_to_draw.End();
for (ParentSpriteToDraw *it = _vd.parent_sprites_to_draw.Begin(); it != psd_end; it++) {
@@ -1490,15 +1490,15 @@ void ViewportDoDraw(const ViewPort *vp, int left, int top, int right, int bottom
if (_draw_bounding_boxes) ViewportDrawBoundingBoxes(&_vd.parent_sprites_to_sort);
- if (_vd.string_sprites_to_draw.items != 0) ViewportDrawStrings(&_vd.dpi, &_vd.string_sprites_to_draw);
+ if (_vd.string_sprites_to_draw.Length() != 0) ViewportDrawStrings(&_vd.dpi, &_vd.string_sprites_to_draw);
_cur_dpi = old_dpi;
- _vd.string_sprites_to_draw.items = 0;
- _vd.tile_sprites_to_draw.items = 0;
- _vd.parent_sprites_to_draw.items = 0;
- _vd.parent_sprites_to_sort.items = 0;
- _vd.child_screen_sprites_to_draw.items = 0;
+ _vd.string_sprites_to_draw.Clear();
+ _vd.tile_sprites_to_draw.Clear();
+ _vd.parent_sprites_to_draw.Clear();
+ _vd.parent_sprites_to_sort.Clear();
+ _vd.child_screen_sprites_to_draw.Clear();
}
/** Make sure we don't draw a too big area at a time.