From ef956c430a998af7abc3491cfa4ad69c600061ad Mon Sep 17 00:00:00 2001
From: dimok321 <15055714+dimok789@users.noreply.github.com>
Date: Tue, 10 Nov 2009 18:43:56 +0000
Subject: [PATCH] *little fix to ignore case sensitivity on searching files on
the WiiDisc (Thanks to LoudBob11 for pointing it out) *Added new options for
BannerSounds (You can loop them, make it be quite after once played or play
the BGM again)
NOTE: Changed the way how to disable BannerSounds. If you make Volume to 0 than the loading of the BannerSounds is disabled now.
---
gui.pnproj | 2 +-
source/bannersound.cpp | 13 +++++++------
source/libwbfs/wiidisc.c | 2 +-
source/prompts/PromptWindows.cpp | 9 +++++++--
source/settings/Settings.cpp | 15 ++++++++++-----
5 files changed, 26 insertions(+), 15 deletions(-)
diff --git a/gui.pnproj b/gui.pnproj
index 8ebfe69a..1a2048d6 100644
--- a/gui.pnproj
+++ b/gui.pnproj
@@ -1 +1 @@
-
\ No newline at end of file
+
\ No newline at end of file
diff --git a/source/bannersound.cpp b/source/bannersound.cpp
index 06ad48e4..02b4dbd6 100644
--- a/source/bannersound.cpp
+++ b/source/bannersound.cpp
@@ -70,12 +70,12 @@ static char *u8Filename(const U8Entry *fst, int i)
inline u32 le32(u32 i)
{
- return ((i & 0xFF) << 24) | ((i & 0xFF00) << 8) | ((i & 0xFF0000) >> 8) | ((i & 0xFF000000) >> 24);
+ return ((i & 0xFF) << 24) | ((i & 0xFF00) << 8) | ((i & 0xFF0000) >> 8) | ((i & 0xFF000000) >> 24);
}
-inline u16 le16(u16 i)
+inline u16 le16(u16 i)
{
- return ((i & 0xFF) << 8) | ((i & 0xFF00) >> 8);
+ return ((i & 0xFF) << 8) | ((i & 0xFF00) >> 8);
}
static u8 *uncompressLZ77(const u8 *inBuf, u32 inLength, u32 &size)
@@ -90,10 +90,10 @@ static u8 *uncompressLZ77(const u8 *inBuf, u32 inLength, u32 &size)
buffer = new(std::nothrow) u8[uncSize];
if (!buffer)
return buffer;
-
+
u8 *bufCur = buffer;
u8 *bufEnd = buffer + uncSize;
-
+
while (bufCur < bufEnd && inBuf < inBufEnd)
{
u8 flags = *inBuf;
@@ -170,7 +170,8 @@ const u8 *LoadBannerSound(const u8 *discid, u32 *size)
break;
if (i >= fst[0].numEntries)
{
- WindowPrompt(tr("sound.bin not found."), 0, tr("OK"));
+ /* Not all games have a sound.bin and this message is annoying **/
+ //WindowPrompt(tr("sound.bin not found."), 0, tr("OK"));
free(opening_bnr);
return NULL;
}
diff --git a/source/libwbfs/wiidisc.c b/source/libwbfs/wiidisc.c
index 89d57023..43e7c95c 100644
--- a/source/libwbfs/wiidisc.c
+++ b/source/libwbfs/wiidisc.c
@@ -122,7 +122,7 @@ static u32 do_fst(wiidisc_t *d,u8 *fst, const char *names, u32 i)
return size;
} else {
offset = _be32(fst + 12*i + 4);
- if(d->extract_pathname && strcmp(name, d->extract_pathname)==0)
+ if(d->extract_pathname && stricmp(name, d->extract_pathname)==0)
{
d->extracted_buffer = wbfs_ioalloc(size);
partition_read(d,offset, d->extracted_buffer, size,0);
diff --git a/source/prompts/PromptWindows.cpp b/source/prompts/PromptWindows.cpp
index 12393c43..89260c3f 100644
--- a/source/prompts/PromptWindows.cpp
+++ b/source/prompts/PromptWindows.cpp
@@ -1234,7 +1234,7 @@ int GameWindowPrompt() {
//load disc image based or what game is seleted
struct discHdr * header = (mountMethod==1||mountMethod==2?dvdheader:&gameList[gameSelected]);
- if(Settings.gamesound)
+ if(Settings.gamesoundvolume > 0)
{
if(gameSound)
{
@@ -1248,6 +1248,8 @@ int GameWindowPrompt() {
{
gameSound = new GuiSound(gameSoundData, gameSoundDataLen, Settings.gamesoundvolume, false, true);
bgMusic->SetVolume(0);
+ if(Settings.gamesound == 2)
+ gameSound->SetLoop(1);
gameSound->Play();
}
}
@@ -1383,7 +1385,10 @@ int GameWindowPrompt() {
if(gameSound)
{
if(!gameSound->IsPlaying())
- bgMusic->SetVolume(Settings.volume);
+ {
+ if(Settings.gamesound == 1)
+ bgMusic->SetVolume(Settings.volume);
+ }
}
if (btn1.GetState() == STATE_CLICKED) {
diff --git a/source/settings/Settings.cpp b/source/settings/Settings.cpp
index e4b5b6b3..221d08dd 100644
--- a/source/settings/Settings.cpp
+++ b/source/settings/Settings.cpp
@@ -1304,18 +1304,20 @@ int MenuSettings()
if(ret == ++Idx || firstRun)
{
- if(firstRun) options2.SetName(Idx, "%s",tr("Game (Banner) Sounds"));
+ if(firstRun) options2.SetName(Idx, "%s",tr("Game Sound Mode"));
if(ret == Idx)
{
Settings.gamesound++;
- if (Settings.gamesound > 1)
+ if (Settings.gamesound > 2)
Settings.gamesound = 0;
}
if(Settings.gamesound == 1)
- options2.SetValue(Idx,"%s", tr("ON"));
+ options2.SetValue(Idx,"%s", tr("Sound+BGM"));
+ else if(Settings.gamesound == 2)
+ options2.SetValue(Idx,"%s", tr("Loop Sound"));
else
- options2.SetValue(Idx,"%s", tr("OFF"));
+ options2.SetValue(Idx,"%s", tr("Sound+Quiet"));
}
if(ret == ++Idx || firstRun)
@@ -1328,7 +1330,10 @@ int MenuSettings()
Settings.gamesoundvolume = 0;
}
- options2.SetValue(Idx,"%i", Settings.gamesoundvolume);
+ if (Settings.gamesoundvolume > 0)
+ options2.SetValue(Idx,"%i", Settings.gamesoundvolume);
+ else
+ options2.SetValue(Idx,"%s", tr("OFF"));
}
firstRun = false;