*Fixed no cover image loading for themes

*Fixed Font loading. The font.ttf is loaded from the path with .thems if it exists there.
When a Theme is loaded and a font.ttf file exists in the defined "Image-Folder:" than this font.ttf will override all others. This ensures support for themes with special fonts.
*Fixed double count on playcount bug
*Updated libext2fs to git snapshot 2010-12-24
*Added proper close of all file systems where the games are loaded from (FAT32/NTFS/EXT)
*Fixed hang bug when reloading into the IOS set in the individual game settings with that (reload to 223, 224, 245, ...)
This commit is contained in:
dimok321 2010-12-28 17:02:10 +00:00
parent 2212f8ded7
commit f1febd91be
52 changed files with 736 additions and 737 deletions

View File

@ -2,8 +2,8 @@
<app version="1">
<name> USB Loader GX</name>
<coder>USB Loader GX Team</coder>
<version>1.0 r1020</version>
<release_date>201012270947</release_date>
<version>1.0 r1021</version>
<release_date>201012271830</release_date>
<short_description>Loads games from USB-devices</short_description>
<long_description>USB Loader GX is a libwiigui based USB iso loader with a wii-like GUI. You can install games to your HDDs and boot them with shorter loading times.
The interactive GUI is completely controllable with WiiMote, Classic Controller or GC Controller.

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2010-12-26 16:16+0100\n"
"POT-Creation-Date: 2010-12-27 21:34+0100\n"
"PO-Revision-Date: 2009-10-01 01:00+0200\n"
"Last-Translator: David Jelinek (djelinek@hotmail.com) \n"
"Language-Team: r823 - last version on http://djelinek.sweb.cz/_USBLoderGX/czech.lang \n"
@ -675,6 +675,9 @@ msgstr ""
msgid "May"
msgstr "Kvet"
msgid "Messageboard Update"
msgstr ""
msgid "Missing files"
msgstr "Chybející soubory"

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2010-12-26 16:16+0100\n"
"POT-Creation-Date: 2010-12-27 21:34+0100\n"
"PO-Revision-Date: 2009-10-01 01:00+0200\n"
"Last-Translator: dorf[dk]\n"
"Language-Team: dorf[dk]\n"
@ -675,6 +675,9 @@ msgstr "Makér nye spil"
msgid "May"
msgstr "Maj"
msgid "Messageboard Update"
msgstr ""
msgid "Missing files"
msgstr "Manglende filer"

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2010-12-26 16:16+0100\n"
"POT-Creation-Date: 2010-12-27 21:34+0100\n"
"PO-Revision-Date: 2010-04-12 07:37+0100\n"
"Last-Translator: glowy\n"
"Language-Team: tj_cool, glowy\n"
@ -675,6 +675,9 @@ msgstr "Markeer nieuwe spellen"
msgid "May"
msgstr "Mei"
msgid "Messageboard Update"
msgstr ""
msgid "Missing files"
msgstr "Missende bestanden"

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2010-12-26 16:16+0100\n"
"POT-Creation-Date: 2010-12-27 21:34+0100\n"
"PO-Revision-Date: 2009-10-01 01:00+0200\n"
"Last-Translator: \n"
"Language-Team: \n"
@ -675,6 +675,9 @@ msgstr ""
msgid "May"
msgstr ""
msgid "Messageboard Update"
msgstr ""
msgid "Missing files"
msgstr ""

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2010-12-26 16:16+0100\n"
"POT-Creation-Date: 2010-12-27 21:34+0100\n"
"PO-Revision-Date: 2009-10-01 01:00+0200\n"
"Last-Translator: c64rmx\n"
"Language-Team: \n"
@ -675,6 +675,9 @@ msgstr ""
msgid "May"
msgstr "touko"
msgid "Messageboard Update"
msgstr ""
msgid "Missing files"
msgstr "tiedostoja puuttuu"

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2010-12-26 16:16+0100\n"
"POT-Creation-Date: 2010-12-27 21:34+0100\n"
"PO-Revision-Date: 2009-10-01 01:00+0200\n"
"Last-Translator: Kin8\n"
"Language-Team: Badablek, Amour, ikya & Kin8\n"
@ -675,6 +675,9 @@ msgstr "Marqueur nouveau jeu"
msgid "May"
msgstr "Mai"
msgid "Messageboard Update"
msgstr ""
msgid "Missing files"
msgstr "Fichier(s) manquant(s)"

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2010-12-26 16:16+0100\n"
"POT-Creation-Date: 2010-12-27 21:34+0100\n"
"PO-Revision-Date: 2009-10-01 01:00+0200\n"
"Last-Translator: ZEN.13\n"
"Language-Team: Snoozer, wishmasterf, Bertilax, ZEN.13\n"
@ -675,6 +675,9 @@ msgstr "Neue Spiele markieren"
msgid "May"
msgstr "Mai"
msgid "Messageboard Update"
msgstr ""
msgid "Missing files"
msgstr "Fehlende Dateien"

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2010-12-26 16:16+0100\n"
"POT-Creation-Date: 2010-12-27 21:34+0100\n"
"PO-Revision-Date: 2009-12-29 11:05+0100\n"
"Last-Translator: Springdale\n"
"Language-Team: Tusk, Springdale\n"
@ -675,6 +675,9 @@ msgstr "Új játékok megjelölése"
msgid "May"
msgstr "Máj"
msgid "Messageboard Update"
msgstr ""
msgid "Missing files"
msgstr "Hiányzó fájl"

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2010-12-26 16:16+0100\n"
"POT-Creation-Date: 2010-12-27 21:34+0100\n"
"PO-Revision-Date: 2010-02-21 08:00+0200\n"
"Last-Translator: Cambo \n"
"Language-Team: FoxeJoe, Cambo\n"
@ -675,6 +675,9 @@ msgstr "Evidenzia i nuovi giochi"
msgid "May"
msgstr "maggio"
msgid "Messageboard Update"
msgstr ""
msgid "Missing files"
msgstr "File Mancante/i"

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2010-12-26 16:16+0100\n"
"POT-Creation-Date: 2010-12-27 21:34+0100\n"
"PO-Revision-Date: 2009-10-01 01:00+0200\n"
"Last-Translator: hosigumayuugi\n"
"Language-Team: hosigumayuugi\n"
@ -675,6 +675,9 @@ msgstr "Newマークの表示機能"
msgid "May"
msgstr "5月"
msgid "Messageboard Update"
msgstr ""
msgid "Missing files"
msgstr "個の画像"

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2010-12-26 16:16+0100\n"
"POT-Creation-Date: 2010-12-27 21:34+0100\n"
"PO-Revision-Date: 2009-10-01 01:00+0200\n"
"Last-Translator: nextos@korea.com\n"
"Language-Team: \n"
@ -675,6 +675,9 @@ msgstr ""
msgid "May"
msgstr "5월"
msgid "Messageboard Update"
msgstr ""
msgid "Missing files"
msgstr "파일 누락"

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2010-12-26 16:16+0100\n"
"POT-Creation-Date: 2010-12-27 21:34+0100\n"
"PO-Revision-Date: 2009-10-01 01:00+0200\n"
"Last-Translator: raschi\n"
"Language-Team: raschi\n"
@ -675,6 +675,9 @@ msgstr ""
msgid "May"
msgstr "Mai"
msgid "Messageboard Update"
msgstr ""
msgid "Missing files"
msgstr "Manglende filer"

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2010-12-26 16:16+0100\n"
"POT-Creation-Date: 2010-12-27 21:34+0100\n"
"PO-Revision-Date: 2009-10-01 01:00+0200\n"
"Last-Translator: ziom666 (zadania_prog@vp.pl)\n"
"Language-Team: \n"
@ -675,6 +675,9 @@ msgstr "Oznacz nowe gry"
msgid "May"
msgstr "Maj"
msgid "Messageboard Update"
msgstr ""
msgid "Missing files"
msgstr "Brakuje plikow"

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2010-12-26 16:16+0100\n"
"POT-Creation-Date: 2010-12-27 21:34+0100\n"
"PO-Revision-Date: 2009-10-23 18:52+0200\n"
"Last-Translator: aniemotion\n"
"Language-Team: boto12, aniemotion\n"
@ -675,6 +675,9 @@ msgstr "Marcar games novos"
msgid "May"
msgstr "Mai"
msgid "Messageboard Update"
msgstr ""
msgid "Missing files"
msgstr "Faltando arquivos"

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2010-12-26 16:16+0100\n"
"POT-Creation-Date: 2010-12-27 21:34+0100\n"
"PO-Revision-Date: 2010-03-22 10:55-0000\n"
"Last-Translator: Sky8000\n"
"Language-Team: Sky8000 <sky8000@hotmail.com>\n"
@ -675,6 +675,9 @@ msgstr "Marcar jogos novos"
msgid "May"
msgstr "Mai"
msgid "Messageboard Update"
msgstr ""
msgid "Missing files"
msgstr "Ficheiros em falta"

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2010-12-26 16:16+0100\n"
"POT-Creation-Date: 2010-12-27 21:34+0100\n"
"PO-Revision-Date: 2009-10-01 01:00+0200\n"
"Last-Translator: nikolai_ca\n"
"Language-Team: Kir, alendit, nikolai_ca\n"
@ -675,6 +675,9 @@ msgstr "Отметить новые игры"
msgid "May"
msgstr "Май"
msgid "Messageboard Update"
msgstr ""
msgid "Missing files"
msgstr "Отсутствующие файлы"

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2010-12-26 16:16+0100\n"
"POT-Creation-Date: 2010-12-27 21:34+0100\n"
"PO-Revision-Date: 2009-10-01 01:00+0200\n"
"Last-Translator: knife.hu kavid\n"
"Language-Team: kavid\n"
@ -675,6 +675,9 @@ msgstr ""
msgid "May"
msgstr "五月"
msgid "Messageboard Update"
msgstr ""
msgid "Missing files"
msgstr "缺少的文件"

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2010-12-26 16:16+0100\n"
"POT-Creation-Date: 2010-12-27 21:34+0100\n"
"PO-Revision-Date: 2009-10-01 01:00+0200\n"
"Last-Translator: SirPalax\n"
"Language-Team: Penn, SirPalax\n"
@ -675,6 +675,9 @@ msgstr "Marcar juegos nuevos"
msgid "May"
msgstr ""
msgid "Messageboard Update"
msgstr ""
msgid "Missing files"
msgstr "Archivo(s) pendiente(s)"

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2010-12-26 16:16+0100\n"
"POT-Creation-Date: 2010-12-27 21:34+0100\n"
"PO-Revision-Date: 2010-01-19 17:39+0200\n"
"Last-Translator: Katsurou\n"
"Language-Team: Katsurou, pirateX\n"
@ -675,6 +675,9 @@ msgstr "Markera nya spel"
msgid "May"
msgstr "Maj"
msgid "Messageboard Update"
msgstr ""
msgid "Missing files"
msgstr "Filer som saknas"

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2010-12-26 16:16+0100\n"
"POT-Creation-Date: 2010-12-27 21:34+0100\n"
"PO-Revision-Date: 2010-02-15 21:00+0800\n"
"Last-Translator: Jane.H\n"
"Language-Team: kyogc, Miller, Mika Li, Jane.H\n"
@ -675,6 +675,9 @@ msgstr "標示新遊戲"
msgid "May"
msgstr "五月"
msgid "Messageboard Update"
msgstr ""
msgid "Missing files"
msgstr "缺少的文件"

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2010-12-26 16:16+0100\n"
"POT-Creation-Date: 2010-12-27 21:34+0100\n"
"PO-Revision-Date: 2009-10-01 01:00+0200\n"
"Last-Translator: Nitro_subzero \n"
"Language-Team: Nitro_subzero\n"
@ -675,6 +675,9 @@ msgstr ""
msgid "May"
msgstr "พค."
msgid "Messageboard Update"
msgstr ""
msgid "Missing files"
msgstr "ไฟล์ที่หาไม่พบ"

