From bab9a078a5aa8268b823f4ad1de0448b0a15a583 Mon Sep 17 00:00:00 2001 From: dborth Date: Thu, 19 Mar 2009 06:12:06 +0000 Subject: [PATCH] fix sound volume on startup --- source/ngc/menu.cpp | 31 ++++++++++++++++--------------- source/ngc/video.cpp | 2 +- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/source/ngc/menu.cpp b/source/ngc/menu.cpp index 3bc40ff..0ffd3d5 100644 --- a/source/ngc/menu.cpp +++ b/source/ngc/menu.cpp @@ -3230,11 +3230,6 @@ MainMenu (int menu) pointer[3] = new GuiImageData(player4_point_png); #endif - #ifndef NO_SOUND - bgMusic = new GuiSound(bg_music_ogg, bg_music_ogg_size, SOUND_OGG); - bgMusic->SetVolume(GCSettings.MusicVolume); - #endif - mainWindow = new GuiWindow(screenwidth, screenheight); bgImg = new GuiImage(screenwidth, screenheight, (GXColor){175, 200, 215, 255}); @@ -3250,12 +3245,6 @@ MainMenu (int menu) mainWindow->Append(gameScreenImg); bgImg->SetVisible(false); } - else - { - #ifndef NO_SOUND - bgMusic->Play(); // startup music - #endif - } GuiTrigger trigA; if(GCSettings.WiimoteOrientation) @@ -3287,16 +3276,28 @@ MainMenu (int menu) mainWindow->Append(bgBottomImg); mainWindow->Append(btnLogo); + if(currentMenu == MENU_GAMESELECTION) + ResumeGui(); + + // Load preferences + if(!LoadPrefs()) + SavePrefs(SILENT); + + #ifndef NO_SOUND + if(currentMenu == MENU_GAMESELECTION) + { + bgMusic = new GuiSound(bg_music_ogg, bg_music_ogg_size, SOUND_OGG); + bgMusic->SetVolume(GCSettings.MusicVolume); + bgMusic->Play(); // startup music + } + #endif + // memory usage - for debugging /*memTxt = new GuiText(NULL, 18, (GXColor){255, 255, 255, 255}); memTxt->SetAlignment(ALIGN_RIGHT, ALIGN_TOP); memTxt->SetPosition(-20, 40); mainWindow->Append(memTxt);*/ - // Load preferences - if(!LoadPrefs()) - SavePrefs(SILENT); - while(currentMenu != MENU_EXIT || SNESROMSize <= 0) { switch (currentMenu) diff --git a/source/ngc/video.cpp b/source/ngc/video.cpp index 54b1bab..3c16249 100644 --- a/source/ngc/video.cpp +++ b/source/ngc/video.cpp @@ -881,7 +881,7 @@ void TakeScreenshot() if(gameScreenTex2) free(gameScreenTex2); gameScreenTex2 = (u8 *)memalign(32, vmode->fbWidth * vmode->efbHeight * 4); if(gameScreenTex2 == NULL) return; - memcpy(gameScreenTex2, gameScreenTex, vmode->fbWidth * vmode->efbHeight * 4) + memcpy(gameScreenTex2, gameScreenTex, vmode->fbWidth * vmode->efbHeight * 4); DCFlushRange(gameScreenTex2, vmode->fbWidth * vmode->efbHeight * 4); #endif }