From ccb5427b45190ed2cf9fe1b94fa358e87a5b1be8 Mon Sep 17 00:00:00 2001 From: "Michael Cook (mackal)" Date: Mon, 18 Jul 2016 21:57:25 -0400 Subject: [PATCH] Make VS debug mode happy This actually hurts microbenchmarking I couldn't get the ModelEntry::polys vector to play nice with benchmarking so it will just be using push_back so I don't have write a new ctor (writing a new ctor and using emplace_back vs push_back were equal) --- zone/map.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/zone/map.cpp b/zone/map.cpp index 1558e70d4..f06c590ad 100644 --- a/zone/map.cpp +++ b/zone/map.cpp @@ -360,13 +360,13 @@ bool Map::LoadV2(FILE *f) { } std::vector data; - data.reserve(data_size); + data.resize(data_size); if (fread(&data[0], data_size, 1, f) != 1) { return false; } std::vector buffer; - buffer.reserve(buffer_size); + buffer.resize(buffer_size); uint32 v = InflateData(&data[0], data_size, &buffer[0], buffer_size); char *buf = &buffer[0]; @@ -486,7 +486,7 @@ bool Map::LoadV2(FILE *f) { p.v2 = v2; p.v3 = v3; p.vis = vis; - me->polys[j] = p; + me->polys.push_back(p); } models[name] = std::move(me); @@ -696,8 +696,8 @@ bool Map::LoadV2(FILE *f) { uint32 ter_vert_count = ((quads_per_tile + 1) * (quads_per_tile + 1)); std::vector flags; std::vector floats; - flags.reserve(ter_quad_count); - floats.reserve(ter_vert_count); + flags.resize(ter_quad_count); + floats.resize(ter_vert_count); for (uint32 i = 0; i < tile_count; ++i) { bool flat; flat = *(bool*)buf;