Skip to content

Commit

Permalink
Skip KeyPatch SE and show a Warning once, fixes #731
Browse files Browse the repository at this point in the history
  • Loading branch information
carstene1ns committed Mar 1, 2016
1 parent c4048fe commit fa37fbb
Showing 1 changed file with 24 additions and 8 deletions.
32 changes: 24 additions & 8 deletions src/game_system.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#include "baseui.h"
#include "bitmap.h"
#include "cache.h"
#include "output.h"
#include "graphics.h"
#include "main_data.h"
#include "scene_save.h"
Expand Down Expand Up @@ -86,16 +87,31 @@ void Game_System::BgmStop() {
}

void Game_System::SePlay(RPG::Sound const& se) {
if (!se.name.empty() && se.name != "(OFF)" && se.name != "(Brak)") {
// Yume Nikki plays hundreds of sound effects at 0% volume on
// startup. Probably for caching. This triggers "No free channels"
// warnings.
if (se.volume > 0) {
FileRequestAsync* request = AsyncHandler::RequestFile("Sound", se.name);
se_request_ids[se.name] = request->Bind(boost::bind(&Game_System::OnSeReady, _1, se.volume, se.tempo));
request->Start();
static bool ineluki_warning_shown = false;

if (se.name.empty() || se.name == "(OFF)" || se.name == "(Brak)")
return;

std::string end = ".script";
if (se.name.length() >= end.length() &&
0 == se.name.compare(se.name.length() - end.length(), end.length(), end)) {
if (!ineluki_warning_shown) {
Output::Warning("This game seems to use a patch to support additional\n"
"keys, mouse or scripts. Such patches are currently\n"
"unsupported and this functionality will not work!");
ineluki_warning_shown = true;
}
return;
}

// NOTE: Yume Nikki plays hundreds of sound effects at 0% volume on startup,
// probably for caching. This avoids "No free channels" warnings.
if (se.volume == 0)
return;

FileRequestAsync* request = AsyncHandler::RequestFile("Sound", se.name);
se_request_ids[se.name] = request->Bind(boost::bind(&Game_System::OnSeReady, _1, se.volume, se.tempo));
request->Start();
}

std::string Game_System::GetSystemName() {
Expand Down

0 comments on commit fa37fbb

Please sign in to comment.