let FileReader::Read return an opaque buffer instead of std::vector.

This can later allow returning a pointer to a static buffer from a cache without creating copies.
This commit is contained in:
Christoph Oelckers 2023-12-10 09:07:26 +01:00
commit fc84579319
12 changed files with 248 additions and 85 deletions

View file

@ -65,9 +65,9 @@ FImageSource *WebPImage_TryCreate(FileReader &file, int lumpnum)
file.Seek(0, FileReader::SeekSet);
auto bytes = file.Read();
if (WebPGetInfo(bytes.data(), bytes.size(), &width, &height))
if (WebPGetInfo(bytes.bytes(), bytes.size(), &width, &height))
{
WebPData data{ bytes.data(), bytes.size() };
WebPData data{ bytes.bytes(), bytes.size() };
WebPData chunk_data;
auto mux = WebPMuxCreate(&data, 0);
if (mux)