cleanup while loop vars

This commit is contained in:
dborth 2009-06-02 06:47:03 +00:00
parent f5563ce001
commit bfbcc57380

View File

@ -249,6 +249,8 @@ EmulatorUpdate (void *arg)
static void * static void *
UpdateGUI (void *arg) UpdateGUI (void *arg)
{ {
int i;
while(1) while(1)
{ {
if(guiHalt) if(guiHalt)
@ -260,7 +262,7 @@ UpdateGUI (void *arg)
mainWindow->Draw(); mainWindow->Draw();
#ifdef HW_RVL #ifdef HW_RVL
for(int i=3; i >= 0; i--) // so that player 1's cursor appears on top! for(i=3; i >= 0; i--) // so that player 1's cursor appears on top!
{ {
if(userInput[i].wpad.ir.valid) if(userInput[i].wpad.ir.valid)
Menu_DrawImg(userInput[i].wpad.ir.x-48, userInput[i].wpad.ir.y-48, Menu_DrawImg(userInput[i].wpad.ir.x-48, userInput[i].wpad.ir.y-48,
@ -271,7 +273,7 @@ UpdateGUI (void *arg)
Menu_Render(); Menu_Render();
for(int i=3; i >= 0; i--) for(i=3; i >= 0; i--)
mainWindow->Update(&userInput[i]); mainWindow->Update(&userInput[i]);
#ifdef HW_RVL #ifdef HW_RVL
@ -284,10 +286,10 @@ UpdateGUI (void *arg)
if(ExitRequested || ShutdownRequested) if(ExitRequested || ShutdownRequested)
{ {
for(int a = 0; a < 255; a += 15) for(i = 0; i < 255; i += 15)
{ {
mainWindow->Draw(); mainWindow->Draw();
Menu_DrawRectangle(0,0,screenwidth,screenheight,(GXColor){0, 0, 0, a},1); Menu_DrawRectangle(0,0,screenwidth,screenheight,(GXColor){0, 0, 0, i},1);
Menu_Render(); Menu_Render();
} }
@ -861,6 +863,8 @@ static void WindowCredits(void * ptr)
static int MenuGameSelection() static int MenuGameSelection()
{ {
int menu = MENU_NONE; int menu = MENU_NONE;
int i;
bool res;
GuiText titleTxt("Choose Game", 28, (GXColor){255, 255, 255, 255}); GuiText titleTxt("Choose Game", 28, (GXColor){255, 255, 255, 255});
titleTxt.SetAlignment(ALIGN_LEFT, ALIGN_TOP); titleTxt.SetAlignment(ALIGN_LEFT, ALIGN_TOP);
@ -963,7 +967,7 @@ static int MenuGameSelection()
// update gameWindow based on arrow buttons // update gameWindow based on arrow buttons
// set MENU_EXIT if A button pressed on a game // set MENU_EXIT if A button pressed on a game
for(int i=0; i<PAGESIZE; i++) for(i=0; i<PAGESIZE; i++)
{ {
if(gameBrowser.gameList[i]->GetState() == STATE_CLICKED) if(gameBrowser.gameList[i]->GetState() == STATE_CLICKED)
{ {
@ -971,8 +975,6 @@ static int MenuGameSelection()
// check corresponding browser entry // check corresponding browser entry
if(browserList[browser.selIndex].isdir || IsSz()) if(browserList[browser.selIndex].isdir || IsSz())
{ {
bool res;
if(IsSz()) if(IsSz())
res = BrowserLoadSz(GCSettings.LoadMethod); res = BrowserLoadSz(GCSettings.LoadMethod);
else else
@ -1244,7 +1246,7 @@ static int MenuGame()
closeBtn.SetEffectGrow(); closeBtn.SetEffectGrow();
#ifdef HW_RVL #ifdef HW_RVL
int i = 0; int i, level;
char txt[3]; char txt[3];
GuiText * batteryTxt[4]; GuiText * batteryTxt[4];
GuiImage * batteryImg[4]; GuiImage * batteryImg[4];
@ -1332,7 +1334,6 @@ static int MenuGame()
usleep(THREAD_SLEEP); usleep(THREAD_SLEEP);
#ifdef HW_RVL #ifdef HW_RVL
int level;
for(i=0; i < 4; i++) for(i=0; i < 4; i++)
{ {
if(WPAD_Probe(i, NULL) == WPAD_ERR_NONE) // controller connected if(WPAD_Probe(i, NULL) == WPAD_ERR_NONE) // controller connected
@ -1447,7 +1448,7 @@ static int MenuGame()
static int MenuGameSaves(int action) static int MenuGameSaves(int action)
{ {
int menu = MENU_NONE; int menu = MENU_NONE;
int ret; int ret, result;
int i, n, len, len2; int i, n, len, len2;
int j = 0; int j = 0;
SaveList saves; SaveList saves;
@ -1627,7 +1628,7 @@ static int MenuGameSaves(int action)
// load or save game // load or save game
if(ret > -3) if(ret > -3)
{ {
int result = 0; result = 0;
if(action == 0) // load if(action == 0) // load
{ {
@ -2427,6 +2428,7 @@ static int MenuSettingsMappingsMap()
{ {
int menu = MENU_NONE; int menu = MENU_NONE;
int ret,i,j; int ret,i,j;
u32 pressed;
OptionList options; OptionList options;
char menuTitle[100]; char menuTitle[100];
@ -2529,7 +2531,7 @@ static int MenuSettingsMappingsMap()
if(ret >= 0) if(ret >= 0)
{ {
u32 pressed = ButtonMappingWindow(); // get a button selection from user pressed = ButtonMappingWindow(); // get a button selection from user
if (pressed > 0) if (pressed > 0)
btnmap[mapMenuCtrlNES][mapMenuCtrl][ret] = pressed; // update mapping btnmap[mapMenuCtrlNES][mapMenuCtrl][ret] = pressed; // update mapping