new icons, minor bugfixes

This commit is contained in:
dborth 2009-04-06 06:30:47 +00:00
parent 78d82f5ebd
commit 5efb6e6a69
10 changed files with 84 additions and 66 deletions

View File

@ -35,11 +35,11 @@ int FDSSwitchRequested;
/*** External 2D Video ***/
/*** 2D Video Globals ***/
static GXRModeObj *vmode; // Graphics Mode Object
unsigned int *xfb[2]; // Framebuffers
int whichfb = 0; // Frame buffer toggle
static unsigned int *xfb[2]; // Framebuffers
static int whichfb = 0; // Frame buffer toggle
int screenheight;
int screenwidth;
bool progressive = FALSE;
bool progressive = false;
/*** 3D GX ***/
#define TEX_WIDTH 256
@ -226,7 +226,7 @@ static void SyncSpeed()
***************************************************************************/
#define TSTACK 16384
static lwpq_t videoblankqueue;
static lwp_t vbthread;
static lwp_t vbthread = LWP_THREAD_NULL;
static unsigned char vbstack[TSTACK];
/****************************************************************************
@ -528,7 +528,7 @@ InitGCVideo ()
#ifdef HW_RVL
// widescreen fix
if(CONF_GetAspectRatio())
if(CONF_GetAspectRatio() == CONF_ASPECT_16_9)
{
vmode->viWidth = VI_MAX_WIDTH_PAL-12;
vmode->viXOrigin = ((VI_MAX_WIDTH_PAL - vmode->viWidth) / 2) + 2;
@ -744,6 +744,7 @@ void RenderFrame(unsigned char *XBuf)
// load texture into GX
DCFlushRange(texturemem, TEX_WIDTH * TEX_HEIGHT * 2);
GX_LoadTexObj (&texobj, GX_TEXMAP0);
GX_InvalidateTexAll();
// render textured quad
draw_square(view);

View File

@ -751,13 +751,13 @@ typedef struct _keytype {
class GuiKeyboard : public GuiWindow
{
public:
GuiKeyboard(char * t, u16 m);
GuiKeyboard(char * t, u32 m);
~GuiKeyboard();
void Update(GuiTrigger * t);
char kbtextstr[100];
char kbtextstr[256];
protected:
u16 kbtextmaxlen;
Key keys[4][10];
u32 kbtextmaxlen;
Key keys[4][11];
int shift;
int caps;
GuiText * kbText;
@ -777,10 +777,10 @@ class GuiKeyboard : public GuiWindow
GuiImage * keySpaceImg;
GuiImage * keySpaceOverImg;
GuiButton * keySpace;
GuiButton * keyBtn[4][10];
GuiImage * keyImg[4][10];
GuiImage * keyImgOver[4][10];
GuiText * keyTxt[4][10];
GuiButton * keyBtn[4][11];
GuiImage * keyImg[4][11];
GuiImage * keyImgOver[4][11];
GuiText * keyTxt[4][11];
GuiImageData * keyTextbox;
GuiImageData * key;
GuiImageData * keyOver;

View File

@ -14,7 +14,7 @@
* Constructor for the GuiKeyboard class.
*/
GuiKeyboard::GuiKeyboard(char * t, u16 max)
GuiKeyboard::GuiKeyboard(char * t, u32 max)
{
width = 540;
height = 400;
@ -24,11 +24,11 @@ GuiKeyboard::GuiKeyboard(char * t, u16 max)
focus = 0; // allow focus
alignmentHor = ALIGN_CENTRE;
alignmentVert = ALIGN_MIDDLE;
strncpy(kbtextstr, t, 100);
kbtextstr[100] = 0;
strncpy(kbtextstr, t, max);
kbtextstr[max] = 0;
kbtextmaxlen = max;
Key thekeys[4][10] = {
Key thekeys[4][11] = {
{
{'1','!'},
{'2','@'},
@ -39,7 +39,8 @@ GuiKeyboard::GuiKeyboard(char * t, u16 max)
{'7','&'},
{'8','*'},
{'9','('},
{'0',')'}
{'0',')'},
{'\0','\0'}
},
{
{'q','Q'},
@ -51,7 +52,8 @@ GuiKeyboard::GuiKeyboard(char * t, u16 max)
{'u','U'},
{'i','I'},
{'o','O'},
{'p','P'}
{'p','P'},
{'-','_'}
},
{
{'a','A'},
@ -63,7 +65,8 @@ GuiKeyboard::GuiKeyboard(char * t, u16 max)
{'j','J'},
{'k','K'},
{'l','L'},
{':',';'}
{':',';'},
{'\'','"'}
},
{
@ -76,7 +79,8 @@ GuiKeyboard::GuiKeyboard(char * t, u16 max)
{'m','M'},
{',','<'},
{'.','>'},
{'/','?'}
{'/','?'},
{'\0','\0'}
}
};
memcpy(keys, thekeys, sizeof(thekeys));
@ -165,23 +169,26 @@ GuiKeyboard::GuiKeyboard(char * t, u16 max)
for(int i=0; i<4; i++)
{
for(int j=0; j<10; j++)
for(int j=0; j<11; j++)
{
keyImg[i][j] = new GuiImage(key);
keyImgOver[i][j] = new GuiImage(keyOver);
keyTxt[i][j] = new GuiText(NULL, 22, (GXColor){0, 0, 0, 0xff});
keyTxt[i][j]->SetAlignment(ALIGN_CENTRE, ALIGN_BOTTOM);
keyTxt[i][j]->SetPosition(0, -10);
keyBtn[i][j] = new GuiButton(key->GetWidth(), key->GetHeight());
keyBtn[i][j]->SetImage(keyImg[i][j]);
keyBtn[i][j]->SetImageOver(keyImgOver[i][j]);
keyBtn[i][j]->SetSoundOver(keySoundOver);
keyBtn[i][j]->SetSoundClick(keySoundClick);
keyBtn[i][j]->SetTrigger(trigA);
keyBtn[i][j]->SetLabel(keyTxt[i][j]);
keyBtn[i][j]->SetPosition(j*42+21*i+40, i*42+80);
keyBtn[i][j]->SetEffectGrow();
this->Append(keyBtn[i][j]);
if(keys[i][j].ch != '\0')
{
keyImg[i][j] = new GuiImage(key);
keyImgOver[i][j] = new GuiImage(keyOver);
keyTxt[i][j] = new GuiText(NULL, 22, (GXColor){0, 0, 0, 0xff});
keyTxt[i][j]->SetAlignment(ALIGN_CENTRE, ALIGN_BOTTOM);
keyTxt[i][j]->SetPosition(0, -10);
keyBtn[i][j] = new GuiButton(key->GetWidth(), key->GetHeight());
keyBtn[i][j]->SetImage(keyImg[i][j]);
keyBtn[i][j]->SetImageOver(keyImgOver[i][j]);
keyBtn[i][j]->SetSoundOver(keySoundOver);
keyBtn[i][j]->SetSoundClick(keySoundClick);
keyBtn[i][j]->SetTrigger(trigA);
keyBtn[i][j]->SetLabel(keyTxt[i][j]);
keyBtn[i][j]->SetPosition(j*42+21*i+40, i*42+80);
keyBtn[i][j]->SetEffectGrow();
this->Append(keyBtn[i][j]);
}
}
}
}
@ -221,12 +228,15 @@ GuiKeyboard::~GuiKeyboard()
for(int i=0; i<4; i++)
{
for(int j=0; j<10; j++)
for(int j=0; j<11; j++)
{
delete keyImg[i][j];
delete keyImgOver[i][j];
delete keyTxt[i][j];
delete keyBtn[i][j];
if(keys[i][j].ch != '\0')
{
delete keyImg[i][j];
delete keyImgOver[i][j];
delete keyTxt[i][j];
delete keyBtn[i][j];
}
}
}
}
@ -272,31 +282,34 @@ void GuiKeyboard::Update(GuiTrigger * t)
for(int i=0; i<4; i++)
{
for(int j=0; j<10; j++)
for(int j=0; j<11; j++)
{
if(shift || caps)
txt[0] = keys[i][j].chShift;
else
txt[0] = keys[i][j].ch;
keyTxt[i][j]->SetText(txt);
if(keyBtn[i][j]->GetState() == STATE_CLICKED)
if(keys[i][j].ch != '\0')
{
if(strlen(kbtextstr) < kbtextmaxlen)
if(shift || caps)
txt[0] = keys[i][j].chShift;
else
txt[0] = keys[i][j].ch;
keyTxt[i][j]->SetText(txt);
if(keyBtn[i][j]->GetState() == STATE_CLICKED)
{
if(shift || caps)
if(strlen(kbtextstr) < kbtextmaxlen)
{
kbtextstr[strlen(kbtextstr)] = keys[i][j].chShift;
if(shift) shift ^= 1;
}
else
{
kbtextstr[strlen(kbtextstr)] = keys[i][j].ch;
if(shift || caps)
{
kbtextstr[strlen(kbtextstr)] = keys[i][j].chShift;
if(shift) shift ^= 1;
}
else
{
kbtextstr[strlen(kbtextstr)] = keys[i][j].ch;
}
}
kbText->SetText(kbtextstr);
keyBtn[i][j]->SetState(STATE_SELECTED);
}
kbText->SetText(kbtextstr);
keyBtn[i][j]->SetState(STATE_SELECTED);
}
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 4.8 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.9 KiB

After

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.3 KiB

After

Width:  |  Height:  |  Size: 4.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

View File

@ -542,7 +542,7 @@ void AutoSave()
* Opens an on-screen keyboard window, with the data entered being stored
* into the specified variable.
***************************************************************************/
static void OnScreenKeyboard(char * var, u16 maxlen)
static void OnScreenKeyboard(char * var, u32 maxlen)
{
int save = -1;
@ -3080,7 +3080,7 @@ static int MenuSettingsFile()
else if (GCSettings.AutoLoad == 1) sprintf (options.value[5],"RAM");
else if (GCSettings.AutoLoad == 2) sprintf (options.value[5],"State");
if (GCSettings.AutoSave == 0) sprintf (options.value[5],"Off");
if (GCSettings.AutoSave == 0) sprintf (options.value[6],"Off");
else if (GCSettings.AutoSave == 1) sprintf (options.value[6],"RAM");
else if (GCSettings.AutoSave == 2) sprintf (options.value[6],"State");
else if (GCSettings.AutoSave == 3) sprintf (options.value[6],"Both");
@ -3100,15 +3100,15 @@ static int MenuSettingsFile()
break;
case 2:
OnScreenKeyboard(GCSettings.LoadFolder, 256);
OnScreenKeyboard(GCSettings.LoadFolder, 30);
break;
case 3:
OnScreenKeyboard(GCSettings.SaveFolder, 256);
OnScreenKeyboard(GCSettings.SaveFolder, 30);
break;
case 4:
OnScreenKeyboard(GCSettings.CheatFolder, 256);
OnScreenKeyboard(GCSettings.CheatFolder, 30);
break;
case 5:
@ -3414,6 +3414,8 @@ MainMenu (int menu)
else
trigA.SetSimpleTrigger(-1, WPAD_BUTTON_A | WPAD_CLASSIC_BUTTON_A, PAD_BUTTON_A);
GuiSound btnSoundOver(button_over_pcm, button_over_pcm_size, SOUND_PCM);
GuiSound btnSoundClick(button_click_pcm, button_click_pcm_size, SOUND_PCM);
GuiImageData bgTop(bg_top_png);
bgTopImg = new GuiImage(&bgTop);
GuiImageData bgBottom(bg_bottom_png);
@ -3431,6 +3433,8 @@ MainMenu (int menu)
btnLogo->SetImage(&logoImg);
btnLogo->SetImageOver(&logoImgOver);
btnLogo->SetLabel(&logoTxt);
btnLogo->SetSoundOver(&btnSoundOver);
btnLogo->SetSoundClick(&btnSoundClick);
btnLogo->SetTrigger(&trigA);
btnLogo->SetUpdateCallback(WindowCredits);