summaryrefslogtreecommitdiff
path: root/src/newgrf_commons.cpp
diff options
context:
space:
mode:
authorMichael Lutz <michi@icosahedron.de>2020-12-15 00:22:04 +0100
committerMichael Lutz <michi@icosahedron.de>2020-12-15 00:29:30 +0100
commit79240eab1ee4abb2882a40c7ac18e4915b4dc820 (patch)
tree98abb3c8ccf490efa459ed29fe7f28699c8d9928 /src/newgrf_commons.cpp
parentcc1679e3171bf6982164c4072a773fdd687ea885 (diff)
downloadopenttd-79240eab1ee4abb2882a40c7ac18e4915b4dc820.tar.xz
Codechange: Make use of the improved C++17 emplace_back function.
Diffstat (limited to 'src/newgrf_commons.cpp')
-rw-r--r--src/newgrf_commons.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/newgrf_commons.cpp b/src/newgrf_commons.cpp
index 8209d675c..64eed8139 100644
--- a/src/newgrf_commons.cpp
+++ b/src/newgrf_commons.cpp
@@ -664,8 +664,7 @@ uint32 NewGRFSpriteLayout::PrepareLayout(uint32 orig_offset, uint32 newgrf_groun
/* Create a copy of the spritelayout, so we can modify some values.
* Also include the groundsprite into the sequence for easier processing. */
- /*C++17: DrawTileSeqStruct *result = &*/ result_seq.emplace_back();
- DrawTileSeqStruct *result = &result_seq.back();
+ DrawTileSeqStruct *result = &result_seq.emplace_back();
result->image = ground;
result->delta_x = 0;
result->delta_y = 0;
@@ -675,8 +674,7 @@ uint32 NewGRFSpriteLayout::PrepareLayout(uint32 orig_offset, uint32 newgrf_groun
foreach_draw_tile_seq(dtss, this->seq) {
result_seq.push_back(*dtss);
}
- result_seq.emplace_back() /*C++17: .MakeTerminator()*/;
- result_seq.back().MakeTerminator();
+ result_seq.emplace_back().MakeTerminator();
/* Determine the var10 values the action-1-2-3 chains needs to be resolved for,
* and apply the default sprite offsets (unless disabled). */
const TileLayoutRegisters *regs = this->registers;