View File

@ -5,7 +5,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2010-12-26 16:16+0100\n"
"POT-Creation-Date: 2010-12-27 21:34+0100\n"
"PO-Revision-Date: 2009-10-01 01:00+0200\n"
"Last-Translator: omercigingelini\n"
"Language-Team: omercigingelini\n"
@ -675,6 +675,9 @@ msgstr "Yeni oyunlari imle"
msgid "May"
msgstr ""
msgid "Messageboard Update"
msgstr ""
msgid "Missing files"
msgstr "Kayıp dosyalar"

View File

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: USB Loader GX\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2010-12-26 16:16+0100\n"
"POT-Creation-Date: 2010-12-27 22:39+0100\n"
"PO-Revision-Date: 2009-10-01 01:00+0200\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n"
@ -86,7 +86,7 @@ msgstr ""
msgid "64 - settings btn pos x"
msgstr ""
msgid "371 - home menu btn pos x"
msgid "371 - home menu btn pos y"
msgstr ""
msgid "489 - home menu btn pos x"

File diff suppressed because one or more lines are too long

View File

@ -1,81 +0,0 @@
/****************************************************************************
* Copyright (C) 2010
* by Dimok
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any
* damages arising from the use of this software.
*
* Permission is granted to anyone to use this software for any
* purpose, including commercial applications, and to alter it and
* redistribute it freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you
* must not claim that you wrote the original software. If you use
* this software in a product, an acknowledgment in the product
* documentation would be appreciated but is not required.
*
* 2. Altered source versions must be plainly marked as such, and
* must not be misrepresented as being the original software.
*
* 3. This notice may not be removed or altered from any source
* distribution.
*
* for WiiXplorer 2010
***************************************************************************/
#include "FreeTypeGX.h"
#include "filelist.h"
FreeTypeGX * fontSystem = NULL;
static FT_Byte * MainFont = (FT_Byte *) font_ttf;
static u32 MainFontSize = font_ttf_size;
void ClearFontData()
{
if (fontSystem) delete fontSystem;
fontSystem = NULL;
if (MainFont != (FT_Byte *) font_ttf)
{
if (MainFont != NULL) delete[] MainFont;
MainFont = (FT_Byte *) font_ttf;
MainFontSize = font_ttf_size;
}
}
bool SetupDefaultFont(const char *path)
{
bool result = false;
FILE *pfile = NULL;
char FontPath[300];
ClearFontData();
snprintf(FontPath, sizeof(FontPath), "%sfont.ttf", path);
pfile = fopen(FontPath, "rb");
if (pfile)
{
fseek(pfile, 0, SEEK_END);
MainFontSize = ftell(pfile);
rewind(pfile);
MainFont = new (std::nothrow) FT_Byte[MainFontSize];
if (!MainFont)
{
MainFont = (FT_Byte *) font_ttf;
MainFontSize = font_ttf_size;
}
else
{
fread(MainFont, 1, MainFontSize, pfile);
result = true;
}
fclose(pfile);
}
fontSystem = new FreeTypeGX(MainFont, MainFontSize);
return result;
}

