revert dimok's stuff, because it makes too many trubble

This commit is contained in:
ardi@ist-einmalig.de 2009-10-19 20:34:54 +00:00
parent 9f66829728
commit 31cd4d03e2
24 changed files with 2083 additions and 2351 deletions

File diff suppressed because it is too large Load Diff

View File

@ -156,68 +156,37 @@
#include FT_FREETYPE_H #include FT_FREETYPE_H
#include FT_BITMAP_H #include FT_BITMAP_H
#include "Metaphrasis.h" #include "Metaphrasis.h"
#include "filelist.h"
#include <malloc.h> #include <malloc.h>
#include <string.h> #include <string.h>
#include <wchar.h>
#include <map> #include <map>
#define MAX_FONT_SIZE 100 /*! forward deklaration of private structures
/*! \struct ftgxCharData_
* *
* Font face character glyph relevant data structure.
*/ */
typedef struct ftgxCharData_ {
int16_t renderOffsetX; /**< Texture X axis bearing offset. */
uint16_t glyphAdvanceX; /**< Character glyph X coordinate advance in pixels. */
uint16_t glyphIndex; /**< Charachter glyph index in the font face. */
uint16_t textureWidth; /**< Texture width in pixels/bytes. */
uint16_t textureHeight; /**< Texture glyph height in pixels/bytes. */
int16_t renderOffsetY; /**< Texture Y axis bearing offset. */
int16_t renderOffsetMax; /**< Texture Y axis bearing maximum value. */
int16_t renderOffsetMin; /**< Texture Y axis bearing minimum value. */
uint32_t* glyphDataTexture; /**< Glyph texture bitmap data buffer. */
} ftgxCharData;
/*! \struct ftgxDataOffset_
*
* Offset structure which hold both a maximum and minimum value.
*/
typedef struct ftgxDataOffset_ {
int16_t ascender; /**< Maximum data offset. */
int16_t descender; /**< Minimum data offset. */
int16_t max; /**< Maximum data offset. */
int16_t min; /**< Minimum data offset. */
} ftgxDataOffset;
typedef struct ftgxCharData_ ftgxCharData; typedef struct ftgxCharData_ ftgxCharData;
typedef struct ftgxDataOffset_ ftgxDataOffset; typedef struct ftgxDataOffset_ ftgxDataOffset;
#define _TEXT(t) L ## t /**< Unicode helper macro. */ #define _TEXT(t) L ## t /**< Unicode helper macro. */
#define FTGX_NULL 0x0000 #define FTGX_NULL 0x0000
#define FTGX_JUSTIFY_LEFT 0x0001 #define FTGX_JUSTIFY_LEFT 0x0001
#define FTGX_JUSTIFY_CENTER 0x0002 #define FTGX_JUSTIFY_CENTER 0x0002
#define FTGX_JUSTIFY_RIGHT 0x0004 #define FTGX_JUSTIFY_RIGHT 0x0003
#define FTGX_JUSTIFY_MASK 0x000f #define FTGX_JUSTIFY_MASK 0x000f
#define FTGX_ALIGN_TOP 0x0010 #define FTGX_ALIGN_TOP 0x0010
#define FTGX_ALIGN_MIDDLE 0x0020 #define FTGX_ALIGN_MIDDLE 0x0020
#define FTGX_ALIGN_BOTTOM 0x0040 #define FTGX_ALIGN_BOTTOM 0x0030
#define FTGX_ALIGN_BASELINE 0x0080 #define FTGX_ALIGN_BASELINE 0x0040
#define FTGX_ALIGN_GLYPH_TOP 0x0100 #define FTGX_ALIGN_GLYPH_TOP 0x0050
#define FTGX_ALIGN_GLYPH_MIDDLE 0x0200 #define FTGX_ALIGN_GLYPH_MIDDLE 0x0060
#define FTGX_ALIGN_GLYPH_BOTTOM 0x0400 #define FTGX_ALIGN_GLYPH_BOTTOM 0x0070
#define FTGX_ALIGN_MASK 0x0ff0 #define FTGX_ALIGN_MASK 0x00f0
#define FTGX_STYLE_UNDERLINE 0x1000 #define FTGX_STYLE_UNDERLINE 0x0100
#define FTGX_STYLE_STRIKE 0x2000 #define FTGX_STYLE_STRIKE 0x0200
#define FTGX_STYLE_MASK 0xf000 #define FTGX_STYLE_MASK 0x0f00
#define FTGX_COMPATIBILITY_DEFAULT_TEVOP_GX_MODULATE 0X0001 #define FTGX_COMPATIBILITY_DEFAULT_TEVOP_GX_MODULATE 0X0001
#define FTGX_COMPATIBILITY_DEFAULT_TEVOP_GX_DECAL 0X0002 #define FTGX_COMPATIBILITY_DEFAULT_TEVOP_GX_DECAL 0X0002
@ -234,11 +203,10 @@ typedef struct ftgxDataOffset_ ftgxDataOffset;
#define FTGX_COMPATIBILITY_GRRLIB FTGX_COMPATIBILITY_DEFAULT_TEVOP_GX_PASSCLR | FTGX_COMPATIBILITY_DEFAULT_VTXDESC_GX_NONE #define FTGX_COMPATIBILITY_GRRLIB FTGX_COMPATIBILITY_DEFAULT_TEVOP_GX_PASSCLR | FTGX_COMPATIBILITY_DEFAULT_VTXDESC_GX_NONE
#define FTGX_COMPATIBILITY_LIBWIISPRITE FTGX_COMPATIBILITY_DEFAULT_TEVOP_GX_MODULATE | FTGX_COMPATIBILITY_DEFAULT_VTXDESC_GX_DIRECT #define FTGX_COMPATIBILITY_LIBWIISPRITE FTGX_COMPATIBILITY_DEFAULT_TEVOP_GX_MODULATE | FTGX_COMPATIBILITY_DEFAULT_VTXDESC_GX_DIRECT
const GXColor ftgxWhite = (GXColor){0xff, 0xff, 0xff, 0xff}; /**< Constant color value used only to sanitize Doxygen documentation. */ const GXColor ftgxWhite = (GXColor) {
0xff, 0xff, 0xff, 0xff
wchar_t* charToWideChar(const char* p); }
bool LoadCustomFont(const char *path); ; /**< Constant color value used only to sanitize Doxygen documentation. */
void ClearFontData();
/*! \class FreeTypeGX /*! \class FreeTypeGX
* \brief Wrapper class for the libFreeType library with GX rendering. * \brief Wrapper class for the libFreeType library with GX rendering.
@ -251,56 +219,59 @@ void ClearFontData();
*/ */
class FreeTypeGX { class FreeTypeGX {
private: private:
FT_Library ftLibrary; /**< FreeType FT_Library instance. */ FT_Library ftLibrary; /**< FreeType FT_Library instance. */
FT_Face ftFace; /**< FreeType reusable FT_Face typographic object. */ FT_Face ftFace; /**< FreeType reusable FT_Face typographic object. */
FT_GlyphSlot ftSlot; /**< FreeType reusable FT_GlyphSlot glyph container object. */ FT_Byte *ftFace_fromFile;
FT_UInt ftPointSize; /**< Requested size of the rendered font. */ FT_GlyphSlot ftSlot; /**< FreeType reusable FT_GlyphSlot glyph container object. */
bool ftKerningEnabled; /**< Flag indicating the availability of font kerning data. */ FT_UInt ftPointSize; /**< Requested size of the rendered font. */
bool ftKerningEnabled; /**< Flag indicating the availability of font kerning data. */
uint8_t textureFormat; /**< Defined texture format of the target EFB. */ uint8_t textureFormat; /**< Defined texture format of the target EFB. */
uint8_t vertexIndex; /**< Vertex format descriptor index. */ uint8_t vertexIndex; /**< Vertex format descriptor index. */
uint32_t compatibilityMode; /**< Compatibility mode for default tev operations and vertex descriptors. */ uint32_t compatibilityMode; /**< Compatibility mode for default tev operations and vertex descriptors. */
std::map<wchar_t, ftgxCharData> fontData; /**< Map which holds the glyph data structures for the corresponding characters. */ std::map<wchar_t, ftgxCharData> fontData; /**< Map which holds the glyph data structures for the corresponding characters. */
static uint16_t adjustTextureWidth(uint16_t textureWidth, uint8_t textureFormat); static uint16_t adjustTextureWidth(uint16_t textureWidth, uint8_t textureFormat);
static uint16_t adjustTextureHeight(uint16_t textureHeight, uint8_t textureFormat); static uint16_t adjustTextureHeight(uint16_t textureHeight, uint8_t textureFormat);
static int16_t getStyleOffsetWidth(uint16_t width, uint16_t format); static int16_t getStyleOffsetWidth(uint16_t width, uint16_t format);
static int16_t getStyleOffsetHeight(ftgxDataOffset *offset, uint16_t format); static int16_t getStyleOffsetHeight(ftgxDataOffset *offset, uint16_t format);
void unloadFont(); void unloadFont();
ftgxCharData *cacheGlyphData(wchar_t charCode); void clearGlyphData();
uint16_t cacheGlyphDataComplete(); ftgxCharData *cacheGlyphData(wchar_t charCode);
void loadGlyphData(FT_Bitmap *bmp, ftgxCharData *charData); uint16_t cacheGlyphDataComplete();
void loadGlyphData(FT_Bitmap *bmp, ftgxCharData *charData);
void setDefaultMode(); void setDefaultMode();
void drawTextFeature(int16_t x, int16_t y, uint16_t width, ftgxDataOffset *offsetData, uint16_t format, GXColor color); void drawTextFeature(int16_t x, int16_t y, uint16_t width, ftgxDataOffset *offsetData, uint16_t format, GXColor color);
void copyTextureToFramebuffer(GXTexObj *texObj, f32 texWidth, f32 texHeight, int16_t screenX, int16_t screenY, GXColor color); void copyTextureToFramebuffer(GXTexObj *texObj, f32 texWidth, f32 texHeight, int16_t screenX, int16_t screenY, GXColor color);
void copyFeatureToFramebuffer(f32 featureWidth, f32 featureHeight, int16_t screenX, int16_t screenY, GXColor color); void copyFeatureToFramebuffer(f32 featureWidth, f32 featureHeight, int16_t screenX, int16_t screenY, GXColor color);
public: public:
FreeTypeGX(FT_UInt pixelSize, uint8_t textureFormat, uint8_t vertexIndex); FreeTypeGX(uint8_t textureFormat = GX_TF_RGBA8, uint8_t vertexIndex = GX_VTXFMT1);
FreeTypeGX(FT_UInt pixelSize, bool loadcustomfont = true, uint8_t* fontBuffer = (u8*)font_ttf, FT_Long bufferSize = font_ttf_size, uint8_t textureFormat = GX_TF_RGBA8, uint8_t vertexIndex = GX_VTXFMT1); ~FreeTypeGX();
~FreeTypeGX();
void InitFreeType(uint8_t* fontBuffer, FT_Long bufferSize, bool loadcustomfont); static wchar_t* charToWideChar(char* p);
void ChangeFontSize(FT_UInt pixelSize, FT_UInt pixelSizeHorz = 0); static wchar_t* charToWideChar(const char* p);
uint8_t GetMaxCharWidth(); void setVertexFormat(uint8_t vertexIndex);
void setCompatibilityMode(uint32_t compatibilityMode);
void setVertexFormat(uint8_t vertexIndex); uint16_t loadFont(char* fontPath, uint8_t* fontBuffer, FT_Long bufferSize, FT_UInt pointSize, bool cacheAll = false);
void setCompatibilityMode(uint32_t compatibilityMode); uint16_t loadFont(const char* fontPath, const uint8_t* fontBuffer, FT_Long bufferSize, FT_UInt pointSize, bool cacheAll = false);
void changeSize(FT_UInt vPointSize, FT_UInt hPointSize=0);
uint16_t drawText(int16_t x, int16_t y, wchar_t *text, GXColor color = ftgxWhite, uint16_t textStyling = FTGX_NULL); uint16_t drawText(int16_t x, int16_t y, wchar_t *text, GXColor color = ftgxWhite, uint16_t textStyling = FTGX_NULL);
uint16_t drawText(int16_t x, int16_t y, wchar_t const *text, GXColor color = ftgxWhite, uint16_t textStyling = FTGX_NULL); uint16_t drawText(int16_t x, int16_t y, wchar_t const *text, GXColor color = ftgxWhite, uint16_t textStyling = FTGX_NULL);
uint16_t getWidth(wchar_t *text); uint16_t getWidth(wchar_t *text);
uint16_t getWidth(wchar_t const *text); uint16_t getWidth(wchar_t const *text);
uint16_t getHeight(wchar_t *text); uint16_t getHeight(wchar_t *text);
uint16_t getHeight(wchar_t const *text); uint16_t getHeight(wchar_t const *text);
void getOffset(wchar_t *text, ftgxDataOffset* offset); ftgxDataOffset* getOffset(wchar_t *text, ftgxDataOffset* offset);
void getOffset(wchar_t const *text, ftgxDataOffset* offset); ftgxDataOffset* getOffset(wchar_t const *text, ftgxDataOffset* offset);
}; };
#endif /* FREETYPEGX_H_ */ #endif /* FREETYPEGX_H_ */

View File

