MCPcopy Create free account
hub / github.com/dborth/fceugx / UpdateGUI

Function UpdateGUI

source/menu.cpp:347–404  ·  view source on GitHub ↗

* UpdateGUI * * Primary thread to allow GUI to respond to state changes, and draws GUI ***************************************************************************/

Source from the content-addressed store, hash-verified

345 * Primary thread to allow GUI to respond to state changes, and draws GUI
346 ***************************************************************************/
347static void *
348UpdateGUI (void *arg)
349{
350 int i;
351
352 while(1)
353 {
354 // if halted, block here until ResumeGui wakes us; signal HaltGui we have stopped
355 LWP_MutexLock(guiMutex);
356 if(guiHalt)
357 {
358 guiHalted = true;
359 LWP_CondBroadcast(guiHaltCond);
360 while(guiHalt)
361 LWP_CondWait(guiWakeCond, guiMutex);
362 guiHalted = false;
363 }
364 LWP_MutexUnlock(guiMutex);
365
366 UpdatePads();
367 mainWindow->Draw();
368
369 if (mainWindow->GetState() != STATE_DISABLED)
370 mainWindow->DrawTooltip();
371
372 #ifdef HW_RVL
373 i = 3;
374 do
375 {
376 if(userInput[i].wpad->ir.valid) {
377 Menu_DrawImg(userInput[i].wpad->ir.x-48, userInput[i].wpad->ir.y-48, 96, 96, pointer[i]->GetImage(), userInput[i].wpad->ir.angle, 1, 1, 255);
378 }
379 DoRumble(i);
380 --i;
381 } while(i>=0);
382 #endif
383
384 Menu_Render();
385
386 mainWindow->Update(&userInput[3]);
387 mainWindow->Update(&userInput[2]);
388 mainWindow->Update(&userInput[1]);
389 mainWindow->Update(&userInput[0]);
390
391 if(ExitRequested || ShutdownRequested)
392 {
393 for(i = 0; i <= 255; i += 15)
394 {
395 mainWindow->Draw();
396 Menu_DrawRectangle(0,0,screenwidth,screenheight,(GXColor){0, 0, 0, (u8)i},1);
397 Menu_Render();
398 }
399 ExitApp();
400 }
401 usleep(THREAD_SLEEP);
402 }
403 return NULL;
404}

Callers

nothing calls this directly

Calls 11

UpdatePadsFunction · 0.85
Menu_DrawImgFunction · 0.85
DoRumbleFunction · 0.85
Menu_RenderFunction · 0.85
Menu_DrawRectangleFunction · 0.85
ExitAppFunction · 0.85
GetStateMethod · 0.80
DrawMethod · 0.45
DrawTooltipMethod · 0.45
GetImageMethod · 0.45
UpdateMethod · 0.45

Tested by

no test coverage detected