View File

@ -1,32 +0,0 @@
/****************************************************************************
* Copyright (C) 2010
* by Dimok
*
* This software is provided 'as-is', without any express or implied
* warranty. In no event will the authors be held liable for any
* damages arising from the use of this software.
*
* Permission is granted to anyone to use this software for any
* purpose, including commercial applications, and to alter it and
* redistribute it freely, subject to the following restrictions:
*
* 1. The origin of this software must not be misrepresented; you
* must not claim that you wrote the original software. If you use
* this software in a product, an acknowledgment in the product
* documentation would be appreciated but is not required.
*
* 2. Altered source versions must be plainly marked as such, and
* must not be misrepresented as being the original software.
*
* 3. This notice may not be removed or altered from any source
* distribution.
*
* for WiiXplorer 2010
***************************************************************************/
#ifndef FONTSYSTEM_H_
#define FONTSYSTEM_H_
bool SetupDefaultFont(const char *path);
void ClearFontData();
#endif

View File

@ -21,7 +21,6 @@
#include "menu/menus.h"
#include "memory/memory.h"
#include "fatmounter.h"
#include "FontSystem.h"
#include "sys.h"
//appentrypoint has to be global because of asm
@ -209,8 +208,7 @@ int BootGame(const char * gameID)
}
shadow_mload();
UnmountNTFS();
UnmountEXT();
WBFS_Close();
SDCard_deInit();
USBDevice_deInit();
USB_Deinitialize();

