Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void WindowScreensaver()
- {
- int i = 0;
- bool exit = false;
- /* initialize random seed: */
- srand ( time(NULL) );
- //GuiSound * creditsMusic = NULL;
- // s32 thetimeofbg = bgMusic->GetPlayTime();
- //StopOgg();
- /*creditsMusic = new GuiSound(credits_music_ogg, credits_music_ogg_size, SOUND_OGG, 55);
- creditsMusic->SetVolume(60);
- creditsMusic->SetLoop(1);
- creditsMusic->Play();*/
- GuiImageData GXlogo(gxlogo_png);
- GuiImage GXlogoImg(&GXlogo);
- GXlogoImg.SetPosition(320,240);
- GXlogoImg.SetAlignment(ALIGN_LEFT,ALIGN_TOP);
- GuiWindow screensaverWindow(screenwidth,screenheight);
- screensaverWindow.Append(&GXlogoImg);
- HaltGui();
- mainWindow->SetState(STATE_DISABLED);
- mainWindow->Append(&screensaverWindow);
- ResumeGui();
- while(!exit)
- {
- //Menu_DrawRectangle(0,0,screenwidth,screenheight,(GXColor){0, 0, 0,255},1);
- i++;
- if(IsWpadConnected())
- {
- exit = true;
- }
- /* Set position only every 400000th loop */
- if((i % 4000000) == 0)
- {
- /* Set random position */
- GXlogoImg.SetPosition((rand() % 345), (rand() % 305));
- }
- }
- //creditsMusic->Stop();
- //delete creditsMusic;
- HaltGui();
- mainWindow->Remove(&screensaverWindow);
- mainWindow->SetState(STATE_DEFAULT);
- ResumeGui();
- //if(!strcmp("", Settings.oggload_path) || !strcmp("notset", Settings.ogg_path)) {
- // bgMusic->Play();
- // } else {
- // bgMusic->PlayOggFile(Settings.ogg_path);
- // }
- // bgMusic->SetPlayTime(thetimeofbg);
- // SetVolumeOgg(255*(Settings.volume/100.0));
- }
Add Comment
Please, Sign In to add comment