@ -82,7 +82,7 @@ int CheatMenu(const char * gameID) {
GuiText titleTxt(c.getGameName().c_str(), 28, (GXColor) {0, 0, 0, 255}); GuiText titleTxt(c.getGameName().c_str(), 28, (GXColor) {0, 0, 0, 255});
titleTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); titleTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
titleTxt.SetMaxWidth(350, SCROLL_HORIZONTAL); titleTxt.SetMaxWidth(350, GuiText::SCROLL);
titleTxt.SetPosition(12,40); titleTxt.SetPosition(12,40);
for (int i = 0; i <= cntcheats; i++) { for (int i = 0; i <= cntcheats; i++) {

View File

@ -190,15 +190,15 @@ int MenuHomebrewBrowse() {
GuiImage MainButton1Img(&MainButtonImgData); GuiImage MainButton1Img(&MainButtonImgData);
GuiImage MainButton1ImgOver(&MainButtonImgOverData); GuiImage MainButton1ImgOver(&MainButtonImgOverData);
GuiText MainButton1Txt(MainButtonText, 18, (GXColor) {0, 0, 0, 255}); GuiText MainButton1Txt(MainButtonText, 18, (GXColor) {0, 0, 0, 255});
MainButton1Txt.SetMaxWidth(MainButton1Img.GetWidth()-150, DOTTED); MainButton1Txt.SetMaxWidth(MainButton1Img.GetWidth()-150, GuiText::DOTTED);
MainButton1Txt.SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE); MainButton1Txt.SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE);
MainButton1Txt.SetPosition(148, -12); MainButton1Txt.SetPosition(148, -12);
GuiText MainButton1DescTxt(MainButtonText, 18, (GXColor) {0, 0, 0, 255}); GuiText MainButton1DescTxt(MainButtonText, 18, (GXColor) {0, 0, 0, 255});
MainButton1DescTxt.SetMaxWidth(MainButton1Img.GetWidth()-150, DOTTED); MainButton1DescTxt.SetMaxWidth(MainButton1Img.GetWidth()-150, GuiText::DOTTED);
MainButton1DescTxt.SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE); MainButton1DescTxt.SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE);
MainButton1DescTxt.SetPosition(148, 15); MainButton1DescTxt.SetPosition(148, 15);
GuiText MainButton1DescOverTxt(MainButtonText, 18, (GXColor) { 0, 0, 0, 255}); GuiText MainButton1DescOverTxt(MainButtonText, 18, (GXColor) { 0, 0, 0, 255});
MainButton1DescOverTxt.SetMaxWidth(MainButton1Img.GetWidth()-150, SCROLL_HORIZONTAL); MainButton1DescOverTxt.SetMaxWidth(MainButton1Img.GetWidth()-150, GuiText::SCROLL);
MainButton1DescOverTxt.SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE); MainButton1DescOverTxt.SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE);
MainButton1DescOverTxt.SetPosition(148, 15); MainButton1DescOverTxt.SetPosition(148, 15);
GuiButton MainButton1(MainButton1Img.GetWidth(), MainButton1Img.GetHeight()); GuiButton MainButton1(MainButton1Img.GetWidth(), MainButton1Img.GetHeight());
@ -219,15 +219,15 @@ int MenuHomebrewBrowse() {
GuiText MainButton2Txt(MainButtonText, 18, (GXColor) {0, 0, 0, 255 }); GuiText MainButton2Txt(MainButtonText, 18, (GXColor) {0, 0, 0, 255 });
MainButton2Txt.SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE); MainButton2Txt.SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE);
MainButton2Txt.SetPosition(148, -12); MainButton2Txt.SetPosition(148, -12);
MainButton2Txt.SetMaxWidth(MainButton2Img.GetWidth()-150, DOTTED); MainButton2Txt.SetMaxWidth(MainButton2Img.GetWidth()-150, GuiText::DOTTED);
GuiText MainButton2DescTxt(MainButtonText, 18, (GXColor) { 0, 0, 0, 255}); GuiText MainButton2DescTxt(MainButtonText, 18, (GXColor) { 0, 0, 0, 255});
MainButton2DescTxt.SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE); MainButton2DescTxt.SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE);
MainButton2DescTxt.SetPosition(148, 15); MainButton2DescTxt.SetPosition(148, 15);
MainButton2DescTxt.SetMaxWidth(MainButton2Img.GetWidth()-150, DOTTED); MainButton2DescTxt.SetMaxWidth(MainButton2Img.GetWidth()-150, GuiText::DOTTED);
GuiText MainButton2DescOverTxt(MainButtonText, 18, (GXColor) {0, 0, 0, 255}); GuiText MainButton2DescOverTxt(MainButtonText, 18, (GXColor) {0, 0, 0, 255});
MainButton2DescOverTxt.SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE); MainButton2DescOverTxt.SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE);
MainButton2DescOverTxt.SetPosition(148, 15); MainButton2DescOverTxt.SetPosition(148, 15);
MainButton2DescOverTxt.SetMaxWidth(MainButton2Img.GetWidth()-150, SCROLL_HORIZONTAL); MainButton2DescOverTxt.SetMaxWidth(MainButton2Img.GetWidth()-150, GuiText::SCROLL);
GuiButton MainButton2(MainButton2Img.GetWidth(), MainButton2Img.GetHeight()); GuiButton MainButton2(MainButton2Img.GetWidth(), MainButton2Img.GetHeight());
MainButton2.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); MainButton2.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
MainButton2.SetPosition(0, 160); MainButton2.SetPosition(0, 160);
@ -246,15 +246,15 @@ int MenuHomebrewBrowse() {
GuiText MainButton3Txt(MainButtonText, 18, (GXColor) {0, 0, 0, 255}); GuiText MainButton3Txt(MainButtonText, 18, (GXColor) {0, 0, 0, 255});
MainButton3Txt.SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE); MainButton3Txt.SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE);
MainButton3Txt.SetPosition(148, -12); MainButton3Txt.SetPosition(148, -12);
MainButton3Txt.SetMaxWidth(MainButton3Img.GetWidth()-150, DOTTED); MainButton3Txt.SetMaxWidth(MainButton3Img.GetWidth()-150, GuiText::DOTTED);
GuiText MainButton3DescTxt(MainButtonText, 18, (GXColor) { 0, 0, 0, 255}); GuiText MainButton3DescTxt(MainButtonText, 18, (GXColor) { 0, 0, 0, 255});
MainButton3DescTxt.SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE); MainButton3DescTxt.SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE);
MainButton3DescTxt.SetPosition(148, 15); MainButton3DescTxt.SetPosition(148, 15);
MainButton3DescTxt.SetMaxWidth(MainButton3Img.GetWidth()-150, DOTTED); MainButton3DescTxt.SetMaxWidth(MainButton3Img.GetWidth()-150, GuiText::DOTTED);
GuiText MainButton3DescOverTxt(MainButtonText, 18, (GXColor) {0, 0, 0, 255 }); GuiText MainButton3DescOverTxt(MainButtonText, 18, (GXColor) {0, 0, 0, 255 });
MainButton3DescOverTxt.SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE); MainButton3DescOverTxt.SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE);
MainButton3DescOverTxt.SetPosition(148, 15); MainButton3DescOverTxt.SetPosition(148, 15);
MainButton3DescOverTxt.SetMaxWidth(MainButton3Img.GetWidth()-150, SCROLL_HORIZONTAL); MainButton3DescOverTxt.SetMaxWidth(MainButton3Img.GetWidth()-150, GuiText::SCROLL);
GuiButton MainButton3(MainButton3Img.GetWidth(), MainButton3Img.GetHeight()); GuiButton MainButton3(MainButton3Img.GetWidth(), MainButton3Img.GetHeight());
MainButton3.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); MainButton3.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
MainButton3.SetPosition(0, 230); MainButton3.SetPosition(0, 230);
@ -273,15 +273,15 @@ int MenuHomebrewBrowse() {
GuiText MainButton4Txt(MainButtonText, 18, (GXColor) {0, 0, 0, 255} ); GuiText MainButton4Txt(MainButtonText, 18, (GXColor) {0, 0, 0, 255} );
MainButton4Txt.SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE); MainButton4Txt.SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE);
MainButton4Txt.SetPosition(148, -12); MainButton4Txt.SetPosition(148, -12);
MainButton4Txt.SetMaxWidth(MainButton4Img.GetWidth()-150, DOTTED); MainButton4Txt.SetMaxWidth(MainButton4Img.GetWidth()-150, GuiText::DOTTED);
GuiText MainButton4DescTxt(MainButtonText, 18, (GXColor) {0, 0, 0, 255}); GuiText MainButton4DescTxt(MainButtonText, 18, (GXColor) {0, 0, 0, 255});
MainButton4DescTxt.SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE); MainButton4DescTxt.SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE);
MainButton4DescTxt.SetPosition(148, 15); MainButton4DescTxt.SetPosition(148, 15);
MainButton4DescTxt.SetMaxWidth(MainButton4Img.GetWidth()-150, DOTTED); MainButton4DescTxt.SetMaxWidth(MainButton4Img.GetWidth()-150, GuiText::DOTTED);
GuiText MainButton4DescOverTxt(MainButtonText, 18, (GXColor) { 0, 0, 0, 255}); GuiText MainButton4DescOverTxt(MainButtonText, 18, (GXColor) { 0, 0, 0, 255});
MainButton4DescOverTxt.SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE); MainButton4DescOverTxt.SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE);
MainButton4DescOverTxt.SetPosition(148, 15); MainButton4DescOverTxt.SetPosition(148, 15);
MainButton4DescOverTxt.SetMaxWidth(MainButton4Img.GetWidth()-150, SCROLL_HORIZONTAL ); MainButton4DescOverTxt.SetMaxWidth(MainButton4Img.GetWidth()-150, GuiText::SCROLL);
GuiButton MainButton4(MainButton4Img.GetWidth(), MainButton4Img.GetHeight()); GuiButton MainButton4(MainButton4Img.GetWidth(), MainButton4Img.GetHeight());
MainButton4.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); MainButton4.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
MainButton4.SetPosition(0, 300); MainButton4.SetPosition(0, 300);
@ -838,29 +838,29 @@ int MenuHomebrewBrowse() {
read += result; read += result;
} }
char filename[101]; char filename[101];
if (!error) { if (!error) {
network_read((u8*) &filename, 100); network_read((u8*) &filename, 100);
// Do we need to unzip this thing? // Do we need to unzip this thing?
if (wiiloadVersion[0] > 0 || wiiloadVersion[1] > 4) { if (wiiloadVersion[0] > 0 || wiiloadVersion[1] > 4) {
// We need to unzip... // We need to unzip...
if (temp[0] == 'P' && temp[1] == 'K' && temp[2] == 0x03 && temp[3] == 0x04) { if (temp[0] == 'P' && temp[1] == 'K' && temp[2] == 0x03 && temp[3] == 0x04) {
// It's a zip file, unzip to the apps directory // It's a zip file, unzip to the apps directory
// Zip archive, ask for permission to install the zip // Zip archive, ask for permission to install the zip
char zippath[255]; char zippath[255];
sprintf((char *) &zippath, "%s%s", Settings.homebrewapps_path, filename); sprintf((char *) &zippath, "%s%s", Settings.homebrewapps_path, filename);
FILE *fp = fopen(zippath, "wb"); FILE *fp = fopen(zippath, "wb");
if (fp != NULL) if (fp != NULL)
{ {
fwrite(temp, 1, infilesize, fp); fwrite(temp, 1, infilesize, fp);
fclose(fp); fclose(fp);
// Now unzip the zip file... // Now unzip the zip file...
unzFile uf = unzOpen(zippath); unzFile uf = unzOpen(zippath);
if (uf==NULL) { if (uf==NULL) {
@ -868,9 +868,9 @@ int MenuHomebrewBrowse() {
} else { } else {
extractZip(uf,0,1,0, Settings.homebrewapps_path); extractZip(uf,0,1,0, Settings.homebrewapps_path);
unzCloseCurrentFile(uf); unzCloseCurrentFile(uf);
remove(zippath); remove(zippath);
// Reload this menu here... // Reload this menu here...
menu = MENU_HOMEBREWBROWSE; menu = MENU_HOMEBREWBROWSE;
break; break;
@ -884,17 +884,17 @@ int MenuHomebrewBrowse() {
uLongf f = uncfilesize; uLongf f = uncfilesize;
error = uncompress(unc, &f, temp, infilesize) != Z_OK; error = uncompress(unc, &f, temp, infilesize) != Z_OK;
uncfilesize = f; uncfilesize = f;
free(temp); free(temp);
temp = unc; temp = unc;
} }
} }
if (!error && strstr(filename,".zip") == NULL) { if (!error && strstr(filename,".zip") == NULL) {
innetbuffer = temp; innetbuffer = temp;
} }
} }
ProgressStop(); ProgressStop();
if (error || read != infilesize) { if (error || read != infilesize) {

View File

@ -47,14 +47,13 @@
#include "input.h" #include "input.h"
#include "oggplayer.h" #include "oggplayer.h"
extern FreeTypeGX *fontSystem[]; extern FreeTypeGX *fontSystem;
#define SCROLL_INITIAL_DELAY 20 #define SCROLL_INITIAL_DELAY 20
#define SCROLL_LOOP_DELAY 3 #define SCROLL_LOOP_DELAY 3
#define PAGESIZE 9 #define PAGESIZE 9
#define FILEBROWSERSIZE 8 #define FILEBROWSERSIZE 8
#define MAX_OPTIONS 170 #define MAX_OPTIONS 170
#define MAX_LINES_TO_DRAW 30
typedef void (*UpdateCallback)(void * e); typedef void (*UpdateCallback)(void * e);
@ -91,16 +90,6 @@ enum
IMAGE_COPY IMAGE_COPY
}; };
enum
{
NONE,
WRAP,
LONGTEXT,
DOTTED,
SCROLL_HORIZONTAL,
SCROLL_NONE
};
enum enum
{ {
TRIGGER_SIMPLE, TRIGGER_SIMPLE,
@ -710,8 +699,8 @@ class GuiText : public GuiElement
//!Sets the text of the GuiText element //!Sets the text of the GuiText element
//!\param t Text //!\param t Text
void SetText(const char * t); void SetText(const char * t);
void SetText(const wchar_t * t);
void SetTextf(const char *format, ...) __attribute__((format(printf,2,3))); void SetTextf(const char *format, ...) __attribute__((format(printf,2,3)));
void SetText(const wchar_t * t);
//!Sets up preset values to be used by GuiText(t) //!Sets up preset values to be used by GuiText(t)
//!Useful when printing multiple text elements, all with the same attributes set //!Useful when printing multiple text elements, all with the same attributes set
//!\param sz Font size //!\param sz Font size
@ -721,30 +710,28 @@ class GuiText : public GuiElement
//!\param s Font style //!\param s Font style
//!\param h Text alignment (horizontal) //!\param h Text alignment (horizontal)
//!\param v Text alignment (vertical) //!\param v Text alignment (vertical)
void SetPresets(int sz, GXColor c, int w, u16 s, int h, int v); static void SetPresets(int sz, GXColor c, int w, int wrap, u16 s, int h, int v);
//!Sets the font size //!Sets the font size
//!\param s Font size //!\param s Font size
void SetFontSize(int s); void SetFontSize(int s);
//!Sets the first line to draw (default = 0)
//!\param line
void SetFirstLine(int line);
//!Sets max lines to draw
//!\param lines
void SetLinesToDraw(int lines);
//!Gets the total line number
int GetTotalLines();
//!Sets the maximum width of the drawn texture image //!Sets the maximum width of the drawn texture image
//!If the text exceeds this, it is wrapped to the next line //!If the text exceeds this, it is wrapped to the next line
//!\param w Maximum width //!\param w Maximum width
//!\param m WrapMode //!\param m WrapMode
void SetMaxWidth(int w = 0, int m = WRAP); enum {
WRAP,
DOTTED,
SCROLL,
MARQUEE
};
void SetMaxWidth(int w, short m=GuiText::WRAP);
//!Sets the font color //!Sets the font color
//!\param c Font color //!\param c Font color
void SetColor(GXColor c); void SetColor(GXColor c);
//!Sets the FreeTypeGX style attributes //!Sets the FreeTypeGX style attributes
//!\param s Style attributes //!\param s Style attributes
//!\param m Style-Mask attributes //!\param m Style-Mask attributes
void SetStyle(u16 s); void SetStyle(u16 s, u16 m=0xffff);
//!Sets the text alignment //!Sets the text alignment
//!\param hor Horizontal alignment (ALIGN_LEFT, ALIGN_RIGHT, ALIGN_CENTRE) //!\param hor Horizontal alignment (ALIGN_LEFT, ALIGN_RIGHT, ALIGN_CENTRE)
//!\param vert Vertical alignment (ALIGN_TOP, ALIGN_BOTTOM, ALIGN_MIDDLE) //!\param vert Vertical alignment (ALIGN_TOP, ALIGN_BOTTOM, ALIGN_MIDDLE)
@ -754,37 +741,33 @@ class GuiText : public GuiElement
void SetFont(FreeTypeGX *f); void SetFont(FreeTypeGX *f);
//!Get the Horizontal Size of Text //!Get the Horizontal Size of Text
int GetTextWidth(); int GetTextWidth();
//!Get the offset of a linebreak // not NULL set horizontal scale to 0.75 //added
u32 GetLineBreakOffset(int line);
//!Change the font
//!\param font bufferblock
//!\param font filesize
bool SetFont(const u8 *font, const u32 filesize);
//!SetWidescreen
void SetWidescreen(bool w); void SetWidescreen(bool w);
void SetNumLines(int n);//! these two are used to set the first line and numLine
void SetFirstLine(int n);
int GetNumLines();//! these return the line variables for this text
int GetFirstLine();
int GetLineHeight(int n);//! returns the height of the #n of lines including spacing if wrap mode is on
int GetTotalLines();
//!Constantly called to draw the text //!Constantly called to draw the text
void Draw(); void Draw();
protected: protected:
wchar_t *text; wchar_t* text; //!< Unicode text value
wchar_t *textDyn; //!< Wrapped text value
wchar_t *textDynRow[MAX_LINES_TO_DRAW]; //!< Wrapped lines text values
char *origText; //!< Original text data
int wrapMode; //!< Wrapping toggle
int textScrollPos; //!< Current starting index of text string for scrolling
int textScrollInitialDelay; //!< Delay to wait before starting to scroll
int textScrollDelay; //!< Scrolling speed
int size; //!< Font size int size; //!< Font size
int maxWidth; //!< Maximum width of the generated text object (for text wrapping) int maxWidth; //!< Maximum width of the generated text object (for text wrapping)
short wrapMode;
short scrollPos1;
short scrollPos2;
short scrollOffset;
u32 scrollDelay;
u16 style; //!< FreeTypeGX style attributes u16 style; //!< FreeTypeGX style attributes
GXColor color; //!< Font color GXColor color; //!< Font color
FreeTypeGX *font; FreeTypeGX *font;
bool widescreen; //added short widescreen; //added
int firstLine; //!these are default until the text is drawn
int linestodraw; int firstLine; //!these are the first line and the number of lines drawn when the text is wrapped
int totalLines; int numLines;//! default is -1 and it means that all lines are drawn
int textWidth; int totalLines; //!this is the total # of lines when in wrap mode
int currentSize;
u32 *LineBreak;
}; };
//!Display, manage, and manipulate tooltips in the GUI. //!Display, manage, and manipulate tooltips in the GUI.
@ -997,7 +980,6 @@ class GuiKeyboard : public GuiWindow
GuiTrigger * trigB; GuiTrigger * trigB;
}; };
typedef struct _optionlist { typedef struct _optionlist {
int length; int length;
char name[MAX_OPTIONS][60]; char name[MAX_OPTIONS][60];

View File

@ -187,7 +187,7 @@ GuiCustomOptionBrowser::GuiCustomOptionBrowser(int w, int h, customOptionList *
optionTxt[i] = new GuiText(options->GetName(i), 20, THEME.settingstext); optionTxt[i] = new GuiText(options->GetName(i), 20, THEME.settingstext);
optionTxt[i]->SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE); optionTxt[i]->SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE);
optionTxt[i]->SetPosition(24,0); optionTxt[i]->SetPosition(24,0);
optionTxt[i]->SetMaxWidth(bgOptionsImg->GetWidth() - (coL2+24), DOTTED); optionTxt[i]->SetMaxWidth(bgOptionsImg->GetWidth() - (coL2+24), GuiText::DOTTED);
optionBg[i] = new GuiImage(bgOptionsEntry); optionBg[i] = new GuiImage(bgOptionsEntry);
@ -424,10 +424,10 @@ void GuiCustomOptionBrowser::UpdateListEntries()
if(optionBtn[i]->GetState() != STATE_DISABLED) if(optionBtn[i]->GetState() != STATE_DISABLED)
{ {
optionVal[i]->SetPosition(coL2,0); optionVal[i]->SetPosition(coL2,0);
optionVal[i]->SetMaxWidth(bgOptionsImg->GetWidth() - (coL2+24), DOTTED); optionVal[i]->SetMaxWidth(bgOptionsImg->GetWidth() - (coL2+24), GuiText::DOTTED);
optionValOver[i]->SetPosition(coL2,0); optionValOver[i]->SetPosition(coL2,0);
optionValOver[i]->SetMaxWidth(bgOptionsImg->GetWidth() - (coL2+24), SCROLL_HORIZONTAL); optionValOver[i]->SetMaxWidth(bgOptionsImg->GetWidth() - (coL2+24), GuiText::SCROLL);
} }
} }
} }

View File

@ -111,12 +111,12 @@ GuiFileBrowser::GuiFileBrowser(int w, int h)
fileListText[i] = new GuiText(NULL,20, (GXColor){0, 0, 0, 0xff}); fileListText[i] = new GuiText(NULL,20, (GXColor){0, 0, 0, 0xff});
fileListText[i]->SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE); fileListText[i]->SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE);
fileListText[i]->SetPosition(5,0); fileListText[i]->SetPosition(5,0);
fileListText[i]->SetMaxWidth(bgFileSelectionImg->GetWidth() - (arrowDownImg->GetWidth()+20), DOTTED); fileListText[i]->SetMaxWidth(bgFileSelectionImg->GetWidth() - (arrowDownImg->GetWidth()+20), GuiText::DOTTED);
fileListTextOver[i] = new GuiText(NULL,20, (GXColor){0, 0, 0, 0xff}); fileListTextOver[i] = new GuiText(NULL,20, (GXColor){0, 0, 0, 0xff});
fileListTextOver[i]->SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE); fileListTextOver[i]->SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE);
fileListTextOver[i]->SetPosition(5,0); fileListTextOver[i]->SetPosition(5,0);
fileListTextOver[i]->SetMaxWidth(bgFileSelectionImg->GetWidth() - (arrowDownImg->GetWidth()+20), SCROLL_HORIZONTAL); fileListTextOver[i]->SetMaxWidth(bgFileSelectionImg->GetWidth() - (arrowDownImg->GetWidth()+20), GuiText::SCROLL);
fileListBg[i] = new GuiImage(bgFileSelectionEntry); fileListBg[i] = new GuiImage(bgFileSelectionEntry);
//fileListArchives[i] = new GuiImage(fileArchives); //fileListArchives[i] = new GuiImage(fileArchives);