View File

@ -40,15 +40,6 @@ sec_t fat_sd_sec = 0; // u32
int fat_usb_mount = 0;
sec_t fat_usb_sec = 0;
int fat_wbfs_mount = 0;
sec_t fat_wbfs_sec = 0;
int fs_ntfs_mount = 0;
sec_t fs_ntfs_sec = 0;
int fs_ext_mount = 0;
sec_t fs_ext_sec = 0;
int USBDevice_Init()
{
//closing all open Files write back the cache and then shutdown em!
@ -124,30 +115,6 @@ void USBDevice_deInit()
fat_usb_sec = 0;
}
int WBFSDevice_Init(u32 sector)
{
//closing all open Files write back the cache and then shutdown em!
fatUnmount("WBFS:/");
if (!fatMount("WBFS", &__io_usbstorage2, 0, CACHE, SECTORS))
{
return -1;
}
fat_wbfs_mount = 1;
fat_wbfs_sec = _FAT_startSector;
return 0;
}
void WBFSDevice_deInit()
{
fatUnmount("WBFS:/");
fat_wbfs_mount = 0;
fat_wbfs_sec = 0;
}
int isInserted(const char *path)
{
if (!strncmp(path, "USB:", 4)) return 1;
@ -189,83 +156,3 @@ void SDCard_deInit()
fat_sd_mount = MOUNT_NONE;
fat_sd_sec = 0;
}
s32 MountNTFS(u32 sector)
{
s32 ret;
if (fs_ntfs_mount)
return 0;
if (wbfsDev == WBFS_DEVICE_USB)
{
ret = ntfsMount("NTFS", &__io_usbstorage2, sector, CACHE, SECTORS, NTFS_SHOW_HIDDEN_FILES | NTFS_RECOVER);
if (!ret)
return -2;
}
else if (wbfsDev == WBFS_DEVICE_SDHC)
{
if (sdhc_mode_sd == 0)
{
ret = ntfsMount("NTFS", &__io_sdhc, 0, CACHE, SECTORS, NTFS_SHOW_HIDDEN_FILES | NTFS_RECOVER);
}
else
{
ret = ntfsMount("NTFS", &__io_sdhc, 0, CACHE, SECTORS_SD, NTFS_SHOW_HIDDEN_FILES | NTFS_RECOVER);
}
if (!ret)
{
return -5;
}
}
// ntfsInit() resets locals
// which breaks unicode in console
// so we change it back to C-UTF-8
setlocale(LC_CTYPE, "C-UTF-8");
setlocale(LC_MESSAGES, "C-UTF-8");
fs_ntfs_mount = 1;
fs_ntfs_sec = sector;
return 0;
}
s32 UnmountNTFS(void)
{
/* Unmount device */
ntfsUnmount("NTFS:/", true);
fs_ntfs_mount = 0;
fs_ntfs_sec = 0;
return 0;
}
s32 MountEXT(u32 sector)
{
s32 ret;
if (fs_ext_mount)
return 0;
ret = ext2Mount("EXT", &__io_usbstorage2, sector, CACHE, SECTORS, EXT2_FLAG_DEFAULT);
if (!ret)
return -2;
fs_ext_mount = 1;
fs_ext_sec = sector;
return 0;
}
s32 UnmountEXT(void)
{
/* Unmount device */
ext2Unmount("EXT:/");
fs_ext_mount = 0;
fs_ext_sec = 0;
return 0;
}

