This all needs rewriting, but at least let's make it not crash on Windows.

This commit is contained in:
Pär Winzell 2019-04-07 15:18:13 -07:00
parent 11398f6acb
commit 769454e964
1 changed files with 3 additions and 4 deletions

View File

@ -89,11 +89,10 @@ std::shared_ptr<TextureData> TextureBuilder::combine(
int channels = includeAlphaChannel ? 4 : 3;
std::vector<uint8_t> mergedPixels(static_cast<size_t>(channels * width * height));
std::vector<pixel> pixels(texes.size());
std::vector<const pixel*> pixelPointers(texes.size());
for (int xx = 0; xx < width; xx++) {
for (int yy = 0; yy < height; yy++) {
pixels.clear();
std::vector<pixel> pixels(texes.size());
std::vector<const pixel*> pixelPointers(texes.size(), nullptr);
for (int jj = 0; jj < texes.size(); jj++) {
const TexInfo& tex = texes[jj];
// each texture's structure will depend on its channel count
@ -216,4 +215,4 @@ std::shared_ptr<TextureData> TextureBuilder::simple(int rawTexIndex, const std::
new TextureData(textureName, *gltf.defaultSampler, *gltf.images.hold(image)));
textureByIndicesKey.insert(std::make_pair(key, texDat));
return texDat;
}
}