View File

@ -127,13 +127,13 @@ GuiGameBrowser::GuiGameBrowser(int w, int h, struct discHdr * l, int gameCnt, co
gameTxt[i] = new GuiText(get_title(&gameList[i]), 20, THEME.gametext); gameTxt[i] = new GuiText(get_title(&gameList[i]), 20, THEME.gametext);
gameTxt[i]->SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE); gameTxt[i]->SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE);
gameTxt[i]->SetPosition(24,0); gameTxt[i]->SetPosition(24,0);
gameTxt[i]->SetMaxWidth(maxTextWidth, DOTTED); gameTxt[i]->SetMaxWidth(maxTextWidth, GuiText::DOTTED);
gameTxtOver[i] = new GuiText(get_title(&gameList[i]), 20, THEME.gametext); gameTxtOver[i] = new GuiText(get_title(&gameList[i]), 20, THEME.gametext);
gameTxtOver[i]->SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE); gameTxtOver[i]->SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE);
gameTxtOver[i]->SetPosition(24,0); gameTxtOver[i]->SetPosition(24,0);
gameTxtOver[i]->SetMaxWidth(maxTextWidth, SCROLL_HORIZONTAL); gameTxtOver[i]->SetMaxWidth(maxTextWidth, GuiText::SCROLL);
gameBg[i] = new GuiImage(bgGamesEntry); gameBg[i] = new GuiImage(bgGamesEntry);

View File

@ -111,7 +111,7 @@ noCover(nocover_png)
gamename->SetParent(this); gamename->SetParent(this);
gamename->SetAlignment(ALIGN_CENTRE, ALIGN_TOP); gamename->SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
gamename->SetPosition(0, 330); gamename->SetPosition(0, 330);
gamename->SetMaxWidth(280, DOTTED); gamename->SetMaxWidth(280, GuiText::DOTTED);
gameIndex = new int[pagesize]; gameIndex = new int[pagesize];
game = new GuiButton * [pagesize]; game = new GuiButton * [pagesize];

View File

@ -69,8 +69,8 @@ sndClick(button_click_pcm, button_click_pcm_size, SOUND_PCM, Settings.sfxvolume)
text.SetText(gameFilter); text.SetText(gameFilter);
text.SetPosition(10, 15); text.SetPosition(10, 15);
text.SetAlignment(ALIGN_LEFT, ALIGN_TOP); text.SetAlignment(ALIGN_LEFT, ALIGN_TOP);
//text.SetWidescreen(CFG.widescreen); text.SetWidescreen(CFG.widescreen);
text.SetMaxWidth(width-(10+2*42+10), SCROLL_HORIZONTAL); text.SetMaxWidth(width-(10+2*42+10), GuiText::SCROLL);
this->Append(&text); this->Append(&text);
snprintf(imgPath, sizeof(imgPath), "%skeyboard_backspace_over.png", CFG.theme_path); snprintf(imgPath, sizeof(imgPath), "%skeyboard_backspace_over.png", CFG.theme_path);

File diff suppressed because it is too large Load Diff

View File

