- use FileData for readinf WebP

This commit is contained in:
Christoph Oelckers 2023-08-22 22:12:34 +02:00
parent c77ece4922
commit 1748477086

View file

@ -124,8 +124,7 @@ PalettedPixels FWebPTexture::CreatePalettedPixels(int conversion)
int FWebPTexture::CopyPixels(FBitmap *bmp, int conversion)
{
WebPDecoderConfig config;
auto lump = fileSystem.OpenFileReader(SourceLump);
auto bytes = lump.Read();
auto bytes = fileSystem.ReadFile(SourceLump);
if (WebPInitDecoderConfig(&config) == false)
return 0;
@ -137,7 +136,7 @@ int FWebPTexture::CopyPixels(FBitmap *bmp, int conversion)
config.output.u.RGBA.stride = bmp->GetPitch();
config.output.is_external_memory = 1;
(void)WebPDecode(bytes.data(), bytes.size(), &config);
(void)WebPDecode(bytes.GetBytes(), bytes.GetSize(), &config);
return 0;
}