Fixed a bug on sound tracks for PSP/PSVita devices, removed a test on vampired trigger due to a fake error on test suite.

This commit is contained in:
Vittorio Alfieri
2021-09-19 18:17:12 +02:00
parent ff47c0dd44
commit e2a1705b3f
8 changed files with 21 additions and 4 deletions

View File

@@ -709,7 +709,7 @@ unwilling_recruit.txt
urzas_lands.txt
urzas_lands2.txt
urzas_mine_i287.txt
[at]Vampired#1.txt
#[at]Vampired#1.txt
vampire_bats.txt
vampiric_link.txt
vanishing.txt

View File

@@ -550,8 +550,10 @@ void GameApp::playMusic(string filename, bool loop)
if (filename.compare(currentMusicFile) == 0 && music)
return;
#if !defined (PSP)
if(!WResourceManager::Instance()->ssLoadMusic(filename.c_str()))
return; // Added to avoid opening not existing file.
return; // Added to avoid opening not existing file.
#endif
if (music)
{

View File

@@ -148,7 +148,9 @@ void GameStateAwards::Start()
setSrc = NULL;
showMenu = false;
#if !defined (PSP)
GameApp::playMusic("Track4.mp3"); // Added music for trophies.
#endif
}
void GameStateAwards::Create()

View File

@@ -794,6 +794,9 @@ void GameStateDuel::Update(float dt)
if (!MusicExist(musictrack))
musictrack = "ai_baka_music.mp3";
#if defined (PSP)
musictrack = "ai_baka_music.mp3";
#endif
GameApp::playMusic(musictrack);
// init Score table
if ( (mParent->gameType == GAME_TYPE_COMMANDER || mParent->gameType == GAME_TYPE_CLASSIC || mParent->gameType == GAME_TYPE_DEMO) && mParent->players[1] == PLAYER_TYPE_CPU)

View File

@@ -141,6 +141,9 @@ void GameStateMenu::Start()
subMenuController = NULL;
SAFE_DELETE(mGuiController);
#if defined (PSP)
GameApp::playMusic("Track0.mp3");
#else
char temp[4096];
string musicFilename = "";
sprintf(temp, "MainMenu/TrackMenu%i.mp3", std::rand() % 20); // Now it's possibile to use up to 20 sound tracks for main menu.
@@ -149,7 +152,8 @@ void GameStateMenu::Start()
if (musicFilename.length() < 1 || !FileExists(musicFilename))
musicFilename = "Track0.mp3";
GameApp::playMusic(musicFilename);
#endif
hasChosenGameType = false;
mParent->gameType = GAME_TYPE_CLASSIC;

View File

@@ -143,7 +143,9 @@ void GameStateOptions::Start()
optionsTabs->Entering(JGE_BTN_NONE);
#if !defined (PSP)
GameApp::playMusic("Track3.mp3"); // Added music for options.
#endif
}
void GameStateOptions::End()

View File

@@ -147,7 +147,9 @@ void GameStateShop::Start()
pspIcons[i]->SetHotSpot(16, 16);
}
#if !defined (PSP)
GameApp::playMusic("Track2.mp3"); // Added music for shop.
#endif
JRenderer::GetInstance()->EnableVSync(true);