View File

@ -47,7 +47,7 @@ static GuiImageData *GameCarouselLoadCoverImage(void * Arg)
* Constructor for the GuiGameCarousel class.
*/
GuiGameCarousel::GuiGameCarousel(int w, int h, const char *themePath, const u8 *imagebg, int imagebgsize, int selectedGame) :
noCover(nocover_png, nocover_png_size)
noCover(Resources::GetFile("nocover.png"), Resources::GetFileSize("nocover.png"))
{
width = w;
height = h;

View File

@ -203,7 +203,7 @@ static GuiImageData *GameGridLoadCoverImage(void * Arg)
* Constructor for the GuiGamegrid class.
*/
GuiGameGrid::GuiGameGrid(int w, int h, const char *themePath, const u8 *imagebg, int selectedGame) :
noCover(nocoverFlat_png, nocoverFlat_png_size)
noCover(Resources::GetFile("nocoverFlat.png"), Resources::GetFileSize("nocoverFlat.png"))
{
width = w;
height = h;

View File

@ -23,8 +23,6 @@
#include "language/gettext.h"
#include "mload/mload.h"
#include "mload/mload_modules.h"
#include "FreeTypeGX.h"
#include "FontSystem.h"
#include "video.h"
#include "audio.h"
#include "menu/menus.h"
@ -91,7 +89,6 @@ int main(int argc, char *argv[])
printf("\tLoading game settings...%s\n", GameSettings.Load(Settings.ConfigPath) ? "done" : "failed");
printf("\tLoading game statistics...%s\n", GameStatistics.Load(Settings.ConfigPath) ? "done" : "failed");
printf("\tLoading theme...%s\n", Theme::Load(Settings.theme_path) ? "done" : "failed (using default)");
printf("\tLoading font system...%s\n", SetupDefaultFont(Settings.theme_path) ? "done" : "failed (using default)");
VIDEO_SetWidescreen(Settings.widescreen);

View File

@ -166,7 +166,7 @@ GameBrowseMenu::GameBrowseMenu()
homeBtnImgOver = new GuiImage(btnhomeOver);
homeBtnImgOver->SetWidescreen(Settings.widescreen);
homeBtn = new GuiButton(homeBtnImg, homeBtnImgOver, 0, 3,
thInt("489 - home menu btn pos x"), thInt("371 - home menu btn pos x"),
thInt("489 - home menu btn pos x"), thInt("371 - home menu btn pos y"),
trigA, btnSoundOver, btnSoundClick2, 1, homeBtnTT, 15, -30, 1, 5);
homeBtn->RemoveSoundClick();
homeBtn->SetTrigger(trigHome);

View File

@ -69,7 +69,7 @@ int SelectPartitionMenu()
exitBtnImg.SetWidescreen(Settings.widescreen);
exitBtnImgOver.SetWidescreen(Settings.widescreen);
GuiButton exitBtn(&exitBtnImg, &exitBtnImgOver, 0, 3,
thInt("489 - home menu btn pos x"), thInt("371 - home menu btn pos x"),
thInt("489 - home menu btn pos x"), thInt("371 - home menu btn pos y"),
&trigA, btnSoundOver, btnSoundClick2, 1);
exitBtn.SetTrigger(&trigHome);

View File

@ -472,9 +472,6 @@ int GameWindow::MainLoop()
}
else if (gameBtn->GetState() == STATE_CLICKED)
{
struct discHdr * header = (mountMethod ? dvdheader : gameList[gameSelected]);
GameStatistics.SetPlayCount(header->id, GameStatistics.GetPlayCount(header->id)+1);
GameStatistics.Save();
returnVal = 1;
}
else if (backBtn->GetState() == STATE_CLICKED) //back

View File

@ -272,14 +272,13 @@ int MenuLanguageSelect()
w.Append( &pathBtn );
w.Append( &backBtn );
w.Append( &defaultBtn );
if ( result == 1 )
if (result == 1)
{
int len = ( strlen( entered ) - 1 );
if ( entered[len] != '/' )
strncat ( entered, "/", 1 );
strlcpy( Settings.languagefiles_path, entered, sizeof( Settings.languagefiles_path ) );
WindowPrompt( tr( "Languagepath changed." ), 0, tr( "OK" ) );
if ( isInserted( Settings.BootDevice ) )
if (entered[strlen(entered)-1] != '/')
strcat (entered, "/");
snprintf(Settings.languagefiles_path, sizeof(Settings.languagefiles_path), entered);
WindowPrompt(tr("Languagepath changed."), 0, tr("OK"));
if (isInserted(Settings.BootDevice))
{
Settings.Save();
returnhere = 1;
@ -299,19 +298,19 @@ int MenuLanguageSelect()
ret = optionBrowser4.GetClickedOption();
if ( ret >= 0 )
if (ret >= 0)
{
choice = WindowPrompt( tr( "Do you want to change language?" ), 0, tr( "Yes" ), tr( "Cancel" ) );
if ( choice == 1 )
if (choice == 1)
{
char newLangPath[150];
snprintf( Settings.languagefiles_path, sizeof( Settings.languagefiles_path ), "%s", Dir.GetFilepath(ret));
snprintf(Settings.languagefiles_path, sizeof( Settings.languagefiles_path ), "%s", Dir.GetFilepath(ret));
char * ptr = strrchr(Settings.languagefiles_path, '/');
if(ptr) ptr[1] = 0;
snprintf( newLangPath, sizeof( newLangPath ), "%s", Dir.GetFilepath(ret));
if ( !CheckFile( newLangPath ) )
snprintf(newLangPath, sizeof(newLangPath), "%s", Dir.GetFilepath(ret));
if (!CheckFile(newLangPath))
{
WindowPrompt( tr( "File not found." ), tr( "Loading standard language." ), tr( "OK" ) );
WindowPrompt(tr("File not found."), tr("Loading standard language."), tr("OK"));
Settings.LoadLanguage(NULL, APP_DEFAULT);
}
else
@ -521,7 +520,9 @@ int MenuThemeSelect()
}
else
{
HaltGui();
Theme::Load(Settings.theme_path);
ResumeGui();
}
Settings.Save();
returnVal = 1;

View File

@ -9,7 +9,8 @@
#include "network/networkops.h"
#include "utils/ResourceManager.h"
#include "usbloader/playlog.h"
#include "FontSystem.h"
#include "usbloader/wbfs.h"
#include "themes/CTheme.h"
#include "audio.h"
#include "fatmounter.h"
#include "lstub.h"
@ -77,7 +78,7 @@ void AppCleanUp(void)
gettextCleanUp();
CloseXMLDatabase();
ClearFontData();
Theme::CleanUp();
NewTitles::DestroyInstance();
DeinitNetwork();
@ -94,8 +95,7 @@ void AppCleanUp(void)
void ExitApp(void)
{
AppCleanUp();
UnmountNTFS();
UnmountEXT();
WBFS_Close();
SDCard_deInit();
USBDevice_deInit();
USB_Deinitialize();

View File

@ -28,30 +28,45 @@
#include "CTheme.h"
#include "libwiigui/gui.h"
#include "FileOperations/fileops.h"
#include "FreeTypeGX.h"
FreeTypeGX * fontSystem = NULL;
static FT_Byte * MainFont = (FT_Byte *) font_ttf;
static u32 MainFontSize = font_ttf_size;
bool Theme::ShowTooltips = true;
void Theme::SetDefault()
void Theme::CleanUp()
{
Theme::ShowTooltips = true;
ThemeCleanUp();
Resources::Clear();
ClearFontData();
}
void Theme::SetDefault()
{
ShowTooltips = true;
CleanUp();
LoadFont("");
}
bool Theme::Load(const char * theme_file_path)
{
bool result = LoadTheme(theme_file_path);
if(!result)
return result;
Theme::ShowTooltips = (thInt("1 - Enable tooltips: 0 for off and 1 for on") != 0);
char theme_path[300];
snprintf(theme_path, sizeof(theme_path), theme_file_path);
char * ptr = strrchr(theme_path, '/');
if(ptr) *ptr = '\0';
Theme::LoadFont(theme_path); //! support old font style
bool result = LoadTheme(theme_file_path);
if(!result)
return result;
Theme::ShowTooltips = (thInt("1 - Enable tooltips: 0 for off and 1 for on") != 0);
FILE * file = fopen(theme_file_path, "rb");
if(!file)
return false;
@ -85,5 +100,62 @@ bool Theme::Load(const char * theme_file_path)
snprintf(theme_path, sizeof(theme_path), "%s/%s", theme_path, Foldername);
Resources::LoadFiles(theme_path);
//! Override font.ttf with the theme font.ttf if it exists in the image folder
char FontPath[300];
snprintf(FontPath, sizeof(FontPath), "%s/font.ttf", theme_path);
if(CheckFile(FontPath))
Theme::LoadFont(theme_path);
return result;
}
bool Theme::LoadFont(const char *path)
{
char FontPath[300];
bool result = false;
FILE *pfile = NULL;
ClearFontData();
snprintf(FontPath, sizeof(FontPath), "%s/font.ttf", path);
pfile = fopen(FontPath, "rb");
if (pfile)
{
fseek(pfile, 0, SEEK_END);
MainFontSize = ftell(pfile);
rewind(pfile);
MainFont = new (std::nothrow) FT_Byte[MainFontSize];
if (!MainFont)
{
MainFont = (FT_Byte *) font_ttf;
MainFontSize = font_ttf_size;
}
else
{
fread(MainFont, 1, MainFontSize, pfile);
result = true;
}
fclose(pfile);
}
fontSystem = new FreeTypeGX(MainFont, MainFontSize);
return result;
}
void Theme::ClearFontData()
{
if (fontSystem) delete fontSystem;
fontSystem = NULL;
if (MainFont != (FT_Byte *) font_ttf)
{
if (MainFont != NULL) delete [] MainFont;
MainFont = (FT_Byte *) font_ttf;
MainFontSize = font_ttf_size;
}
}

View File

@ -14,8 +14,16 @@ class Theme
static void SetDefault();
//!Load
static bool Load(const char * path);
//!Load font data
static bool LoadFont(const char *path);
//!Clear all image/font/theme data and free the memory
static void CleanUp();
//!Enable tooltips: special case treaded because it is called every frame
static bool ShowTooltips;
private:
//!Clear the font data and free the memory
static void ClearFontData();
};
#endif

View File

@ -18,8 +18,8 @@
#define SAFE_FREE(x) if(x) { free(x); x = NULL; }
extern sec_t fs_ntfs_sec;
extern sec_t fs_ext_sec;
extern sec_t ntfs_wbfs_sec;
extern sec_t ext_wbfs_sec;
static FragList *frag_list = NULL;
@ -212,7 +212,7 @@ int get_frag_list_for_file(char *fname, u8 *id)
}
// offset to start of partition
for (j=0; j<fs->num; j++) {
fs->frag[j].sector += fs_ntfs_sec;
fs->frag[j].sector += ntfs_wbfs_sec;
}
} else if (wbfs_part_fs == PART_FS_EXT) {
ret = _EXT2_get_fragments(fname, &_frag_append, fs);
@ -222,7 +222,7 @@ int get_frag_list_for_file(char *fname, u8 *id)
}
// offset to start of partition
for (j=0; j<fs->num; j++) {
fs->frag[j].sector += fs_ext_sec;
fs->frag[j].sector += ext_wbfs_sec;
}
}
frag_concat(fa, fs);

View File

@ -71,17 +71,6 @@ s32 Wbfs::Init(u32 device)
return 0;
}
void Wbfs::Close()
{
if (hdd)
{
wbfs_close(hdd);
hdd = NULL;
}
WBFSDevice_deInit();
}
// Default behavior: can't format
s32 Wbfs::Format()
{

View File

@ -5,6 +5,9 @@
#include "usbloader/utils.h"
#include "usbloader/frag.h"
#define CACHE_SIZE 32
#define CACHED_SECTORS 64
class Wbfs
{
public:
@ -12,7 +15,6 @@ class Wbfs
void GetProgressValue(s32 * d, s32 * m);
static s32 Init(u32);
void Close();
s32 CheckGame(u8 *);
s32 GameSize(u8 *, f32 *);
wbfs_t *GetHddInfo(void);
@ -21,6 +23,7 @@ class Wbfs
virtual bool ShowFreeSpace(void);
virtual s32 Open() = 0;
virtual void Close() = 0;
virtual wbfs_disc_t* OpenDisc(u8 *discid) = 0;
virtual void CloseDisc(wbfs_disc_t *disc) = 0;
virtual s32 Format();

View File

@ -0,0 +1,37 @@
#include <ext2.h>
#include "usbloader/usbstorage2.h"
#include "wbfs_ext.h"
sec_t ext_wbfs_sec = 0;
s32 Wbfs_Ext::Open()
{
Close();
strcpy(wbfs_fs_drive, "EXT:");
if (Mounted)
return 0;
Mounted = ext2Mount("EXT", &__io_usbstorage2, lba, CACHE_SIZE, CACHED_SECTORS, EXT2_FLAG_DEFAULT);
if (!Mounted)
return -2;
ext_wbfs_sec = lba;
return 0;
}
void Wbfs_Ext::Close()
{
if (hdd)
{
wbfs_close(hdd);
hdd = NULL;
}
/* Unmount device */
ext2Unmount("EXT:/");
Mounted = false;
ext_wbfs_sec = 0;
}

View File

@ -13,12 +13,8 @@ class Wbfs_Ext: public Wbfs_Fat
{
}
virtual s32 Open()
{
strcpy(wbfs_fs_drive, "EXT:");
return MountEXT(lba);
};
virtual s32 Open();
virtual void Close();
bool ShowFreeSpace(void) { return true; };
};

View File

@ -10,10 +10,13 @@
#include <fcntl.h>
#include <sys/statvfs.h>
#include <ctype.h>
#include <fat.h>
#include "settings/CSettings.h"
#include "settings/GameTitles.h"
#include "usbloader/disc.h"
#include "usbloader/usbstorage2.h"
#include "libs/libfat/fatfile_frag.h"
#include "fatmounter.h"
#include "wbfs_fat.h"
#include "prompts/ProgressWindow.h"
@ -26,44 +29,59 @@
using namespace std;
sec_t fat_wbfs_sec = 0;
char Wbfs_Fat::wbfs_fs_drive[16];
char Wbfs_Fat::wbfs_fat_dir[16] = "/wbfs";
char Wbfs_Fat::invalid_path[] = "/\\:|<>?*\"'";
struct discHdr *Wbfs_Fat::fat_hdr_list = NULL;
u32 Wbfs_Fat::fat_hdr_count = 0;
extern "C"
{
int _FAT_get_fragments(const char *path, _frag_append_t append_fragment, void *callback_data);
extern FragList *frag_list;
}
u32 Wbfs_Fat::fat_sector_size = 512;
Wbfs_Fat::Wbfs_Fat(u32 device, u32 lba, u32 size) :
Wbfs(device, lba, size)
Wbfs(device, lba, size), Mounted(false)
{
}
s32 Wbfs_Fat::Open()
{
Close();
if (device == WBFS_DEVICE_USB && lba == fat_usb_sec)
{
strcpy(wbfs_fs_drive, "USB:");
}
else if (device == WBFS_DEVICE_SDHC && lba == fat_sd_sec)
{
strcpy(wbfs_fs_drive, "SD:");
Mounted = true;
}
else
{
if (WBFSDevice_Init(lba)) return -1;
strcpy(wbfs_fs_drive, "WBFS:");
//closing all open Files write back the cache and then shutdown em!
fatUnmount("FAT32:/");
Mounted = fatMount("FAT32", &__io_usbstorage2, lba, CACHE_SIZE, CACHED_SECTORS);
if (!Mounted)
return -1;
fat_wbfs_sec = lba;
strcpy(wbfs_fs_drive, "FAT32:");
}
return 0;
}
void Wbfs_Fat::Close()
{
if (hdd)
{
wbfs_close(hdd);
hdd = NULL;
}
fatUnmount("FAT32:/");
Mounted = false;
fat_wbfs_sec = 0;
}
wbfs_disc_t* Wbfs_Fat::OpenDisc(u8 *discid)
{
char fname[MAX_FAT_PATH];

View File

@ -13,6 +13,7 @@ class Wbfs_Fat: public Wbfs
~Wbfs_Fat();
virtual s32 Open();
virtual void Close();
wbfs_disc_t* OpenDisc(u8 *);
void CloseDisc(wbfs_disc_t *);
@ -34,6 +35,7 @@ class Wbfs_Fat: public Wbfs
protected:
static char wbfs_fs_drive[16];
bool Mounted;
private:
split_info_t split;

View File

@ -1,14 +1,44 @@
#include <ntfs.h>
#include <locale.h>
#include "wbfs_ntfs.h"
#include "fatmounter.h"
#include "libs/libntfs/ntfsfile_frag.h"
#include "usbloader/usbstorage2.h"
sec_t ntfs_wbfs_sec = 0;
s32 Wbfs_Ntfs::Open()
{
Close();
strcpy(wbfs_fs_drive, "NTFS:");
return MountNTFS(lba);
if (Mounted)
return 0;
Mounted = ntfsMount("NTFS", &__io_usbstorage2, lba, CACHE_SIZE, CACHED_SECTORS, NTFS_SHOW_HIDDEN_FILES | NTFS_RECOVER);
if (!Mounted)
return -2;
// ntfsInit() resets locals
// which breaks unicode in console
// so we change it back to C-UTF-8
setlocale(LC_CTYPE, "C-UTF-8");
setlocale(LC_MESSAGES, "C-UTF-8");
ntfs_wbfs_sec = lba;
return 0;
}
bool Wbfs_Ntfs::ShowFreeSpace(void)
void Wbfs_Ntfs::Close()
{
return true;
if (hdd)
{
wbfs_close(hdd);
hdd = NULL;
}
ntfsUnmount("NTFS:/", true);
Mounted = false;
ntfs_wbfs_sec = 0;
}

View File

@ -12,8 +12,9 @@ class Wbfs_Ntfs: public Wbfs_Fat
}
virtual s32 Open();
virtual void Close();
bool ShowFreeSpace(void);
bool ShowFreeSpace(void) { return true; };
};
#endif //_WBFS_NTFS_H

View File

@ -23,6 +23,15 @@ s32 Wbfs_Wbfs::Open()
return 0;
}
void Wbfs_Wbfs::Close()
{
if (hdd)
{
wbfs_close(hdd);
hdd = NULL;
}
}
wbfs_disc_t* Wbfs_Wbfs::OpenDisc(u8 *discid)
{
/* No device open */

View File

@ -13,6 +13,7 @@ class Wbfs_Wbfs: public Wbfs
}
s32 Open();
virtual void Close();
wbfs_disc_t* OpenDisc(u8 *);
void CloseDisc(wbfs_disc_t *);

View File

@ -69,7 +69,7 @@ int WifiGecko_Connect()
int WifiGecko_Send(const char * data, int datasize)
{
if(!WifiGecko_Connect())
if(WifiGecko_Connect() < 0)
return connection;
int ret = 0, done = 0, blocksize = 1024;