From 15645ca480044b5eec20bcf680e60ac3258b6224 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Mon, 31 Oct 2022 20:17:18 -0700 Subject: [PATCH] Replacement: Avoid issues with c++14 data(). --- Core/TextureReplacer.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Core/TextureReplacer.cpp b/Core/TextureReplacer.cpp index a234ada347..dcd413ff2b 100644 --- a/Core/TextureReplacer.cpp +++ b/Core/TextureReplacer.cpp @@ -642,10 +642,10 @@ bool TextureReplacer::PopulateLevelFromZip(ReplacedTextureLevel &level, bool ign if (zsize != INVALID_ZIP_SIZE) pngdata.resize(zsize); if (!pngdata.empty()) { - pngdata.resize(zip_fread(zf, pngdata.data(), pngdata.size())); + pngdata.resize(zip_fread(zf, &pngdata[0], pngdata.size())); } - if (png_image_begin_read_from_memory(&png, pngdata.data(), pngdata.size())) { + if (png_image_begin_read_from_memory(&png, &pngdata[0], pngdata.size())) { // We pad files that have been hashrange'd so they are the same texture size. level.w = png.width; level.h = png.height; @@ -1168,10 +1168,10 @@ void ReplacedTexture::PrepareData(int level) { if (zsize != INVALID_ZIP_SIZE) pngdata.resize(zsize); if (!pngdata.empty()) { - pngdata.resize(zip_fread(zf, pngdata.data(), pngdata.size())); + pngdata.resize(zip_fread(zf, &pngdata[0], pngdata.size())); } - if (!png_image_begin_read_from_memory(&png, pngdata.data(), pngdata.size())) { + if (!png_image_begin_read_from_memory(&png, &pngdata[0], pngdata.size())) { ERROR_LOG(G3D, "Could not load texture replacement info: %s - %s (zip)", info.file.c_str(), png.message); cleanup(); return;