Added a special font for the clock

This commit is contained in:
ardi@ist-einmalig.de 2009-05-04 21:50:46 +00:00
parent fc549f113f
commit a00104784f
8 changed files with 1158 additions and 1130 deletions

File diff suppressed because it is too large Load Diff

View File

@ -142,85 +142,85 @@ struct Game_CFG
};
void CFG_Default();
void CFG_Default(int widescreen); // -1 = non forced mode
void CFG_Load(int argc, char **argv);
struct Game_CFG* CFG_get_game_opt(u8 *id);
bool CFG_save_game_opt(u8 *id);
bool CFG_forget_game_opt(u8 *id);
bool CFG_forget_game_opt(u8 *id);
//Astidof - Begin of modification
enum {
ConsoleLangDefault,
jap,
eng,
ger,
fren,
esp,
it,
dut,
enum {
ConsoleLangDefault,
jap,
eng,
ger,
fren,
esp,
it,
dut,
schin,
tchin,
kor
};
enum {
enum {
systemdefault,
discdefault,
discdefault,
patch,
pal50,
pal60,
ntsc
};
ntsc
};
enum {
off,
on,
};
enum {
GameID,
GameRegion,
Both,
Neither,
};
enum {
i249,
i222,
};
enum {
GameID,
GameRegion,
Both,
Neither,
};
enum {
i249,
i222,
};
enum {
ios249,
ios222,
};
enum {
HDDInfo,
Clock,
};
enum {
RumbleOff,
RumbleOn,
};
enum {
TooltipsOff,
TooltipsOn,
};
enum {
v10,
v20,
v30,
v40,
v50,
v60,
v70,
v80,
v90,
v100,
v0,
enum {
HDDInfo,
Clock,
};
enum {
RumbleOff,
RumbleOn,
};
enum {
TooltipsOff,
TooltipsOn,
};
enum {
v10,
v20,
v30,
v40,
v50,
v60,
v70,
v80,
v90,
v100,
v0,
};
enum {
@ -228,24 +228,24 @@ enum {
ParentalControlLevel1,
ParentalControlLevel2,
ParentalControlLevel3
};
struct SSettings {
int video;
int language;
int ocarina;
};
struct SSettings {
int video;
int language;
int ocarina;
int vpatch;
int ios;
int sinfo;
int hddinfo;
int rumble;
int volume;
int ios;
int sinfo;
int hddinfo;
int rumble;
int volume;
int tooltips;
char unlockCode[20];
int parentalcontrol;
int cios;
};
int cios;
};
void CFG_LoadGlobal(void);
bool cfg_save_global(void);
//Astidof - End of modification

View File

@ -14,6 +14,9 @@
extern const u8 font_ttf[];
extern const u32 font_ttf_size;
extern const u8 clock_ttf[];
extern const u32 clock_ttf_size;
extern const u8 sdcard_png[];
extern const u32 sdcard_png_size;

BIN
source/fonts/clock.ttf Normal file

Binary file not shown.

View File

@ -622,6 +622,7 @@ class GuiText : public GuiElement
//!\param hor Horizontal alignment (ALIGN_LEFT, ALIGN_RIGHT, ALIGN_CENTRE)
//!\param vert Vertical alignment (ALIGN_TOP, ALIGN_BOTTOM, ALIGN_MIDDLE)
void SetAlignment(int hor, int vert);
void SetFont(FreeTypeGX *f);
//!Constantly called to draw the text
void Draw();
protected:
@ -630,6 +631,7 @@ class GuiText : public GuiElement
int maxWidth; //!< Maximum width of the generated text object (for text wrapping)
u16 style; //!< FreeTypeGX style attributes
GXColor color; //!< Font color
FreeTypeGX *font;
};
//!Display, manage, and manipulate buttons in the GUI. Buttons can have images, icons, text, and sound set (all of which are optional)

View File

@ -29,6 +29,7 @@ GuiText::GuiText(const char * t, int s, GXColor c)
alpha = c.a;
style = FTGX_JUSTIFY_CENTER | FTGX_ALIGN_MIDDLE;
maxWidth = 0;
font = 0;
alignmentHor = ALIGN_CENTRE;
alignmentVert = ALIGN_MIDDLE;
@ -142,7 +143,13 @@ void GuiText::SetAlignment(int hor, int vert)
alignmentHor = hor;
alignmentVert = vert;
}
/**
* Set the Font
*/
void GuiText::SetFont(FreeTypeGX *f)
{
font = f;
}
/**
* Draw the text on screen
*/
@ -161,7 +168,7 @@ void GuiText::Draw()
if(newSize != currentSize)
{
fontSystem->changeSize(newSize);
(font ? font : fontSystem)->changeSize(newSize);
currentSize = newSize;
}
@ -191,7 +198,7 @@ void GuiText::Draw()
if(text[ch] == ' ' || ch == strlen-1)
{
if(fontSystem->getWidth(tmptext[linenum]) >= maxWidth)
if((font ? font : fontSystem)->getWidth(tmptext[linenum]) >= maxWidth)
{
if(lastSpace >= 0)
{
@ -222,13 +229,13 @@ void GuiText::Draw()
for(i=0; i < linenum; i++)
{
fontSystem->drawText(this->GetLeft(), this->GetTop()+voffset+i*lineheight, tmptext[i], c, style);
(font ? font : fontSystem)->drawText(this->GetLeft(), this->GetTop()+voffset+i*lineheight, tmptext[i], c, style);
delete tmptext[i];
}
}
else
{
fontSystem->drawText(this->GetLeft(), this->GetTop()+voffset, text, c, style);
(font ? font : fontSystem)->drawText(this->GetLeft(), this->GetTop()+voffset, text, c, style);
}
this->UpdateEffects();
}

View File

@ -41,7 +41,8 @@
#define CONSOLE_WIDTH 340
#define CONSOLE_HEIGHT 218
FreeTypeGX *fontSystem;
FreeTypeGX *fontSystem=0;
FreeTypeGX *fontClock=0;
int ExitRequested = 0;
bool netcheck = false;
@ -146,6 +147,10 @@ main(int argc, char *argv[])
fontSystem->loadFont(font_ttf, font_ttf_size, 0);
fontSystem->setCompatibilityMode(FTGX_COMPATIBILITY_DEFAULT_TEVOP_GX_PASSCLR | FTGX_COMPATIBILITY_DEFAULT_VTXDESC_GX_NONE);
fontClock = new FreeTypeGX();
fontClock->loadFont(clock_ttf, clock_ttf_size, 0);
fontClock->setCompatibilityMode(FTGX_COMPATIBILITY_DEFAULT_TEVOP_GX_PASSCLR | FTGX_COMPATIBILITY_DEFAULT_VTXDESC_GX_NONE);
InitGUIThreads();
MainMenu(MENU_CHECK);
return 0;

View File

@ -42,6 +42,8 @@
#define MAX_CHARACTERS 38
extern FreeTypeGX *fontClock; //CLOCK
static GuiImage * coverImg = NULL;
static GuiImageData * cover = NULL;
@ -2381,6 +2383,7 @@ static int MenuDiscList()
GuiText clockTime(theTime, 30, (GXColor){138, 138, 138, 255});
clockTime.SetAlignment(THEME.clockAlign, ALIGN_BOTTOM);
clockTime.SetPosition(THEME.clock_x, THEME.clock_y);
clockTime.SetFont(fontClock);
HaltGui();
GuiWindow w(screenwidth, screenheight);
@ -2609,7 +2612,7 @@ static int MenuDiscList()
snprintf (ID,sizeof(ID),"%c%c%c", header->id[0], header->id[1], header->id[2]);
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]);
w.Remove(&DownloadBtn);
w.Remove(coverImg);
// w.Remove(coverImg);
if (GameIDTxt)
{