2011-06-14 19:53:19 +02:00
|
|
|
#include "GUI/gui.h"
|
*Completely rewrote the asynchron GuiImageData class (problems from switch Carousel<->Grid layour should be fixed now)
*Fixed bug mounting a wbfs partition which was formatted from an ext partition
*Rewrote the parental control feature. Removed loading pin or settings from the Wii Settings. Parental control is now completely managed in the loader from the settings selected and the password set.
*Saving password in config file is now encrypted
*Added loop to wait for usb when reloading the cIOS before game start
The parental control feature is filtering games like following when usb loader is locked:
level 0 (everyone 0+) > shows only games with lvl 0
level 1 (childs 7+) > shows games with lvl 0, 1
level 2 (teens 12+) > shows games with lvl 0, 1, 2
level 3 (mature 16+) > shows games with lvl 0, 1, 2, 3
level 4 (adults only 18+) > shows all games (lvl 0, 1, 2, 3, 4)
level 4 is default when creating new configs
2010-12-19 19:20:33 +01:00
|
|
|
#include "usbloader/disc.h"
|
|
|
|
#include "FileOperations/fileops.h"
|
|
|
|
#include "settings/CSettings.h"
|
|
|
|
#include "themes/CTheme.h"
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* LoadCoverImage
|
|
|
|
***************************************************************************/
|
|
|
|
GuiImageData *LoadCoverImage(struct discHdr *header, bool Prefere3D, bool noCover)
|
|
|
|
{
|
2020-12-12 22:35:12 +01:00
|
|
|
if (!header)
|
|
|
|
return NULL;
|
2011-07-26 00:28:22 +02:00
|
|
|
GuiImageData *Cover = NULL;
|
2020-12-12 22:35:12 +01:00
|
|
|
char ID3[4] = {};
|
2011-07-26 00:28:22 +02:00
|
|
|
char IDfull[7];
|
|
|
|
char Path[255];
|
|
|
|
bool flag = Prefere3D;
|
*Completely rewrote the asynchron GuiImageData class (problems from switch Carousel<->Grid layour should be fixed now)
*Fixed bug mounting a wbfs partition which was formatted from an ext partition
*Rewrote the parental control feature. Removed loading pin or settings from the Wii Settings. Parental control is now completely managed in the loader from the settings selected and the password set.
*Saving password in config file is now encrypted
*Added loop to wait for usb when reloading the cIOS before game start
The parental control feature is filtering games like following when usb loader is locked:
level 0 (everyone 0+) > shows only games with lvl 0
level 1 (childs 7+) > shows games with lvl 0, 1
level 2 (teens 12+) > shows games with lvl 0, 1, 2
level 3 (mature 16+) > shows games with lvl 0, 1, 2, 3
level 4 (adults only 18+) > shows all games (lvl 0, 1, 2, 3, 4)
level 4 is default when creating new configs
2010-12-19 19:20:33 +01:00
|
|
|
|
2020-12-12 22:35:12 +01:00
|
|
|
memcpy(ID3, (char *)header->id, sizeof(ID3) - 1);
|
|
|
|
snprintf(IDfull, sizeof(IDfull), "%s", (char *)header->id);
|
*Completely rewrote the asynchron GuiImageData class (problems from switch Carousel<->Grid layour should be fixed now)
*Fixed bug mounting a wbfs partition which was formatted from an ext partition
*Rewrote the parental control feature. Removed loading pin or settings from the Wii Settings. Parental control is now completely managed in the loader from the settings selected and the password set.
*Saving password in config file is now encrypted
*Added loop to wait for usb when reloading the cIOS before game start
The parental control feature is filtering games like following when usb loader is locked:
level 0 (everyone 0+) > shows only games with lvl 0
level 1 (childs 7+) > shows games with lvl 0, 1
level 2 (teens 12+) > shows games with lvl 0, 1, 2
level 3 (mature 16+) > shows games with lvl 0, 1, 2, 3
level 4 (adults only 18+) > shows all games (lvl 0, 1, 2, 3, 4)
level 4 is default when creating new configs
2010-12-19 19:20:33 +01:00
|
|
|
|
2011-07-26 00:28:22 +02:00
|
|
|
for (int i = 0; i < 2; ++i)
|
|
|
|
{
|
|
|
|
char *coverPath = flag ? Settings.covers_path : Settings.covers2d_path;
|
|
|
|
flag = !flag;
|
|
|
|
//Load full id image
|
|
|
|
snprintf(Path, sizeof(Path), "%s%s.png", coverPath, IDfull);
|
*Completely rewrote the asynchron GuiImageData class (problems from switch Carousel<->Grid layour should be fixed now)
*Fixed bug mounting a wbfs partition which was formatted from an ext partition
*Rewrote the parental control feature. Removed loading pin or settings from the Wii Settings. Parental control is now completely managed in the loader from the settings selected and the password set.
*Saving password in config file is now encrypted
*Added loop to wait for usb when reloading the cIOS before game start
The parental control feature is filtering games like following when usb loader is locked:
level 0 (everyone 0+) > shows only games with lvl 0
level 1 (childs 7+) > shows games with lvl 0, 1
level 2 (teens 12+) > shows games with lvl 0, 1, 2
level 3 (mature 16+) > shows games with lvl 0, 1, 2, 3
level 4 (adults only 18+) > shows all games (lvl 0, 1, 2, 3, 4)
level 4 is default when creating new configs
2010-12-19 19:20:33 +01:00
|
|
|
|
2020-12-12 22:35:12 +01:00
|
|
|
if (!CheckFile(Path))
|
2011-07-26 00:28:22 +02:00
|
|
|
{
|
|
|
|
snprintf(Path, sizeof(Path), "%s%s.png", coverPath, ID3);
|
2020-12-12 22:35:12 +01:00
|
|
|
if (!CheckFile(Path))
|
2011-07-26 00:28:22 +02:00
|
|
|
continue;
|
|
|
|
}
|
*Completely rewrote the asynchron GuiImageData class (problems from switch Carousel<->Grid layour should be fixed now)
*Fixed bug mounting a wbfs partition which was formatted from an ext partition
*Rewrote the parental control feature. Removed loading pin or settings from the Wii Settings. Parental control is now completely managed in the loader from the settings selected and the password set.
*Saving password in config file is now encrypted
*Added loop to wait for usb when reloading the cIOS before game start
The parental control feature is filtering games like following when usb loader is locked:
level 0 (everyone 0+) > shows only games with lvl 0
level 1 (childs 7+) > shows games with lvl 0, 1
level 2 (teens 12+) > shows games with lvl 0, 1, 2
level 3 (mature 16+) > shows games with lvl 0, 1, 2, 3
level 4 (adults only 18+) > shows all games (lvl 0, 1, 2, 3, 4)
level 4 is default when creating new configs
2010-12-19 19:20:33 +01:00
|
|
|
|
2011-07-26 00:28:22 +02:00
|
|
|
delete Cover;
|
|
|
|
Cover = new (std::nothrow) GuiImageData(Path);
|
|
|
|
//Load short id image
|
|
|
|
if (!Cover || !Cover->GetImage())
|
|
|
|
{
|
|
|
|
snprintf(Path, sizeof(Path), "%s%s.png", coverPath, ID3);
|
|
|
|
delete Cover;
|
|
|
|
Cover = new (std::nothrow) GuiImageData(Path);
|
|
|
|
}
|
2020-12-12 22:35:12 +01:00
|
|
|
if (Cover && Cover->GetImage())
|
|
|
|
break;
|
2011-07-26 00:28:22 +02:00
|
|
|
}
|
|
|
|
//Load no image
|
|
|
|
if (noCover && (!Cover || !Cover->GetImage()))
|
|
|
|
{
|
|
|
|
flag = Prefere3D;
|
|
|
|
for (int i = 0; i < 2; ++i)
|
|
|
|
{
|
|
|
|
delete Cover;
|
|
|
|
Cover = Resources::GetImageData(flag ? "nocover.png" : "nocoverFlat.png");
|
2020-12-12 22:35:12 +01:00
|
|
|
if (Cover && Cover->GetImage())
|
|
|
|
break;
|
2011-07-26 00:28:22 +02:00
|
|
|
flag = !flag;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (Cover && !Cover->GetImage())
|
|
|
|
{
|
|
|
|
delete Cover;
|
|
|
|
Cover = NULL;
|
|
|
|
}
|
|
|
|
return Cover;
|
*Completely rewrote the asynchron GuiImageData class (problems from switch Carousel<->Grid layour should be fixed now)
*Fixed bug mounting a wbfs partition which was formatted from an ext partition
*Rewrote the parental control feature. Removed loading pin or settings from the Wii Settings. Parental control is now completely managed in the loader from the settings selected and the password set.
*Saving password in config file is now encrypted
*Added loop to wait for usb when reloading the cIOS before game start
The parental control feature is filtering games like following when usb loader is locked:
level 0 (everyone 0+) > shows only games with lvl 0
level 1 (childs 7+) > shows games with lvl 0, 1
level 2 (teens 12+) > shows games with lvl 0, 1, 2
level 3 (mature 16+) > shows games with lvl 0, 1, 2, 3
level 4 (adults only 18+) > shows all games (lvl 0, 1, 2, 3, 4)
level 4 is default when creating new configs
2010-12-19 19:20:33 +01:00
|
|
|
}
|