Guest User

Untitled

a guest
Jun 21st, 2018
104
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.55 KB | None | 0 0
  1. void WindowScreensaver()
  2. {
  3. int i = 0;
  4. bool exit = false;
  5.  
  6. /* initialize random seed: */
  7. srand ( time(NULL) );
  8.  
  9. //GuiSound * creditsMusic = NULL;
  10.  
  11. // s32 thetimeofbg = bgMusic->GetPlayTime();
  12. //StopOgg();
  13.  
  14. /*creditsMusic = new GuiSound(credits_music_ogg, credits_music_ogg_size, SOUND_OGG, 55);
  15. creditsMusic->SetVolume(60);
  16. creditsMusic->SetLoop(1);
  17. creditsMusic->Play();*/
  18.  
  19. GuiImageData GXlogo(gxlogo_png);
  20. GuiImage GXlogoImg(&GXlogo);
  21. GXlogoImg.SetPosition(320,240);
  22. GXlogoImg.SetAlignment(ALIGN_LEFT,ALIGN_TOP);
  23.  
  24. GuiWindow screensaverWindow(screenwidth,screenheight);
  25. screensaverWindow.Append(&GXlogoImg);
  26.  
  27. HaltGui();
  28. mainWindow->SetState(STATE_DISABLED);
  29. mainWindow->Append(&screensaverWindow);
  30. ResumeGui();
  31.  
  32.  
  33.  
  34. while(!exit)
  35. {
  36. //Menu_DrawRectangle(0,0,screenwidth,screenheight,(GXColor){0, 0, 0,255},1);
  37.  
  38. i++;
  39.  
  40. if(IsWpadConnected())
  41. {
  42. exit = true;
  43. }
  44. /* Set position only every 400000th loop */
  45. if((i % 4000000) == 0)
  46. {
  47. /* Set random position */
  48. GXlogoImg.SetPosition((rand() % 345), (rand() % 305));
  49. }
  50.  
  51. }
  52.  
  53. //creditsMusic->Stop();
  54.  
  55. //delete creditsMusic;
  56.  
  57. HaltGui();
  58. mainWindow->Remove(&screensaverWindow);
  59. mainWindow->SetState(STATE_DEFAULT);
  60. ResumeGui();
  61.  
  62. //if(!strcmp("", Settings.oggload_path) || !strcmp("notset", Settings.ogg_path)) {
  63. // bgMusic->Play();
  64. // } else {
  65. // bgMusic->PlayOggFile(Settings.ogg_path);
  66. // }
  67. // bgMusic->SetPlayTime(thetimeofbg);
  68. // SetVolumeOgg(255*(Settings.volume/100.0));
  69. }
Add Comment
Please, Sign In to add comment