@ -41,10 +41,18 @@
#define CONSOLE_WIDTH 340 #define CONSOLE_WIDTH 340
#define CONSOLE_HEIGHT 218 #define CONSOLE_HEIGHT 218
FreeTypeGX *fontSystem=0;
FreeTypeGX *fontClock=0;
static void BootUpProblems() static void BootUpProblems()
{ {
s32 ret2; s32 ret2;
// load main font from file, or default to built-in font
fontSystem = new FreeTypeGX();
fontSystem->loadFont(NULL, font_ttf, font_ttf_size, 0);
fontSystem->setCompatibilityMode(FTGX_COMPATIBILITY_DEFAULT_TEVOP_GX_PASSCLR | FTGX_COMPATIBILITY_DEFAULT_VTXDESC_GX_NONE);
GuiImageData bootimageData(gxlogo_png); GuiImageData bootimageData(gxlogo_png);
GuiImage bootimage(&bootimageData); GuiImage bootimage(&bootimageData);
GuiText boottext(NULL, 20, (GXColor) {255, 255, 255, 255}); GuiText boottext(NULL, 20, (GXColor) {255, 255, 255, 255});
@ -64,7 +72,7 @@ static void BootUpProblems()
ret2 = IOS_ReloadIOS(249); ret2 = IOS_ReloadIOS(249);
if (ret2 < 0) { if (ret2 < 0) {
ret2 = IOS_ReloadIOS(222); ret2 = IOS_ReloadIOS(222);
SDCard_Init(); SDCard_Init();
load_ehc_module(); load_ehc_module();
SDCard_deInit(); SDCard_deInit();
if(ret2 <0) { if(ret2 <0) {
@ -103,6 +111,12 @@ static void BootUpProblems()
Menu_Render(); Menu_Render();
SYS_ResetSystem(SYS_RETURNTOMENU, 0, 0); SYS_ResetSystem(SYS_RETURNTOMENU, 0, 0);
} }
///delete font to load up custom if set
if(fontSystem) {
delete fontSystem;
fontSystem = NULL;
}
} }
@ -111,9 +125,6 @@ main(int argc, char *argv[]) {
setlocale(LC_ALL, "en.UTF-8"); setlocale(LC_ALL, "en.UTF-8");
for(int i = 0; i < MAX_FONT_SIZE+1; i++)
fontSystem[i] = NULL;
s32 ret; s32 ret;
bool startupproblem = false; bool startupproblem = false;
@ -128,14 +139,14 @@ main(int argc, char *argv[]) {
/** PAD_Init has to be before InitVideo don't move that **/ /** PAD_Init has to be before InitVideo don't move that **/
PAD_Init(); // initialize PAD/WPAD PAD_Init(); // initialize PAD/WPAD
USBDevice_Init();// seems enough to wake up some HDDs if they are in sleep mode when the loader starts (tested with WD MyPassport Essential 2.5") USBDevice_Init();// seems enough to wake up some HDDs if they are in sleep mode when the loader starts (tested with WD MyPassport Essential 2.5")
ret = IOS_ReloadIOS(249); ret = IOS_ReloadIOS(249);
if (ret < 0) { if (ret < 0) {
ret = IOS_ReloadIOS(222); ret = IOS_ReloadIOS(222);
SDCard_Init(); SDCard_Init();
load_ehc_module(); load_ehc_module();
SDCard_deInit(); SDCard_deInit();
if(ret <0) { if(ret <0) {
@ -149,7 +160,7 @@ main(int argc, char *argv[]) {
if (ret < 0) { if (ret < 0) {
ret = IOS_ReloadIOS(222); ret = IOS_ReloadIOS(222);
SDCard_Init(); SDCard_Init();
load_ehc_module(); load_ehc_module();
SDCard_deInit(); SDCard_deInit();
if(ret < 0) { if(ret < 0) {
@ -230,11 +241,18 @@ main(int argc, char *argv[]) {
WPAD_SetDataFormat(WPAD_CHAN_ALL,WPAD_FMT_BTNS_ACC_IR); WPAD_SetDataFormat(WPAD_CHAN_ALL,WPAD_FMT_BTNS_ACC_IR);
WPAD_SetVRes(WPAD_CHAN_ALL, screenwidth, screenheight); WPAD_SetVRes(WPAD_CHAN_ALL, screenwidth, screenheight);
// load main font from file, or default to built-in font
fontSystem = new FreeTypeGX();
char *fontPath = NULL; char *fontPath = NULL;
asprintf(&fontPath, "%sfont.ttf", CFG.theme_path); asprintf(&fontPath, "%sfont.ttf", CFG.theme_path);
LoadCustomFont(fontPath); fontSystem->loadFont(fontPath, font_ttf, font_ttf_size, 0);
fontSystem->setCompatibilityMode(FTGX_COMPATIBILITY_DEFAULT_TEVOP_GX_PASSCLR | FTGX_COMPATIBILITY_DEFAULT_VTXDESC_GX_NONE);
free(fontPath); free(fontPath);
fontClock = new FreeTypeGX();
fontClock->loadFont(NULL, clock_ttf, clock_ttf_size, 0);
fontClock->setCompatibilityMode(FTGX_COMPATIBILITY_DEFAULT_TEVOP_GX_PASSCLR | FTGX_COMPATIBILITY_DEFAULT_VTXDESC_GX_NONE);
InitGUIThreads(); InitGUIThreads();
MainMenu(MENU_CHECK); MainMenu(MENU_CHECK);
return 0; return 0;

View File

@ -8,8 +8,11 @@
#ifndef _MAIN_H_ #ifndef _MAIN_H_
#define _MAIN_H_ #define _MAIN_H_
#include "FreeTypeGX.h"
extern struct SSettings Settings; extern struct SSettings Settings;
void DefaultSettings(); void DefaultSettings();
extern FreeTypeGX *fontSystem;
#endif #endif

View File

@ -213,7 +213,7 @@ void ExitGUIThreads() {
} }
void rockout(int f = 0) { void rockout(int f = 0) {
HaltGui(); HaltGui();
int num=(f==2?-1:gameSelected); int num=(f==2?-1:gameSelected);
@ -270,7 +270,7 @@ GuiImageData *LoadCoverImage(struct discHdr *header, bool Prefere3D, bool noCove
{ {
char *coverPath = flag ? Settings.covers_path : Settings.covers2d_path; flag = !flag; char *coverPath = flag ? Settings.covers_path : Settings.covers2d_path; flag = !flag;
//Load full id image //Load full id image
snprintf(Path, sizeof(Path), "%s%s.png", coverPath, IDfull); snprintf(Path, sizeof(Path), "%s%s.png", coverPath, IDfull);
delete Cover; Cover = new(std::nothrow) GuiImageData(Path, NULL); delete Cover; Cover = new(std::nothrow) GuiImageData(Path, NULL);
//Load short id image //Load short id image
if (!Cover || !Cover->GetImage()) if (!Cover || !Cover->GetImage())
@ -329,7 +329,6 @@ int MenuDiscList() {
int dataed = -1; int dataed = -1;
int cosa=0,sina=0; int cosa=0,sina=0;
int selectImg1 = 0; int selectImg1 = 0;
bool firstRun = true;
char ID[4]; char ID[4];
char IDfull[7]; char IDfull[7];
u32 covert = 0; u32 covert = 0;
@ -337,7 +336,7 @@ int MenuDiscList() {
if (!dvdheader) if (!dvdheader)
dvdheader = new struct discHdr; dvdheader = new struct discHdr;
u8 mountMethodOLD =0; u8 mountMethodOLD =0;
WDVD_GetCoverStatus(&covert); WDVD_GetCoverStatus(&covert);
u32 covertOld=covert; u32 covertOld=covert;
@ -469,19 +468,19 @@ int MenuDiscList() {
GuiText usedSpaceTxt(spaceinfo, 18, THEME.info); GuiText usedSpaceTxt(spaceinfo, 18, THEME.info);
usedSpaceTxt.SetAlignment(THEME.hddinfo_align, ALIGN_TOP); usedSpaceTxt.SetAlignment(THEME.hddinfo_align, ALIGN_TOP);
usedSpaceTxt.SetPosition(THEME.hddinfo_x, THEME.hddinfo_y); usedSpaceTxt.SetPosition(THEME.hddinfo_x, THEME.hddinfo_y);
char GamesCnt[15]; char GamesCnt[15];
sprintf(GamesCnt,"%s: %i",(mountMethod!=3?tr("Games"):tr("Channels")), gameCnt); sprintf(GamesCnt,"%s: %i",(mountMethod!=3?tr("Games"):tr("Channels")), gameCnt);
GuiText gamecntTxt(GamesCnt, 18, THEME.info); GuiText gamecntTxt(GamesCnt, 18, THEME.info);
GuiButton gamecntBtn(100,18); GuiButton gamecntBtn(100,18);
gamecntBtn.SetAlignment(THEME.gamecount_align, ALIGN_TOP); gamecntBtn.SetAlignment(THEME.gamecount_align, ALIGN_TOP);
gamecntBtn.SetPosition(THEME.gamecount_x,THEME.gamecount_y); gamecntBtn.SetPosition(THEME.gamecount_x,THEME.gamecount_y);
gamecntBtn.SetLabel(&gamecntTxt); gamecntBtn.SetLabel(&gamecntTxt);
gamecntBtn.SetEffectGrow(); gamecntBtn.SetEffectGrow();
gamecntBtn.SetTrigger(&trigA); gamecntBtn.SetTrigger(&trigA);
GuiTooltip installBtnTT(tr("Install a game")); GuiTooltip installBtnTT(tr("Install a game"));
if (Settings.wsprompt == yes) if (Settings.wsprompt == yes)
@ -745,18 +744,18 @@ int MenuDiscList() {
idBtn.SetAlignment(ALIGN_LEFT, ALIGN_TOP); idBtn.SetAlignment(ALIGN_LEFT, ALIGN_TOP);
idBtn.SetPosition(THEME.id_x,THEME.id_y); idBtn.SetPosition(THEME.id_x,THEME.id_y);
if (Settings.godmode == 1 && mountMethod!=3) {//only make the button have trigger & tooltip if in godmode if (Settings.godmode == 1 && mountMethod!=3) {//only make the button have trigger & tooltip if in godmode
DownloadBtn.SetSoundOver(&btnSoundOver); DownloadBtn.SetSoundOver(&btnSoundOver);
DownloadBtn.SetTrigger(&trigA); DownloadBtn.SetTrigger(&trigA);
DownloadBtn.SetTrigger(&trig1); DownloadBtn.SetTrigger(&trig1);
DownloadBtn.SetToolTip(&DownloadBtnTT,205,-30); DownloadBtn.SetToolTip(&DownloadBtnTT,205,-30);
idBtn.SetSoundOver(&btnSoundOver); idBtn.SetSoundOver(&btnSoundOver);
idBtn.SetTrigger(&trigA); idBtn.SetTrigger(&trigA);
idBtn.SetToolTip(&IDBtnTT,205,-30); idBtn.SetToolTip(&IDBtnTT,205,-30);
} else } else
{ {
DownloadBtn.SetRumble(false); DownloadBtn.SetRumble(false);
@ -784,11 +783,11 @@ int MenuDiscList() {
GuiText clockTimeBack("88:88", 40, (GXColor) {THEME.clock.r, THEME.clock.g, THEME.clock.b, THEME.clock.a/6}); GuiText clockTimeBack("88:88", 40, (GXColor) {THEME.clock.r, THEME.clock.g, THEME.clock.b, THEME.clock.a/6});
clockTimeBack.SetAlignment(THEME.clock_align, ALIGN_TOP); clockTimeBack.SetAlignment(THEME.clock_align, ALIGN_TOP);
clockTimeBack.SetPosition(THEME.clock_x, THEME.clock_y); clockTimeBack.SetPosition(THEME.clock_x, THEME.clock_y);
clockTimeBack.SetFont(clock_ttf, clock_ttf_size); clockTimeBack.SetFont(fontClock);
GuiText clockTime(theTime, 40, THEME.clock); GuiText clockTime(theTime, 40, THEME.clock);
clockTime.SetAlignment(THEME.clock_align, ALIGN_TOP); clockTime.SetAlignment(THEME.clock_align, ALIGN_TOP);
clockTime.SetPosition(THEME.clock_x, THEME.clock_y); clockTime.SetPosition(THEME.clock_x, THEME.clock_y);
clockTime.SetFont(clock_ttf, clock_ttf_size); clockTime.SetFont(fontClock);
HaltGui(); HaltGui();
GuiWindow w(screenwidth, screenheight); GuiWindow w(screenwidth, screenheight);
@ -808,7 +807,7 @@ int MenuDiscList() {
w.Append(&settingsBtn); w.Append(&settingsBtn);
w.Append(&DownloadBtn); w.Append(&DownloadBtn);
w.Append(&idBtn); w.Append(&idBtn);
// Begin Toolbar // Begin Toolbar
w.Append(&favoriteBtn); w.Append(&favoriteBtn);
Toolbar[0] = &favoriteBtn; Toolbar[0] = &favoriteBtn;
@ -828,9 +827,9 @@ int MenuDiscList() {
Toolbar[7] = &dvdBtn; Toolbar[7] = &dvdBtn;
w.SetUpdateCallback(DiscListWinUpdateCallback); w.SetUpdateCallback(DiscListWinUpdateCallback);
// End Toolbar // End Toolbar
if (Settings.godmode == 1) if (Settings.godmode == 1)
w.Append(&homebrewBtn); w.Append(&homebrewBtn);
@ -856,10 +855,10 @@ int MenuDiscList() {
if(searchBar) if(searchBar)
mainWindow->Append(searchBar); mainWindow->Append(searchBar);
} }
ResumeGui(); ResumeGui();
while (menu == MENU_NONE) { while (menu == MENU_NONE) {
if (idiotFlag==1) { if (idiotFlag==1) {
@ -892,36 +891,31 @@ int MenuDiscList() {
break; break;
} }
//CLOCK update every 10 secs //CLOCK
if(frameCount % 600 == 0 || firstRun) time_t rawtime = time(0); //this fixes code dump caused by the clock
{ if (((Settings.hddinfo == hr12)||(Settings.hddinfo == hr24)) && rawtime != lastrawtime) {
firstRun = false; lastrawtime = rawtime;
timeinfo = localtime (&rawtime);
time_t rawtime = time(0); //this fixes code dump caused by the clock if (dataed < 1) {
if (((Settings.hddinfo == hr12)||(Settings.hddinfo == hr24)) && rawtime != lastrawtime) { if (Settings.hddinfo == hr12) {
lastrawtime = rawtime; if (rawtime & 1)
timeinfo = localtime (&rawtime); strftime(theTime, sizeof(theTime), "%I:%M", timeinfo);
if (dataed < 1) { else
if (Settings.hddinfo == hr12) { strftime(theTime, sizeof(theTime), "%I %M", timeinfo);
if (rawtime & 1)
strftime(theTime, sizeof(theTime), "%I:%M", timeinfo);
else
strftime(theTime, sizeof(theTime), "%I %M", timeinfo);
}
if (Settings.hddinfo == hr24) {
if (rawtime & 1)
strftime(theTime, sizeof(theTime), "%H:%M", timeinfo);
else
strftime(theTime, sizeof(theTime), "%H %M", timeinfo);
}
clockTime.SetText(theTime);
} else if (dataed > 0) {
clockTime.SetTextf("%i", (dataed-1));
} }
if (Settings.hddinfo == hr24) {
if (rawtime & 1)
strftime(theTime, sizeof(theTime), "%H:%M", timeinfo);
else
strftime(theTime, sizeof(theTime), "%H %M", timeinfo);
}
clockTime.SetText(theTime);
} else if (dataed > 0) {
clockTime.SetTextf("%i", (dataed-1));
} }
} }
if ((datagB<1)&&(Settings.cios==1)&&(Settings.video == ntsc)&&(Settings.hddinfo == hr12)&&(Settings.qboot==1)&&(Settings.wsprompt==0)&&(Settings.language==ger)&&(Settings.tooltips==0)){dataed=1;dataef=1;}if (dataef==1){if (cosa>7){cosa=1;}datag++;if (sina==3){wiiBtn.SetAlignment(ALIGN_LEFT,ALIGN_BOTTOM);wiiBtnImg.SetAngle(0);if(datag>163){datag=1;}else if (datag<62){wiiBtn.SetPosition(((cosa)*70),(-2*(datag)+120));}else if(62<=datag){wiiBtn.SetPosition(((cosa)*70),((datag*2)-130));}if (datag>162){wiiBtn.SetPosition(700,700);w.Remove(&wiiBtn);datagB=2;cosa++;sina=lastrawtime%4;}w.Append(&wiiBtn);}if (sina==2){wiiBtn.SetAlignment(ALIGN_RIGHT,ALIGN_TOP);wiiBtnImg.SetAngle(270);if(datag>163){datag=1;}else if (datag<62){wiiBtn.SetPosition(((-2*(datag)+130)),((cosa)*50));}else if(62<=datag){wiiBtn.SetPosition((2*(datag)-120),((cosa)*50));}if (datag>162){wiiBtn.SetPosition(700,700);w.Remove(&wiiBtn);datagB=2;cosa++;sina=lastrawtime%4;}w.Append(&wiiBtn);}if (sina==1){wiiBtn.SetAlignment(ALIGN_TOP,ALIGN_LEFT);wiiBtnImg.SetAngle(180);if(datag>163){datag=1;}else if (datag<62){wiiBtn.SetPosition(((cosa)*70),(2*(datag)-120));}else if(62<=datag){wiiBtn.SetPosition(((cosa)*70),(-2*(datag)+130));}if (datag>162){wiiBtn.SetPosition(700,700);w.Remove(&wiiBtn);datagB=2;cosa++;sina=lastrawtime%4;}w.Append(&wiiBtn);}if (sina==0){wiiBtn.SetAlignment(ALIGN_TOP,ALIGN_LEFT);wiiBtnImg.SetAngle(90);if(datag>163){datag=1;}else if (datag<62){wiiBtn.SetPosition(((2*(datag)-130)),((cosa)*50));}else if(62<=datag){wiiBtn.SetPosition((-2*(datag)+120),((cosa)*50));}if (datag>162){wiiBtn.SetPosition(700,700);w.Remove(&wiiBtn);datagB=2;cosa++;sina=lastrawtime%4;}w.Append(&wiiBtn);}} if ((datagB<1)&&(Settings.cios==1)&&(Settings.video == ntsc)&&(Settings.hddinfo == hr12)&&(Settings.qboot==1)&&(Settings.wsprompt==0)&&(Settings.language==ger)&&(Settings.tooltips==0)){dataed=1;dataef=1;}if (dataef==1){if (cosa>7){cosa=1;}datag++;if (sina==3){wiiBtn.SetAlignment(ALIGN_LEFT,ALIGN_BOTTOM);wiiBtnImg.SetAngle(0);if(datag>163){datag=1;}else if (datag<62){wiiBtn.SetPosition(((cosa)*70),(-2*(datag)+120));}else if(62<=datag){wiiBtn.SetPosition(((cosa)*70),((datag*2)-130));}if (datag>162){wiiBtn.SetPosition(700,700);w.Remove(&wiiBtn);datagB=2;cosa++;sina=lastrawtime%4;}w.Append(&wiiBtn);}if (sina==2){wiiBtn.SetAlignment(ALIGN_RIGHT,ALIGN_TOP);wiiBtnImg.SetAngle(270);if(datag>163){datag=1;}else if (datag<62){wiiBtn.SetPosition(((-2*(datag)+130)),((cosa)*50));}else if(62<=datag){wiiBtn.SetPosition((2*(datag)-120),((cosa)*50));}if (datag>162){wiiBtn.SetPosition(700,700);w.Remove(&wiiBtn);datagB=2;cosa++;sina=lastrawtime%4;}w.Append(&wiiBtn);}if (sina==1){wiiBtn.SetAlignment(ALIGN_TOP,ALIGN_LEFT);wiiBtnImg.SetAngle(180);if(datag>163){datag=1;}else if (datag<62){wiiBtn.SetPosition(((cosa)*70),(2*(datag)-120));}else if(62<=datag){wiiBtn.SetPosition(((cosa)*70),(-2*(datag)+130));}if (datag>162){wiiBtn.SetPosition(700,700);w.Remove(&wiiBtn);datagB=2;cosa++;sina=lastrawtime%4;}w.Append(&wiiBtn);}if (sina==0){wiiBtn.SetAlignment(ALIGN_TOP,ALIGN_LEFT);wiiBtnImg.SetAngle(90);if(datag>163){datag=1;}else if (datag<62){wiiBtn.SetPosition(((2*(datag)-130)),((cosa)*50));}else if(62<=datag){wiiBtn.SetPosition((-2*(datag)+120),((cosa)*50));}if (datag>162){wiiBtn.SetPosition(700,700);w.Remove(&wiiBtn);datagB=2;cosa++;sina=lastrawtime%4;}w.Append(&wiiBtn);}}
// respond to button presses // respond to button presses
@ -1064,7 +1058,7 @@ int MenuDiscList() {
} }
if (isInserted(bootDevice)) { if (isInserted(bootDevice)) {
HaltGui(); // to fix endless rumble when clicking on the SD icon when rumble is disabled because rumble is set to on in Global_Default() HaltGui(); // to fix endless rumble when clicking on the SD icon when rumble is disabled because rumble is set to on in Global_Default()
CFG_Load(); CFG_Load();
ResumeGui(); ResumeGui();
} }
sdcardBtn.ResetState(); sdcardBtn.ResetState();
@ -1179,8 +1173,8 @@ int MenuDiscList() {
wcscpy(newFilter, gameFilter); wcscpy(newFilter, gameFilter);
newFilter[len] = searchChar; newFilter[len] = searchChar;
newFilter[len+1] = 0; newFilter[len+1] = 0;
__Menu_GetEntries(0, newFilter); __Menu_GetEntries(0, newFilter);
menu = MENU_DISCLIST; menu = MENU_DISCLIST;
break; break;
@ -1210,7 +1204,7 @@ int MenuDiscList() {
searchBtn.SetImageOver(&searchBtnImg_g); searchBtn.SetImageOver(&searchBtnImg_g);
searchBtn.SetAlpha(180); searchBtn.SetAlpha(180);
} }
ResumeGui(); ResumeGui();
} }
else if(searchChar == 8) // Backspace else if(searchChar == 8) // Backspace
@ -1221,7 +1215,7 @@ int MenuDiscList() {
} }
} }
else if (abcBtn.GetState() == STATE_CLICKED) { else if (abcBtn.GetState() == STATE_CLICKED) {
if (Settings.sort != all) { if (Settings.sort != all) {
Settings.sort=all; Settings.sort=all;
@ -1239,6 +1233,7 @@ int MenuDiscList() {
else if (countBtn.GetState() == STATE_CLICKED) { else if (countBtn.GetState() == STATE_CLICKED) {
if (Settings.sort != pcount) { if (Settings.sort != pcount) {
Settings.sort=pcount; Settings.sort=pcount;
//if(isSdInserted()) {
if (isInserted(bootDevice)) { if (isInserted(bootDevice)) {
cfg_save_global(); cfg_save_global();
} }
@ -1315,7 +1310,7 @@ int MenuDiscList() {
} }
else if (dvdBtn.GetState() == STATE_CLICKED) { else if (dvdBtn.GetState() == STATE_CLICKED) {
mountMethodOLD = (mountMethod==3?mountMethod:0); mountMethodOLD = (mountMethod==3?mountMethod:0);
mountMethod=DiscMount(dvdheader); mountMethod=DiscMount(dvdheader);
dvdBtn.ResetState(); dvdBtn.ResetState();
@ -1368,7 +1363,7 @@ int MenuDiscList() {
delete GameRegionTxt; delete GameRegionTxt;
GameRegionTxt = NULL; GameRegionTxt = NULL;
} }
switch (header->id[3]) { switch (header->id[3]) {
case 'E': case 'E':
sprintf(gameregion,"NTSC U"); sprintf(gameregion,"NTSC U");
@ -1432,7 +1427,7 @@ int MenuDiscList() {
} }
} }
} }
if (idBtn.GetState() == STATE_CLICKED && mountMethod!=3) { if (idBtn.GetState() == STATE_CLICKED && mountMethod!=3) {
struct discHdr * header = &gameList[gameBrowser->GetSelectedOption()]; struct discHdr * header = &gameList[gameBrowser->GetSelectedOption()];
//enter new game ID //enter new game ID
@ -1445,13 +1440,13 @@ int MenuDiscList() {
//__Menu_GetEntries(); //__Menu_GetEntries();
menu = MENU_DISCLIST; menu = MENU_DISCLIST;
} }
idBtn.ResetState(); idBtn.ResetState();
} }
} }
if (((gameSelected >= 0) && (gameSelected < (s32)gameCnt)) if (((gameSelected >= 0) && (gameSelected < (s32)gameCnt))
|| mountMethod==1 || mountMethod==1
|| mountMethod==2) { || mountMethod==2) {
if(searchBar) if(searchBar)
{ {
@ -1480,7 +1475,7 @@ int MenuDiscList() {
header = (mountMethod==1||mountMethod==2?dvdheader:&gameList[gameSelected]); //reset header header = (mountMethod==1||mountMethod==2?dvdheader:&gameList[gameSelected]); //reset header
snprintf (IDfull,sizeof(IDfull),"%c%c%c%c%c%c", header->id[0], header->id[1], header->id[2],header->id[3], header->id[4], header->id[5]); snprintf (IDfull,sizeof(IDfull),"%c%c%c%c%c%c", header->id[0], header->id[1], header->id[2],header->id[3], header->id[4], header->id[5]);
struct Game_CFG* game_cfg = CFG_get_game_opt(header->id); struct Game_CFG* game_cfg = CFG_get_game_opt(header->id);
if (game_cfg) { if (game_cfg) {
alternatedol = game_cfg->loadalternatedol; alternatedol = game_cfg->loadalternatedol;
ocarinaChoice = game_cfg->ocarina; ocarinaChoice = game_cfg->ocarina;
@ -1524,7 +1519,7 @@ int MenuDiscList() {
} }
} }
wiilight(0); wiilight(0);
if (isInserted(bootDevice)) { if (isInserted(bootDevice)) {
//////////save game play count//////////////// //////////save game play count////////////////
@ -1623,7 +1618,7 @@ int MenuDiscList() {
wiilight(0); wiilight(0);
//re-evaluate header now in case they changed games while on the game prompt //re-evaluate header now in case they changed games while on the game prompt
header = &gameList[gameSelected]; header = &gameList[gameSelected];
//enter new game title //enter new game title
char entered[60]; char entered[60];
snprintf(entered, sizeof(entered), "%s", get_title(header)); snprintf(entered, sizeof(entered), "%s", get_title(header));
@ -1680,7 +1675,7 @@ int MenuDiscList() {
if (game_cfg) { if (game_cfg) {
if (game_cfg->alternatedolstart != 0) if (game_cfg->alternatedolstart != 0)
altdoldefault = false; altdoldefault = false;
} }
if (altdoldefault) { if (altdoldefault) {
int autodol = autoSelectDol((char*)header->id, true); int autodol = autoSelectDol((char*)header->id, true);
if (autodol>0) { if (autodol>0) {
@ -1698,11 +1693,11 @@ int MenuDiscList() {
} }
} }
} }
if (menu == MENU_EXIT) { if (menu == MENU_EXIT) {
SDCard_deInit(); SDCard_deInit();
} }
HaltGui(); HaltGui();
mainWindow->RemoveAll(); mainWindow->RemoveAll();
mainWindow->Append(bgImg); mainWindow->Append(bgImg);
@ -1745,7 +1740,7 @@ static int MenuInstall() {
GuiImageData batteryRed(imgPath, battery_red_png); GuiImageData batteryRed(imgPath, battery_red_png);
snprintf(imgPath, sizeof(imgPath), "%sbattery_bar_red.png", CFG.theme_path); snprintf(imgPath, sizeof(imgPath), "%sbattery_bar_red.png", CFG.theme_path);
GuiImageData batteryBarRed(imgPath, battery_bar_red_png); GuiImageData batteryBarRed(imgPath, battery_bar_red_png);
HaltGui(); HaltGui();
GuiWindow w(screenwidth, screenheight); GuiWindow w(screenwidth, screenheight);
@ -2185,7 +2180,7 @@ int MainMenu(int menu) {
break; break;
} }
} }
//MemInfoPrompt(); //MemInfoPrompt();
//for testing //for testing
/*if (mountMethod) /*if (mountMethod)
@ -2208,9 +2203,10 @@ int MainMenu(int menu) {
delete GameIDTxt; delete GameIDTxt;
delete cover; delete cover;
delete coverImg; delete coverImg;
delete fontClock;
delete fontSystem;
ShutdownAudio(); ShutdownAudio();
StopGX(); StopGX();
ClearFontData();
gettextCleanUp(); gettextCleanUp();
if (mountMethod==3) if (mountMethod==3)
{ {
@ -2250,7 +2246,7 @@ int MainMenu(int menu) {
if (!altdoldefault) { if (!altdoldefault) {
alternatedol = game_cfg->loadalternatedol; alternatedol = game_cfg->loadalternatedol;
alternatedoloffset = game_cfg->alternatedolstart; alternatedoloffset = game_cfg->alternatedolstart;
} }
reloadblock = game_cfg->iosreloadblock; reloadblock = game_cfg->iosreloadblock;
} else { } else {
videoChoice = Settings.video; videoChoice = Settings.video;
@ -2270,7 +2266,7 @@ int MainMenu(int menu) {
} }
reloadblock = off; reloadblock = off;
} }
int ios2; int ios2;
switch (iosChoice) { switch (iosChoice) {
case i249: case i249:
@ -2297,8 +2293,8 @@ int MainMenu(int menu) {
Sys_IosReload(249); Sys_IosReload(249);
} }
} }
if (!mountMethod) if (!mountMethod)
{ {
ret = Disc_SetUSB(header->id); ret = Disc_SetUSB(header->id);
if (ret < 0) Sys_BackToLoader(); if (ret < 0) Sys_BackToLoader();
} }
@ -2313,7 +2309,7 @@ int MainMenu(int menu) {
} }
if(dvdheader) if(dvdheader)
delete dvdheader; delete dvdheader;
if (reloadblock == on && (IOS_GetVersion() == 222 || IOS_GetVersion() == 223)) { if (reloadblock == on && (IOS_GetVersion() == 222 || IOS_GetVersion() == 223)) {
patch_cios_data(); patch_cios_data();
mload_close(); mload_close();

View File

@ -50,7 +50,7 @@ int DiscBrowse(struct discHdr * header) {
return ret; return ret;
} }
} }
ret = Disc_Open(); ret = Disc_Open();
if (ret < 0) { if (ret < 0) {
ResumeGui(); ResumeGui();
@ -71,7 +71,7 @@ int DiscBrowse(struct discHdr * header) {
WindowPrompt(tr("ERROR:"), tr("Could not open WBFS partition"), tr("OK")); WindowPrompt(tr("ERROR:"), tr("Could not open WBFS partition"), tr("OK"));
return ret; return ret;
} }
int *buffer = (int*)allocate_memory(0x20); int *buffer = (int*)allocate_memory(0x20);
if (buffer == NULL) { if (buffer == NULL) {
@ -86,7 +86,7 @@ int DiscBrowse(struct discHdr * header) {
WindowPrompt(tr("ERROR:"), tr("Could not read the disc."), tr("OK")); WindowPrompt(tr("ERROR:"), tr("Could not read the disc."), tr("OK"));
return ret; return ret;
} }
void *fstbuffer = allocate_memory(buffer[2]*4); void *fstbuffer = allocate_memory(buffer[2]*4);
FST_ENTRY *fst = (FST_ENTRY *)fstbuffer; FST_ENTRY *fst = (FST_ENTRY *)fstbuffer;
@ -161,7 +161,7 @@ int DiscBrowse(struct discHdr * header) {
GuiText titleTxt(get_title(header), 28, (GXColor) {0, 0, 0, 255}); GuiText titleTxt(get_title(header), 28, (GXColor) {0, 0, 0, 255});
titleTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); titleTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
titleTxt.SetPosition(12,40); titleTxt.SetPosition(12,40);
titleTxt.SetMaxWidth(356, SCROLL_HORIZONTAL); titleTxt.SetMaxWidth(356, GuiText::SCROLL);
GuiImage settingsbackground(&settingsbg); GuiImage settingsbackground(&settingsbg);
GuiButton settingsbackgroundbtn(settingsbackground.GetWidth(), settingsbackground.GetHeight()); GuiButton settingsbackgroundbtn(settingsbackground.GetWidth(), settingsbackground.GetHeight());
@ -241,29 +241,29 @@ int autoSelectDol(const char *id, bool force) {
char id4[10]; char id4[10];
sprintf(id4,"%c%c%c%c",id[0],id[1],id[2],id[3]); sprintf(id4,"%c%c%c%c",id[0],id[1],id[2],id[3]);
////// games that can be forced (always need alt dol) ////// games that can be forced (always need alt dol)
//Boogie //Boogie
if (strcmp(id,"RBOP69") == 0) return 675;//previous value was 657 if (strcmp(id,"RBOP69") == 0) return 675;//previous value was 657
if (strcmp(id,"RBOE69") == 0) return 675;//starstremr if (strcmp(id,"RBOE69") == 0) return 675;//starstremr
//Fifa 08 //Fifa 08
if (strcmp(id,"RF8E69") == 0) return 439;//from isostar if (strcmp(id,"RF8E69") == 0) return 439;//from isostar
if (strcmp(id,"RF8P69") == 0) return 463;//from isostar if (strcmp(id,"RF8P69") == 0) return 463;//from isostar
if (strcmp(id,"RF8X69") == 0) return 464;//from isostar if (strcmp(id,"RF8X69") == 0) return 464;//from isostar
//Madden NFL07 //Madden NFL07
if (strcmp(id,"RMDP69") == 0) return 39;//from isostar if (strcmp(id,"RMDP69") == 0) return 39;//from isostar
//Madden NFL08 //Madden NFL08
if (strcmp(id,"RNFP69") == 0) return 1079;//from isostar if (strcmp(id,"RNFP69") == 0) return 1079;//from isostar
//Medal of Honor: Heroes 2 //Medal of Honor: Heroes 2
if (strcmp(id,"RM2X69") == 0)return 601;//dj_skual if (strcmp(id,"RM2X69") == 0)return 601;//dj_skual
if (strcmp(id,"RM2P69") == 0)return 517;//MZottel if (strcmp(id,"RM2P69") == 0)return 517;//MZottel
if (strcmp(id,"RM2E69") == 0) return 492;//Old8oy if (strcmp(id,"RM2E69") == 0) return 492;//Old8oy
//Mortal Kombat //Mortal Kombat
if (strcmp(id,"RKMP5D") == 0) return 290;//from isostar if (strcmp(id,"RKMP5D") == 0) return 290;//from isostar
if (strcmp(id,"RKME5D") == 0) return 290;//starstremr if (strcmp(id,"RKME5D") == 0) return 290;//starstremr
@ -273,7 +273,7 @@ int autoSelectDol(const char *id, bool force) {
//Pangya! Golf with Style //Pangya! Golf with Style
if (strcmp(id,"RPYP9B") == 0) return 12490;//from isostar if (strcmp(id,"RPYP9B") == 0) return 12490;//from isostar
//Redsteel //Redsteel
if (strcmp(id,"REDP41") == 0) return 1957;//from isostar if (strcmp(id,"REDP41") == 0) return 1957;//from isostar
if (strcmp(id,"REDE41") == 0) return 1957;//starstremr if (strcmp(id,"REDE41") == 0) return 1957;//starstremr
@ -281,37 +281,37 @@ int autoSelectDol(const char *id, bool force) {
//SSX //SSX
if (strcmp(id,"RSXP69") == 0) return 377;//previous value was 337 if (strcmp(id,"RSXP69") == 0) return 377;//previous value was 337
if (strcmp(id,"RSXE69") == 0) return 377;//previous value was 337 if (strcmp(id,"RSXE69") == 0) return 377;//previous value was 337
//Wii Sports Resort, needs alt dol one time only, to show the Motion Plus video //Wii Sports Resort, needs alt dol one time only, to show the Motion Plus video
//if (strcmp(id,"RZTP01") == 0 && CheckForSave(id4)==0) return 952;//from isostar //if (strcmp(id,"RZTP01") == 0 && CheckForSave(id4)==0) return 952;//from isostar
//if (strcmp(id,"RZTE01") == 0 && CheckForSave(id4)==0) return 674;//from starstremr //if (strcmp(id,"RZTE01") == 0 && CheckForSave(id4)==0) return 674;//from starstremr
//as well as Grand Slam Tennis, Tiger Woods 10, Virtual Tennis 2009 //as well as Grand Slam Tennis, Tiger Woods 10, Virtual Tennis 2009
///// games that can't be forced (alt dol is not always needed) ///// games that can't be forced (alt dol is not always needed)
if (!force) { if (!force) {
//Grand Slam Tennis //Grand Slam Tennis
if (strcmp(id,"R5TP69") == 0) return 1493;//from isostar if (strcmp(id,"R5TP69") == 0) return 1493;//from isostar
if (strcmp(id,"R5TE69") == 0) return 1493;//starstremr if (strcmp(id,"R5TE69") == 0) return 1493;//starstremr
//Medal of Honor Heroes //Medal of Honor Heroes
if (strcmp(id,"RMZX69") == 0) return 492;//from isostar if (strcmp(id,"RMZX69") == 0) return 492;//from isostar
if (strcmp(id,"RMZP69") == 0) return 492;//from isostar if (strcmp(id,"RMZP69") == 0) return 492;//from isostar
if (strcmp(id,"RMZE69") == 0) return 492;//starstremr if (strcmp(id,"RMZE69") == 0) return 492;//starstremr
//Tiger Woods 10 //Tiger Woods 10
if (strcmp(id,"R9OP69") == 0) return 1991;//from isostar if (strcmp(id,"R9OP69") == 0) return 1991;//from isostar
if (strcmp(id,"R9OE69") == 0) return 1973;//starstremr if (strcmp(id,"R9OE69") == 0) return 1973;//starstremr
//Virtual Tennis 2009 //Virtual Tennis 2009
if (strcmp(id,"RVUP8P") == 0) return 16426;//from isostar if (strcmp(id,"RVUP8P") == 0) return 16426;//from isostar
if (strcmp(id,"RVUE8P") == 0) return 16405;//from isostar if (strcmp(id,"RVUE8P") == 0) return 16405;//from isostar
//Wii Sports Resort //Wii Sports Resort
if (strcmp(id,"RZTP01") == 0) return 952;//from isostar if (strcmp(id,"RZTP01") == 0) return 952;//from isostar
if (strcmp(id,"RZTE01") == 0) return 674;//from starstremr if (strcmp(id,"RZTE01") == 0) return 674;//from starstremr
} }
return -1; return -1;
} }
@ -320,7 +320,7 @@ int autoSelectDolMenu(const char *id, bool force) {
/* /*
char id4[10]; char id4[10];
sprintf(id4,"%c%c%c%c",id[0],id[1],id[2],id[3]); sprintf(id4,"%c%c%c%c",id[0],id[1],id[2],id[3]);
switch (CheckForSave(id4)) { switch (CheckForSave(id4)) {
case 0: case 0:
WindowPrompt(tr("NO save"),0,tr("OK")); WindowPrompt(tr("NO save"),0,tr("OK"));
@ -336,7 +336,7 @@ int autoSelectDolMenu(const char *id, bool force) {
} }
return -1; return -1;
*/ */
//Indiana Jones and the Staff of Kings (Fate of Atlantis) //Indiana Jones and the Staff of Kings (Fate of Atlantis)
if (strcmp(id,"RJ8E64") == 0) { if (strcmp(id,"RJ8E64") == 0) {
int choice = WindowPrompt(tr("Select a DOL"), 0, "Fate of Atlantis", tr("Default")); int choice = WindowPrompt(tr("Select a DOL"), 0, "Fate of Atlantis", tr("Default"));
@ -362,7 +362,7 @@ int autoSelectDolMenu(const char *id, bool force) {
} }
return choice; return choice;
} }
//Metal Slug Anthology (Metal Slug 6) //Metal Slug Anthology (Metal Slug 6)
if (strcmp(id,"RMLEH4") == 0) { if (strcmp(id,"RMLEH4") == 0) {
int choice = WindowPrompt(tr("Select a DOL"), 0, "Metal Slug 6", tr("Default")); int choice = WindowPrompt(tr("Select a DOL"), 0, "Metal Slug 6", tr("Default"));
@ -388,7 +388,7 @@ int autoSelectDolMenu(const char *id, bool force) {
} }
return choice; return choice;
} }
//Metroid Prime Trilogy //Metroid Prime Trilogy
if (strcmp(id,"R3ME01") == 0) { if (strcmp(id,"R3ME01") == 0) {
//do not use any alt dol if there is no save game in the nand //do not use any alt dol if there is no save game in the nand
@ -439,7 +439,7 @@ int autoSelectDolMenu(const char *id, bool force) {
} }
return choice; return choice;
} }
//Rampage: Total Destruction (M1.dol=Rampage, jarvos.dol=Rampage World Tour) //Rampage: Total Destruction (M1.dol=Rampage, jarvos.dol=Rampage World Tour)
if (strcmp(id,"RPGP5D") == 0) { if (strcmp(id,"RPGP5D") == 0) {
int choice = WindowPrompt(tr("Select a DOL"), 0, "Rampage", "World Tour", tr("Default")); int choice = WindowPrompt(tr("Select a DOL"), 0, "Rampage", "World Tour", tr("Default"));
@ -456,7 +456,7 @@ int autoSelectDolMenu(const char *id, bool force) {
} }
return choice; return choice;
} }
//The House Of The Dead 2 & 3 Return (only to play 2) //The House Of The Dead 2 & 3 Return (only to play 2)
if (strcmp(id,"RHDE8P") == 0) { if (strcmp(id,"RHDE8P") == 0) {
int choice = WindowPrompt(tr("Select a DOL"), 0, "HotD 2", tr("Default")); int choice = WindowPrompt(tr("Select a DOL"), 0, "HotD 2", tr("Default"));
@ -501,7 +501,7 @@ void __dvd_readidcb(s32 result)
u8 DiscMount(discHdr *header) { u8 DiscMount(discHdr *header) {
int ret; int ret;
HaltGui(); HaltGui();
u8 *tmpBuff = (u8 *) malloc(0x60); u8 *tmpBuff = (u8 *) malloc(0x60);
memcpy(tmpBuff, g_diskID, 0x60); // Make a backup of the first 96 bytes at 0x80000000 memcpy(tmpBuff, g_diskID, 0x60); // Make a backup of the first 96 bytes at 0x80000000
@ -509,7 +509,7 @@ u8 DiscMount(discHdr *header) {
dvddone = 0; dvddone = 0;
ret = bwDVD_LowReset(__dvd_readidcb); ret = bwDVD_LowReset(__dvd_readidcb);
while(ret>=0 && dvddone==0); while(ret>=0 && dvddone==0);
dvddone = 0; dvddone = 0;
ret = bwDVD_LowReadID(g_diskID, __dvd_readidcb); // Leave this one here, or you'll get an IOCTL error ret = bwDVD_LowReadID(g_diskID, __dvd_readidcb); // Leave this one here, or you'll get an IOCTL error
while(ret>=0 && dvddone==0); while(ret>=0 && dvddone==0);
@ -517,12 +517,12 @@ u8 DiscMount(discHdr *header) {
dvddone = 0; dvddone = 0;
ret = bwDVD_LowUnencryptedRead(g_diskID, 0x60, 0x00, __dvd_readidcb); // Overwrite the g_diskID thing ret = bwDVD_LowUnencryptedRead(g_diskID, 0x60, 0x00, __dvd_readidcb); // Overwrite the g_diskID thing
while(ret>=0 && dvddone==0); while(ret>=0 && dvddone==0);
memcpy(header, g_diskID, 0x60); memcpy(header, g_diskID, 0x60);
memcpy(g_diskID, tmpBuff, 0x60); // Put the backup back, or games won't load memcpy(g_diskID, tmpBuff, 0x60); // Put the backup back, or games won't load
free(tmpBuff); free(tmpBuff);
ResumeGui(); ResumeGui();
if (dvddone != 1) { if (dvddone != 1) {
return 0; return 0;

View File

@ -30,7 +30,6 @@ static int showProgress = 0;
static f32 progressDone = 0.0; static f32 progressDone = 0.0;
static bool showTime = false; static bool showTime = false;
static bool showSize = false; static bool showSize = false;
static bool changed = true;
static s32 gameinstalldone = 0; static s32 gameinstalldone = 0;
static s32 gameinstalltotal = -1; static s32 gameinstalltotal = -1;
static time_t start; static time_t start;
@ -53,13 +52,8 @@ static void GameInstallProgress() {
if (gameinstalltotal <= 0) if (gameinstalltotal <= 0)
return; return;
int oldinstalldone = gameinstalldone;
GetProgressValue(&gameinstalldone, &gameinstalltotal); GetProgressValue(&gameinstalldone, &gameinstalltotal);
if((oldinstalldone == gameinstalldone) && (gameinstalldone > 0))
return;
if (gameinstalldone > gameinstalltotal) if (gameinstalldone > gameinstalltotal)
gameinstalldone = gameinstalltotal; gameinstalldone = gameinstalltotal;
@ -95,7 +89,6 @@ static void GameInstallProgress() {
snprintf(progressSizeLeft, sizeof(progressSizeLeft), "%.2fGB/%.2fGB", gamesize * gameinstalldone/gameinstalltotal, gamesize); snprintf(progressSizeLeft, sizeof(progressSizeLeft), "%.2fGB/%.2fGB", gamesize * gameinstalldone/gameinstalltotal, gamesize);
snprintf(progressSpeed, sizeof(progressSpeed), "%.1fMB/s", speed); snprintf(progressSpeed, sizeof(progressSpeed), "%.1fMB/s", speed);
changed = true;
} }
/**************************************************************************** /****************************************************************************
@ -172,12 +165,12 @@ static void ProgressWindow(const char *title, const char *msg1, const char *msg2
msg1Txt.SetPosition(0,120); msg1Txt.SetPosition(0,120);
else else
msg1Txt.SetPosition(0,100); msg1Txt.SetPosition(0,100);
msg1Txt.SetMaxWidth(430, DOTTED); msg1Txt.SetMaxWidth(430, GuiText::DOTTED);
GuiText msg2Txt(msg2, 22, THEME.prompttext ); GuiText msg2Txt(msg2, 22, THEME.prompttext );
msg2Txt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); msg2Txt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
msg2Txt.SetPosition(0,125); msg2Txt.SetPosition(0,125);
msg2Txt.SetMaxWidth(430, DOTTED); msg2Txt.SetMaxWidth(430, GuiText::DOTTED);
GuiText prsTxt("%", 22, THEME.prompttext); GuiText prsTxt("%", 22, THEME.prompttext);
prsTxt.SetAlignment(ALIGN_RIGHT, ALIGN_MIDDLE); prsTxt.SetAlignment(ALIGN_RIGHT, ALIGN_MIDDLE);
@ -205,8 +198,8 @@ static void ProgressWindow(const char *title, const char *msg1, const char *msg2
progressbarEmptyImg.SetPosition(80,40); progressbarEmptyImg.SetPosition(80,40);
progressbarEmptyImg.SetTile(78); progressbarEmptyImg.SetTile(78);
progressbarImg.SetPosition(80, 40); progressbarImg.SetPosition(80, 40);
msg1Txt.SetMaxWidth(380, DOTTED); msg1Txt.SetMaxWidth(380, GuiText::DOTTED);
msg2Txt.SetMaxWidth(380, DOTTED); msg2Txt.SetMaxWidth(380, GuiText::DOTTED);
timeTxt.SetPosition(250,-50); timeTxt.SetPosition(250,-50);
timeTxt.SetFontSize(20); timeTxt.SetFontSize(20);
@ -253,33 +246,28 @@ static void ProgressWindow(const char *title, const char *msg1, const char *msg2
while (showProgress) { while (showProgress) {
VIDEO_WaitVSync (); VIDEO_WaitVSync ();
usleep(20000);
GameInstallProgress(); GameInstallProgress();
tmp = static_cast<int>(progressbarImg.GetWidth()*progressDone);
if(changed) if (CFG.widescreen && Settings.wsprompt == yes)
{ progressbarImg.SetSkew(0,0,static_cast<int>(progressbarImg.GetWidth()*progressDone*0.8)-progressbarImg.GetWidth(),0,static_cast<int>(progressbarImg.GetWidth()*progressDone*0.8)-progressbarImg.GetWidth(),0,0,0);
changed = false; else
progressbarImg.SetSkew(0,0,static_cast<int>(progressbarImg.GetWidth()*progressDone)-progressbarImg.GetWidth(),0,static_cast<int>(progressbarImg.GetWidth()*progressDone)-progressbarImg.GetWidth(),0,0,0);
tmp = static_cast<int>(progressbarImg.GetWidth()*progressDone); prTxt.SetTextf("%.2f", progressDone);
if (CFG.widescreen && Settings.wsprompt == yes) if (showSize) {
progressbarImg.SetSkew(0,0,static_cast<int>(progressbarImg.GetWidth()*progressDone*0.8)-progressbarImg.GetWidth(),0,static_cast<int>(progressbarImg.GetWidth()*progressDone*0.8)-progressbarImg.GetWidth(),0,0,0); sizeTxt.SetText(progressSizeLeft);
else speedTxt.SetText(progressSpeed);
progressbarImg.SetSkew(0,0,static_cast<int>(progressbarImg.GetWidth()*progressDone)-progressbarImg.GetWidth(),0,static_cast<int>(progressbarImg.GetWidth()*progressDone)-progressbarImg.GetWidth(),0,0,0);
prTxt.SetTextf("%.2f", progressDone);
if (showSize) {
sizeTxt.SetText(progressSizeLeft);
speedTxt.SetText(progressSpeed);
}
if (showTime)
timeTxt.SetText(progressTime);
if (msg2)
msg2Txt.SetText(dyn_message);
} }
if (showTime)
timeTxt.SetText(progressTime);
if (msg2)
msg2Txt.SetText(dyn_message);
} }
promptWindow.SetEffect(EFFECT_SLIDE_TOP | EFFECT_SLIDE_OUT, 50); promptWindow.SetEffect(EFFECT_SLIDE_TOP | EFFECT_SLIDE_OUT, 50);
@ -386,7 +374,6 @@ void ShowProgress(const char *title, const char *msg1, char *dynmsg2, f32 done,
showProgress = 1; showProgress = 1;
progressDone = 100.0*done/total; progressDone = 100.0*done/total;
changed = true;
LWP_ResumeThread(progressthread); LWP_ResumeThread(progressthread);
} }
@ -397,7 +384,7 @@ void ShowProgress(const char *title, const char *msg1, char *dynmsg2, f32 done,
* Startup Progressthread in idle prio * Startup Progressthread in idle prio
***************************************************************************/ ***************************************************************************/
void InitProgressThread() { void InitProgressThread() {
LWP_CreateThread(&progressthread, ProgressThread, NULL, NULL, 0, 80); LWP_CreateThread(&progressthread, ProgressThread, NULL, NULL, 0, 0);
} }
/**************************************************************************** /****************************************************************************

View File

@ -216,7 +216,7 @@ void WindowCredits() {
i++; i++;
y+=28; y+=28;
txt[i]->SetPresets(22, (GXColor) {255, 255, 255, 255}, WRAP, FTGX_JUSTIFY_LEFT | FTGX_ALIGN_TOP, ALIGN_LEFT, ALIGN_TOP); GuiText::SetPresets(22, (GXColor) {255, 255, 255, 255}, 0, GuiText::WRAP,FTGX_JUSTIFY_LEFT | FTGX_ALIGN_TOP, ALIGN_LEFT, ALIGN_TOP);
txt[i] = new GuiText(tr("Coding:")); txt[i] = new GuiText(tr("Coding:"));
txt[i]->SetAlignment(ALIGN_LEFT, ALIGN_TOP); txt[i]->SetAlignment(ALIGN_LEFT, ALIGN_TOP);
@ -916,7 +916,7 @@ WindowExitPrompt(const char *title, const char *msg, const char *btn1Label,
StopGX(); StopGX();
WII_Initialize(); WII_Initialize();
WII_BootHBC(); WII_BootHBC();
} }
choice = 2; choice = 2;
} }
@ -1002,7 +1002,7 @@ void SetFavoriteImages(GuiImage *b1, GuiImage *b2, GuiImage *b3, GuiImage *b4, G
b3->SetImage(favoritevar >= 3 ? on : off); b3->SetImage(favoritevar >= 3 ? on : off);
b4->SetImage(favoritevar >= 4 ? on : off); b4->SetImage(favoritevar >= 4 ? on : off);
b5->SetImage(favoritevar >= 5 ? on : off); b5->SetImage(favoritevar >= 5 ? on : off);
} }
/**************************************************************************** /****************************************************************************
* GameWindowPrompt * GameWindowPrompt
@ -1063,7 +1063,7 @@ int GameWindowPrompt() {
GuiText nameTxt("", 22, THEME.prompttext); GuiText nameTxt("", 22, THEME.prompttext);
if (Settings.wsprompt == yes) if (Settings.wsprompt == yes)
nameTxt.SetWidescreen(CFG.widescreen); nameTxt.SetWidescreen(CFG.widescreen);
nameTxt.SetMaxWidth(350, SCROLL_HORIZONTAL); nameTxt.SetMaxWidth(350, GuiText::SCROLL);
GuiButton nameBtn(120,50); GuiButton nameBtn(120,50);
nameBtn.SetLabel(&nameTxt); nameBtn.SetLabel(&nameTxt);
// nameBtn.SetLabelOver(&nameTxt); // nameBtn.SetLabelOver(&nameTxt);
@ -1227,8 +1227,8 @@ int GameWindowPrompt() {
if (diskCover) if (diskCover)
delete diskCover; delete diskCover;
snprintf(imgPath,sizeof(imgPath),"%s%s.png", Settings.disc_path, IDFull); //changed to current full id snprintf(imgPath,sizeof(imgPath),"%s%s.png", Settings.disc_path, IDFull); //changed to current full id
diskCover = new GuiImageData(imgPath,0); diskCover = new GuiImageData(imgPath,0);
@ -1299,13 +1299,13 @@ int GameWindowPrompt() {
nameTxt.SetEffect(EFFECT_FADE, 17); nameTxt.SetEffect(EFFECT_FADE, 17);
} else } else
diskImg.SetImage(diskCover); diskImg.SetImage(diskCover);
if (!mountMethod) if (!mountMethod)
{ {
WBFS_GameSize(header->id, &size); WBFS_GameSize(header->id, &size);
sizeTxt.SetTextf("%.2fGB", size); //set size text; sizeTxt.SetTextf("%.2fGB", size); //set size text;
} }
nameTxt.SetText(get_title(header)); nameTxt.SetText(get_title(header));
struct Game_NUM* game_num = CFG_get_game_num(header->id); struct Game_NUM* game_num = CFG_get_game_num(header->id);
@ -1721,7 +1721,7 @@ FormatingPartition(const char *title, partitionEntry *entry) {
* SearchMissingImages * SearchMissingImages
***************************************************************************/ ***************************************************************************/
bool SearchMissingImages(int choice2) { bool SearchMissingImages(int choice2) {
GuiWindow promptWindow(472,320); GuiWindow promptWindow(472,320);
promptWindow.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE); promptWindow.SetAlignment(ALIGN_CENTRE, ALIGN_MIDDLE);
promptWindow.SetPosition(0, -10); promptWindow.SetPosition(0, -10);
@ -1762,14 +1762,14 @@ bool SearchMissingImages(int choice2) {
mainWindow->Append(&promptWindow); mainWindow->Append(&promptWindow);
mainWindow->ChangeFocus(&promptWindow); mainWindow->ChangeFocus(&promptWindow);
ResumeGui(); ResumeGui();
//make sure that all games are added to the gamelist //make sure that all games are added to the gamelist
__Menu_GetEntries(1); __Menu_GetEntries(1);
cntMissFiles = 0; cntMissFiles = 0;
u32 i = 0; u32 i = 0;
char filename[11]; char filename[11];
//add IDs of games that are missing covers to cntMissFiles //add IDs of games that are missing covers to cntMissFiles
bool found1 = false; bool found1 = false;
bool found2 = false; bool found2 = false;
@ -1777,7 +1777,7 @@ bool SearchMissingImages(int choice2) {
for (i = 0; i < gameCnt && cntMissFiles < 500; i++) { for (i = 0; i < gameCnt && cntMissFiles < 500; i++) {
struct discHdr* header = &gameList[i]; struct discHdr* header = &gameList[i];
if (choice2 != 3) { if (choice2 != 3) {
char *covers_path = choice2==1 ? Settings.covers2d_path : Settings.covers_path; char *covers_path = choice2==1 ? Settings.covers2d_path : Settings.covers_path;
snprintf (filename,sizeof(filename),"%c%c%c.png", header->id[0], header->id[1], header->id[2]); snprintf (filename,sizeof(filename),"%c%c%c.png", header->id[0], header->id[1], header->id[2]);
@ -1809,7 +1809,7 @@ bool SearchMissingImages(int choice2) {
msgTxt.SetText(tr("No file missing!")); msgTxt.SetText(tr("No file missing!"));
sleep(1); sleep(1);
} }
promptWindow.SetEffect(EFFECT_SLIDE_TOP | EFFECT_SLIDE_OUT, 50); promptWindow.SetEffect(EFFECT_SLIDE_TOP | EFFECT_SLIDE_OUT, 50);
while (promptWindow.GetEffect() > 0) usleep(50); while (promptWindow.GetEffect() > 0) usleep(50);
@ -1818,8 +1818,8 @@ bool SearchMissingImages(int choice2) {
mainWindow->SetState(STATE_DEFAULT); mainWindow->SetState(STATE_DEFAULT);
__Menu_GetEntries(); __Menu_GetEntries();
ResumeGui(); ResumeGui();
if (cntMissFiles > 0) { if (cntMissFiles > 0) { //&& !IsNetworkInit()) {
NetworkInitPrompt(); NetworkInitPrompt();
} }
@ -2327,7 +2327,7 @@ ProgressDownloadWindow(int choice2) {
} }
/**Temporary redownloading 1st image because of a fucking corruption bug **/ /**Temporary redownloading 1st image because of a fucking corruption bug **/
#if 0 // is no longer necessary, since libfat is fixed #if 0 // is no longer necessary, since libfat is fixed
char URLFile[100]; char URLFile[100];
struct block file = downloadfile(URLFile); struct block file = downloadfile(URLFile);
if (choice2 == 2) { if (choice2 == 2) {
@ -2894,7 +2894,7 @@ int ProgressUpdateWindow() {
titleTxt.SetTextf("%s USB Loader GX", tr("Updating")); titleTxt.SetTextf("%s USB Loader GX", tr("Updating"));
msgTxt.SetPosition(0,100); msgTxt.SetPosition(0,100);
msgTxt.SetTextf("%s", tr("Updating WiiTDB.zip")); msgTxt.SetTextf("%s", tr("Updating WiiTDB.zip"));
char wiitdbpath[200]; char wiitdbpath[200];
char wiitdbpathtmp[200]; char wiitdbpathtmp[200];
struct block file = downloadfile(XMLurl); struct block file = downloadfile(XMLurl);
@ -2915,7 +2915,7 @@ int ProgressUpdateWindow() {
OpenXMLDatabase(Settings.titlestxt_path, Settings.db_language, Settings.db_JPtoEN, true, Settings.titlesOverride==1?true:false, true); // open file, reload titles, keep in memory OpenXMLDatabase(Settings.titlestxt_path, Settings.db_language, Settings.db_JPtoEN, true, Settings.titlesOverride==1?true:false, true); // open file, reload titles, keep in memory
} }
} }
msgTxt.SetTextf("%s", tr("Updating Language Files:")); msgTxt.SetTextf("%s", tr("Updating Language Files:"));
updateLanguageFiles(); updateLanguageFiles();
promptWindow.Append(&progressbarEmptyImg); promptWindow.Append(&progressbarEmptyImg);
@ -3296,7 +3296,7 @@ HBCWindowPrompt(const char *name, const char *coder, const char *version,
GuiText nameTxt(name,30 , THEME.prompttext); GuiText nameTxt(name,30 , THEME.prompttext);
nameTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); nameTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
nameTxt.SetPosition(0,-15); nameTxt.SetPosition(0,-15);
nameTxt.SetMaxWidth(430, SCROLL_HORIZONTAL); nameTxt.SetMaxWidth(430, GuiText::SCROLL);
if (strcmp(coder,"")) if (strcmp(coder,""))
@ -3321,16 +3321,11 @@ HBCWindowPrompt(const char *name, const char *coder, const char *version,
release_dateTxt.SetMaxWidth(430); release_dateTxt.SetMaxWidth(430);
int pagesize = 6; int pagesize = 6;
int currentLine = 0;
GuiText long_descriptionTxt(long_description, 20, THEME.prompttext); GuiText long_descriptionTxt(long_description, 20, THEME.prompttext);
long_descriptionTxt.SetAlignment(ALIGN_LEFT, ALIGN_TOP); long_descriptionTxt.SetAlignment(ALIGN_LEFT, ALIGN_TOP);
long_descriptionTxt.SetPosition(46,117); long_descriptionTxt.SetPosition(46,117);
long_descriptionTxt.SetMaxWidth(360, LONGTEXT); long_descriptionTxt.SetMaxWidth(360);
long_descriptionTxt.SetLinesToDraw(pagesize); long_descriptionTxt.SetNumLines(pagesize);
long_descriptionTxt.SetFirstLine(currentLine);
int TotalLines = long_descriptionTxt.GetTotalLines();
//convert filesize from u64 to char and put unit of measurement after it //convert filesize from u64 to char and put unit of measurement after it
char temp2[7]; char temp2[7];
@ -3422,24 +3417,18 @@ HBCWindowPrompt(const char *name, const char *coder, const char *version,
} else if (btn2.GetState() == STATE_CLICKED) { } else if (btn2.GetState() == STATE_CLICKED) {
choice = 0; choice = 0;
} else if ((arrowUpBtn.GetState()==STATE_CLICKED||arrowUpBtn.GetState()==STATE_HELD) ) { } else if ((arrowUpBtn.GetState()==STATE_CLICKED||arrowUpBtn.GetState()==STATE_HELD) ) {
currentLine--; if (long_descriptionTxt.GetFirstLine()>1)
if(currentLine+pagesize > TotalLines) long_descriptionTxt.SetFirstLine(long_descriptionTxt.GetFirstLine()-1);
currentLine = TotalLines-pagesize;
if(currentLine < 0)
currentLine = 0;
long_descriptionTxt.SetFirstLine(currentLine);
usleep(60000); usleep(60000);
if (!((ButtonsHold() & WPAD_BUTTON_UP)||(ButtonsHold() & PAD_BUTTON_UP))) if (!((ButtonsHold() & WPAD_BUTTON_UP)||(ButtonsHold() & PAD_BUTTON_UP)))
arrowUpBtn.ResetState(); arrowUpBtn.ResetState();
} else if (arrowDownBtn.GetState()==STATE_CLICKED||arrowDownBtn.GetState()==STATE_HELD) { } else if ((arrowDownBtn.GetState()==STATE_CLICKED||arrowDownBtn.GetState()==STATE_HELD)
currentLine++; &&long_descriptionTxt.GetTotalLines()>pagesize
if(currentLine+pagesize > TotalLines) &&long_descriptionTxt.GetFirstLine()-1<long_descriptionTxt.GetTotalLines()-pagesize) {
currentLine = TotalLines-pagesize; int l=0;
if(currentLine < 0) l=long_descriptionTxt.GetFirstLine()+1;
currentLine = 0;
long_descriptionTxt.SetFirstLine(currentLine); long_descriptionTxt.SetFirstLine(l);
usleep(60000); usleep(60000);
if (!((ButtonsHold() & WPAD_BUTTON_DOWN)||(ButtonsHold() & PAD_BUTTON_DOWN))) if (!((ButtonsHold() & WPAD_BUTTON_DOWN)||(ButtonsHold() & PAD_BUTTON_DOWN)))
arrowDownBtn.ResetState(); arrowDownBtn.ResetState();

View File

@ -121,7 +121,7 @@ int TitleBrowser(u32 type) {
char line[200]; char line[200];
char tmp[50]; char tmp[50];
snprintf(tmp,50," "); snprintf(tmp,50," ");
//check if the content.bin is on the SD card for that game //check if the content.bin is on the SD card for that game
//if there is content.bin,then the game is on the SDmenu and not the wii //if there is content.bin,then the game is on the SDmenu and not the wii
sprintf(line,"SD:/private/wii/title/%s/content.bin",text); sprintf(line,"SD:/private/wii/title/%s/content.bin",text);
@ -250,7 +250,7 @@ int TitleBrowser(u32 type) {
GuiText titleTxt(tr("Title Launcher"), 28, (GXColor) {0, 0, 0, 255}); GuiText titleTxt(tr("Title Launcher"), 28, (GXColor) {0, 0, 0, 255});
titleTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); titleTxt.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
titleTxt.SetPosition(12,40); titleTxt.SetPosition(12,40);
titleTxt.SetMaxWidth(356, SCROLL_HORIZONTAL); titleTxt.SetMaxWidth(356, GuiText::SCROLL);
GuiImage settingsbackground(&settingsbg); GuiImage settingsbackground(&settingsbg);
GuiButton settingsbackgroundbtn(settingsbackground.GetWidth(), settingsbackground.GetHeight()); GuiButton settingsbackgroundbtn(settingsbackground.GetWidth(), settingsbackground.GetHeight());
@ -406,7 +406,7 @@ int TitleBrowser(u32 type) {
char temp[50]; char temp[50];
char filepath[100]; char filepath[100];
u32 read = 0; u32 read = 0;
//make sure there is a folder for this to be saved in //make sure there is a folder for this to be saved in
struct stat st; struct stat st;
snprintf(filepath, sizeof(filepath), "%s/wad/", bootDevice); snprintf(filepath, sizeof(filepath), "%s/wad/", bootDevice);
@ -416,7 +416,7 @@ int TitleBrowser(u32 type) {
} }
} }
snprintf(filepath, sizeof(filepath), "%s/wad/tmp.tmp", bootDevice); snprintf(filepath, sizeof(filepath), "%s/wad/tmp.tmp", bootDevice);
if (infilesize < MBSIZE) if (infilesize < MBSIZE)
snprintf(filesizetxt, sizeof(filesizetxt), tr("Incoming file %0.2fKB"), infilesize/KBSIZE); snprintf(filesizetxt, sizeof(filesizetxt), tr("Incoming file %0.2fKB"), infilesize/KBSIZE);
@ -493,17 +493,17 @@ int TitleBrowser(u32 type) {
int pick = WindowPrompt(tr(" Wad Saved as:"), tmptxt, tr("Install"),tr("Uninstall"),tr("Cancel")); int pick = WindowPrompt(tr(" Wad Saved as:"), tmptxt, tr("Install"),tr("Uninstall"),tr("Cancel"));
//install or uninstall it //install or uninstall it
if (pick==1) if (pick==1)
{ {
HaltGui(); HaltGui();
w.Remove(&titleTxt); w.Remove(&titleTxt);
w.Remove(&cancelBtn); w.Remove(&cancelBtn);
w.Remove(&wifiBtn); w.Remove(&wifiBtn);
w.Remove(&optionBrowser3); w.Remove(&optionBrowser3);
ResumeGui(); ResumeGui();
Wad_Install(file); Wad_Install(file);
HaltGui(); HaltGui();
w.Append(&titleTxt); w.Append(&titleTxt);
w.Append(&cancelBtn); w.Append(&cancelBtn);

View File

@ -77,7 +77,7 @@ int InitBrowsers() {
char rootdir[ROOTDIRLEN]; char rootdir[ROOTDIRLEN];
for(int i=3; i<STD_MAX; i++) for(int i=3; i<STD_MAX; i++)
{ {
if(strcmp(devoptab_list[i]->name, "stdnull")) if(strcmp(devoptab_list[i]->name, "stdnull"))
{ {
snprintf(rootdir, sizeof(rootdir) , "%s:/", devoptab_list[i]->name); snprintf(rootdir, sizeof(rootdir) , "%s:/", devoptab_list[i]->name);
if(DIR_ITER *dir = diropen(rootdir)) if(DIR_ITER *dir = diropen(rootdir))
@ -195,7 +195,7 @@ int ParseDirectory(const char* Path, int Flags, FILTERCASCADE *Filter) {
return -1; return -1;
} }
if(getcwd(fulldir, sizeof(fulldir))) return -1; // gets the concatenated current working dir if(getcwd(fulldir, sizeof(fulldir))) return -1; // gets the concatenated current working dir
chdir(filename); // restore the saved cwd chdir(filename); // restore the saved cwd
} }
} }
for(i=0; i<browsers.size(); i++) // searchs the browser who match the path for(i=0; i<browsers.size(); i++) // searchs the browser who match the path
@ -206,15 +206,15 @@ int ParseDirectory(const char* Path, int Flags, FILTERCASCADE *Filter) {
break; break;
} }
} }
if(i != browsers.size()) // found browser if(i != browsers.size()) // found browser
{ {
curDevice = i; curDevice = i;
browser = &browsers[curDevice]; browser = &browsers[curDevice];
strcpy(browser->dir, &fulldir[strlen(browser->rootdir)]); strcpy(browser->dir, &fulldir[strlen(browser->rootdir)]);
} }
else if(Flags & FB_TRYSTDDEV) else if(Flags & FB_TRYSTDDEV)
{ {
curDevice = 0; curDevice = 0;
browser = &browsers[curDevice]; // when no browser was found and browser = &browsers[curDevice]; // when no browser was found and
browser->dir[0] = 0; // we alowed try StdDevice and try RootDir browser->dir[0] = 0; // we alowed try StdDevice and try RootDir
strlcpy(fulldir, browser->rootdir, sizeof(fulldir)); // set the first browser with root-dir strlcpy(fulldir, browser->rootdir, sizeof(fulldir)); // set the first browser with root-dir
@ -315,7 +315,7 @@ int BrowseDevice(char * Path, int Path_size, int Flags, FILTERCASCADE *Filter/*=
folderBtn.SetImage(&folderImg); folderBtn.SetImage(&folderImg);
folderBtn.SetTrigger(&trigA); folderBtn.SetTrigger(&trigA);
folderBtn.SetEffectGrow(); folderBtn.SetEffectGrow();
char imgPath[100]; char imgPath[100];
snprintf(imgPath, sizeof(imgPath), "%sbutton_dialogue_box.png", CFG.theme_path); snprintf(imgPath, sizeof(imgPath), "%sbutton_dialogue_box.png", CFG.theme_path);
GuiImageData btnOutline(imgPath, button_dialogue_box_png); GuiImageData btnOutline(imgPath, button_dialogue_box_png);
@ -366,7 +366,7 @@ int BrowseDevice(char * Path, int Path_size, int Flags, FILTERCASCADE *Filter/*=
AdressText.SetTextf("%s%s", browser->rootdir, browser->dir); AdressText.SetTextf("%s%s", browser->rootdir, browser->dir);
AdressText.SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE); AdressText.SetAlignment(ALIGN_LEFT, ALIGN_MIDDLE);
AdressText.SetPosition(20, 0); AdressText.SetPosition(20, 0);
AdressText.SetMaxWidth(Address.GetWidth()-40, SCROLL_HORIZONTAL); AdressText.SetMaxWidth(Address.GetWidth()-40, GuiText::SCROLL);
GuiImage AdressbarImg(&Address); GuiImage AdressbarImg(&Address);
GuiButton Adressbar(Address.GetWidth(), Address.GetHeight()); GuiButton Adressbar(Address.GetWidth(), Address.GetHeight());
Adressbar.SetAlignment(ALIGN_CENTRE, ALIGN_TOP); Adressbar.SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
@ -422,11 +422,11 @@ int BrowseDevice(char * Path, int Path_size, int Flags, FILTERCASCADE *Filter/*=
else if (strcmp(browser->browserList[clickedIndex].filename,".")) else if (strcmp(browser->browserList[clickedIndex].filename,"."))
{ {
/* test new directory namelength */ /* test new directory namelength */
if ((strlen(browser->dir) + strlen(browser->browserList[clickedIndex].filename) if ((strlen(browser->dir) + strlen(browser->browserList[clickedIndex].filename)
+ 1/*'/'*/) < MAXPATHLEN) + 1/*'/'*/) < MAXPATHLEN)
{ {
/* update current directory name */ /* update current directory name */
sprintf(browser->dir, "%s%s/",browser->dir, sprintf(browser->dir, "%s%s/",browser->dir,
browser->browserList[clickedIndex].filename); browser->browserList[clickedIndex].filename);
pathCanged = true; pathCanged = true;
} }
@ -484,7 +484,7 @@ int BrowseDevice(char * Path, int Path_size, int Flags, FILTERCASCADE *Filter/*=
char oldfolder[100]; char oldfolder[100];
snprintf(newfolder, sizeof(newfolder), "%s%s", browser->rootdir, browser->dir); snprintf(newfolder, sizeof(newfolder), "%s%s", browser->rootdir, browser->dir);
strcpy(oldfolder,newfolder); strcpy(oldfolder,newfolder);
int result = OnScreenKeyboard(newfolder, sizeof(newfolder), strlen(browser->rootdir)); int result = OnScreenKeyboard(newfolder, sizeof(newfolder), strlen(browser->rootdir));
if ( result == 1 ) { if ( result == 1 ) {
unsigned int len = strlen(newfolder); unsigned int len = strlen(newfolder);

View File

@ -596,7 +596,7 @@ int showGameInfo(char *ID) {
if (strcmp(gameinfo.title,"") != 0) { if (strcmp(gameinfo.title,"") != 0) {
snprintf(linebuf, sizeof(linebuf), "%s",gameinfo.title); snprintf(linebuf, sizeof(linebuf), "%s",gameinfo.title);
titleTxt = new GuiText(linebuf, titlefontsize, (GXColor) {0,0,0, 255}); titleTxt = new GuiText(linebuf, titlefontsize, (GXColor) {0,0,0, 255});
titleTxt->SetMaxWidth(350, SCROLL_HORIZONTAL); titleTxt->SetMaxWidth(350, GuiText::SCROLL);
//while (titleTxt->GetWidth()>250) { titleTxt->SetFontSize(titlefontsize-=2); } //while (titleTxt->GetWidth()>250) { titleTxt->SetFontSize(titlefontsize-=2); }
titleTxt->SetAlignment(ALIGN_CENTRE, ALIGN_TOP); titleTxt->SetAlignment(ALIGN_CENTRE, ALIGN_TOP);
titleTxt->SetPosition(txtXOffset,12+titley); titleTxt->SetPosition(txtXOffset,12+titley);
@ -664,7 +664,7 @@ int showGameInfo(char *ID) {
snprintf(linebuf, sizeof(linebuf), "%s %s", tr("Published by"), gameinfo.publisher); snprintf(linebuf, sizeof(linebuf), "%s %s", tr("Published by"), gameinfo.publisher);
publisherTxt = new GuiText(linebuf, 16, (GXColor) {0,0,0, 255}); publisherTxt = new GuiText(linebuf, 16, (GXColor) {0,0,0, 255});
if (publisherTxt->GetWidth()>250) newline=2; if (publisherTxt->GetWidth()>250) newline=2;
publisherTxt->SetMaxWidth(250, WRAP); publisherTxt->SetMaxWidth(250,GuiText::WRAP);
publisherTxt->SetAlignment(ALIGN_RIGHT, ALIGN_TOP); publisherTxt->SetAlignment(ALIGN_RIGHT, ALIGN_TOP);
publisherTxt->SetPosition(-17,12+indexy); publisherTxt->SetPosition(-17,12+indexy);
indexy+=(20 * newline); indexy+=(20 * newline);
@ -677,7 +677,7 @@ int showGameInfo(char *ID) {
snprintf(linebuf, sizeof(linebuf), "%s %s", tr("Developed by"), gameinfo.developer); snprintf(linebuf, sizeof(linebuf), "%s %s", tr("Developed by"), gameinfo.developer);
developerTxt = new GuiText(linebuf, 16, (GXColor) {0,0,0, 255}); developerTxt = new GuiText(linebuf, 16, (GXColor) {0,0,0, 255});
if (developerTxt->GetWidth()>250) newline=2; if (developerTxt->GetWidth()>250) newline=2;
developerTxt->SetMaxWidth(250, WRAP); developerTxt->SetMaxWidth(250,GuiText::WRAP);
developerTxt->SetAlignment(ALIGN_RIGHT, ALIGN_TOP); developerTxt->SetAlignment(ALIGN_RIGHT, ALIGN_TOP);
developerTxt->SetPosition(-17,12+indexy); developerTxt->SetPosition(-17,12+indexy);
indexy+=(20 * newline); indexy+=(20 * newline);
@ -721,17 +721,14 @@ int showGameInfo(char *ID) {
//synopsis //synopsis
int pagesize=12; int pagesize=12;
int currentLine = 0;
int TotalLines = 0;
if (strcmp(gameinfo.synopsis,"") != 0) { if (strcmp(gameinfo.synopsis,"") != 0) {
snprintf(linebuf, sizeof(linebuf), "%s", gameinfo.synopsis); snprintf(linebuf, sizeof(linebuf), "%s", gameinfo.synopsis);
synopsisTxt = new GuiText(linebuf, 16, (GXColor) {0,0,0, 255}); synopsisTxt = new GuiText(linebuf, 16, (GXColor) {0,0,0, 255});
synopsisTxt->SetMaxWidth(350, LONGTEXT); synopsisTxt->SetMaxWidth(350,GuiText::WRAP);
synopsisTxt->SetAlignment(ALIGN_LEFT, ALIGN_TOP); synopsisTxt->SetAlignment(ALIGN_LEFT, ALIGN_TOP);
synopsisTxt->SetPosition(0,0); synopsisTxt->SetPosition(0,0);
synopsisTxt->SetLinesToDraw(pagesize); synopsisTxt->SetNumLines(pagesize);
synopsisTxt->SetFirstLine(0); //synopsisTxt->SetFirstLine(12);
TotalLines = synopsisTxt->GetTotalLines();
dialogBoxImg11 = new GuiImage(&dialogBox1); dialogBoxImg11 = new GuiImage(&dialogBox1);
dialogBoxImg11->SetAlignment(0,3); dialogBoxImg11->SetAlignment(0,3);
@ -852,24 +849,23 @@ int showGameInfo(char *ID) {
} }
} else if ((upBtn.GetState()==STATE_CLICKED||upBtn.GetState()==STATE_HELD) && page==2) { } else if ((upBtn.GetState()==STATE_CLICKED||upBtn.GetState()==STATE_HELD) && page==2) {
currentLine--; //int l=synopsisTxt->GetFirstLine()-1;
if(currentLine+pagesize > TotalLines) if (synopsisTxt->GetFirstLine()>1)
currentLine = TotalLines-pagesize; synopsisTxt->SetFirstLine(synopsisTxt->GetFirstLine()-1);
if(currentLine < 0) usleep(60000);
currentLine = 0;
synopsisTxt->SetFirstLine(currentLine);
usleep(60000);
if (!((ButtonsHold() & WPAD_BUTTON_UP)||(ButtonsHold() & PAD_BUTTON_UP))) if (!((ButtonsHold() & WPAD_BUTTON_UP)||(ButtonsHold() & PAD_BUTTON_UP)))
upBtn.ResetState(); upBtn.ResetState();
} else if ((dnBtn.GetState()==STATE_CLICKED||dnBtn.GetState()==STATE_HELD) && page==2) { } else if ((dnBtn.GetState()==STATE_CLICKED||dnBtn.GetState()==STATE_HELD) && page==2
currentLine++; &&synopsisTxt->GetTotalLines()>pagesize
if(currentLine+pagesize > TotalLines) &&synopsisTxt->GetFirstLine()-1<synopsisTxt->GetTotalLines()-pagesize) {
currentLine = TotalLines-pagesize; int l=0;
if(currentLine < 0) //if(synopsisTxt->GetTotalLines()>pagesize)
currentLine = 0; l=synopsisTxt->GetFirstLine()+1;
synopsisTxt->SetFirstLine(currentLine); //if (l>(synopsisTxt->GetTotalLines()+1)-pagesize)
//l=(synopsisTxt->GetTotalLines()+1)-pagesize;
synopsisTxt->SetFirstLine(l);
usleep(60000); usleep(60000);
if (!((ButtonsHold() & WPAD_BUTTON_DOWN)||(ButtonsHold() & PAD_BUTTON_DOWN))) if (!((ButtonsHold() & WPAD_BUTTON_DOWN)||(ButtonsHold() & PAD_BUTTON_DOWN)))
dnBtn.ResetState(); dnBtn.ResetState();

File diff suppressed because it is too large Load Diff

View File

@ -5,7 +5,6 @@
#include "main.h" #include "main.h"
#include <wctype.h> #include <wctype.h>
#include "getentries.h" #include "getentries.h"
#include "FreeTypeGX.h"
#include "../prompts/TitleBrowser.h" #include "../prompts/TitleBrowser.h"
@ -175,7 +174,7 @@ int __Menu_GetPrevFilter(int t, wchar_t* gameFilter, u32 gameFiltered, wchar_t *
if(get_block(header) >= Settings.parentalcontrol) if(get_block(header) >= Settings.parentalcontrol)
continue; continue;
wchar_t *wname = charToWideChar(get_title(header)); wchar_t *wname = FreeTypeGX::charToWideChar(get_title(header));
if(wname) nameList.push_back(wname); if(wname) nameList.push_back(wname);
} }
@ -221,7 +220,7 @@ int __Menu_GetGameFilter_NextList(discHdr *gameList, u32 gameCnt, wchar_t **Pgam
for(i=0; i<gameCnt; i++) for(i=0; i<gameCnt; i++)
{ {
u32 nextFilterChar = 0x10000; u32 nextFilterChar = 0x10000;
wchar_t *gameName = charToWideChar(get_title(&gameList[i])); wchar_t *gameName = FreeTypeGX::charToWideChar(get_title(&gameList[i]));
if(gameName == NULL) goto error; if(gameName == NULL) goto error;
if(wcslen(gameName) > filter_len) if(wcslen(gameName) > filter_len)
@ -392,7 +391,7 @@ int buildTitleList(int t, wchar_t* gameFilter, discHdr ** PgameList, u32 *PgameC
if(gameFilter && *gameFilter) { if(gameFilter && *gameFilter) {
u32 filter_len = wcslen(gameFilter); u32 filter_len = wcslen(gameFilter);
wchar_t *gameName = charToWideChar(get_title(header)); wchar_t *gameName = FreeTypeGX::charToWideChar(get_title(header));
if (!gameName || wcsnicmp(gameName, gameFilter, filter_len)) { if (!gameName || wcsnicmp(gameName, gameFilter, filter_len)) {
delete [] gameName; delete [] gameName;
continue; continue;
@ -487,7 +486,7 @@ int __Menu_GetGameList(int t, wchar_t* gameFilter, discHdr ** PgameList, u32 *Pg
if(gameFilter && *gameFilter && t==0) { if(gameFilter && *gameFilter && t==0) {
u32 filter_len = wcslen(gameFilter); u32 filter_len = wcslen(gameFilter);
wchar_t *gameName = charToWideChar(get_title(header)); wchar_t *gameName = FreeTypeGX::charToWideChar(get_title(header));
if (!gameName || wcsnicmp(gameName, gameFilter, filter_len)) { if (!gameName || wcsnicmp(gameName, gameFilter, filter_len)) {
delete [] gameName; delete [] gameName;
continue; continue;

View File

@ -218,12 +218,12 @@ void StopGX() {
* Renders everything current sent to GX, and flushes video * Renders everything current sent to GX, and flushes video
***************************************************************************/ ***************************************************************************/
void Menu_Render() { void Menu_Render() {
GX_DrawDone ();
whichfb ^= 1; // flip framebuffer whichfb ^= 1; // flip framebuffer
GX_SetZMode(GX_TRUE, GX_LEQUAL, GX_TRUE); GX_SetZMode(GX_TRUE, GX_LEQUAL, GX_TRUE);
GX_SetColorUpdate(GX_TRUE); GX_SetColorUpdate(GX_TRUE);
GX_CopyDisp(xfb[whichfb],GX_TRUE); GX_CopyDisp(xfb[whichfb],GX_TRUE);
GX_DrawDone ();
VIDEO_SetNextFramebuffer(xfb[whichfb]); VIDEO_SetNextFramebuffer(xfb[whichfb]);
VIDEO_Flush(); VIDEO_Flush();
VIDEO_WaitVSync(); VIDEO_WaitVSync();

View File

@ -141,11 +141,9 @@ s32 Wad_Install(FILE *fp)
GuiText btn1Txt(tr("OK"), 22, THEME.prompttext); GuiText btn1Txt(tr("OK"), 22, THEME.prompttext);
GuiImage btn1Img(&btnOutline); GuiImage btn1Img(&btnOutline);
if (Settings.wsprompt == yes) if (Settings.wsprompt == yes){
{ btn1Txt.SetWidescreen(CFG.widescreen);
btn1Txt.SetWidescreen(CFG.widescreen); btn1Img.SetWidescreen(CFG.widescreen);}
btn1Img.SetWidescreen(CFG.widescreen);
}
GuiButton btn1(&btn1Img,&btn1Img, 2, 4, 0, -35, &trigA, &btnSoundOver, &btnClick,1); GuiButton btn1(&btn1Img,&btn1Img, 2, 4, 0, -35, &trigA, &btnSoundOver, &btnClick,1);
btn1.SetLabel(&btn1Txt); btn1.SetLabel(&btn1Txt);
btn1.SetState(STATE_SELECTED); btn1.SetState(STATE_SELECTED);
@ -371,7 +369,7 @@ s32 Wad_Install(FILE *fp)
// Increase variables // Increase variables
idx += size; idx += size;
offset += size; offset += size;
//snprintf(imgPath, sizeof(imgPath), "%s%d (%d)...",tr(">> Installing content #"),content->cid,idx); //snprintf(imgPath, sizeof(imgPath), "%s%d (%d)...",tr(">> Installing content #"),content->cid,idx);
//msg4Txt.SetText(imgPath); //msg4Txt.SetText(imgPath);
@ -472,11 +470,9 @@ s32 Wad_Uninstall(FILE *fp)
GuiText btn1Txt(tr("OK"), 22, THEME.prompttext); GuiText btn1Txt(tr("OK"), 22, THEME.prompttext);
GuiImage btn1Img(&btnOutline); GuiImage btn1Img(&btnOutline);
if (Settings.wsprompt == yes) if (Settings.wsprompt == yes){
{ btn1Txt.SetWidescreen(CFG.widescreen);
btn1Txt.SetWidescreen(CFG.widescreen); btn1Img.SetWidescreen(CFG.widescreen);}
btn1Img.SetWidescreen(CFG.widescreen);
}
GuiButton btn1(&btn1Img,&btn1Img, 2, 4, 0, -55, &trigA, &btnSoundOver, &btnClick,1); GuiButton btn1(&btn1Img,&btn1Img, 2, 4, 0, -55, &trigA, &btnSoundOver, &btnClick,1);
btn1.SetLabel(&btn1Txt); btn1.SetLabel(&btn1Txt);
btn1.SetState(STATE_SELECTED); btn1.SetState(STATE_SELECTED);