mirror of
https://github.com/CloverHackyColor/CloverBootloader.git
synced 2024-11-23 11:35:19 +01:00
move data when create ximage from png
Signed-off-by: Sergey Isakov <isakov-sl@bk.ru>
This commit is contained in:
parent
fb901fa1a0
commit
35103e3126
@ -319,12 +319,19 @@ void XImage::FlipRB(bool WantAlpha)
|
||||
*/
|
||||
EFI_STATUS XImage::FromPNG(const UINT8 * Data, UINTN Length)
|
||||
{
|
||||
// DBG("XImage len=%llu\n", Length);
|
||||
if (Data == NULL) return EFI_INVALID_PARAMETER;
|
||||
UINT8 * PixelPtr = (UINT8 *)&PixelData[0];
|
||||
UINT8 * PixelPtr; // = (UINT8 *)&PixelData[0];
|
||||
unsigned Error = eglodepng_decode(&PixelPtr, &Width, &Height, Data, Length);
|
||||
if (Error != 0 && Error != 28) {
|
||||
return EFI_NOT_FOUND;
|
||||
}
|
||||
setSizeInPixels(Width, Height);
|
||||
//now we have a new pointer and want to move data
|
||||
INTN NewLength = Width * Height * sizeof(EFI_GRAPHICS_OUTPUT_BLT_PIXEL);
|
||||
CopyMem(GetPixelPtr(0,0), PixelPtr, NewLength);
|
||||
FreePool(PixelPtr); //allocated by lodepng
|
||||
|
||||
FlipRB(true);
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
@ -2273,7 +2273,7 @@ RefitMain (IN EFI_HANDLE ImageHandle,
|
||||
#endif // ENABLE_SECURE_BOOT
|
||||
|
||||
MainMenu.TimeoutSeconds = GlobalConfig.Timeout >= 0 ? GlobalConfig.Timeout : 0;
|
||||
|
||||
ThemeX.FillByEmbedded();
|
||||
//DBG("LoadDrivers() start\n");
|
||||
LoadDrivers();
|
||||
//DBG("LoadDrivers() end\n");
|
||||
|
Loading…
Reference in New Issue
Block a user