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

Function UpdateGUI

source/menu.cpp:336–393  ·  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

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

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