Detect whether to use the modified SCI2 or SCI2.1 kernel table based on the kDoSound call used in Sound::play(), which fixes at least my version of KQ7 - probably others. The kernel table initialization now occurs after the script signatures are adjusted as we need it adjusted before checking through Sound::play for the kDoSound call.

svn-id: r47645
This commit is contained in:
Matthew Hoops 2010-01-28 18:57:31 +00:00
parent 8ecd76e415
commit d883b6215f
7 changed files with 78 additions and 27 deletions

View file

@ -379,12 +379,9 @@ SciKernelFunction kfunct_mappers[] = {
{NULL, NULL, NULL} // Terminator
};
Kernel::Kernel(ResourceManager *resMan, Common::String gameId) : _resMan(resMan) {
Kernel::Kernel(ResourceManager *resMan) : _resMan(resMan) {
loadSelectorNames();
mapSelectors(); // Map a few special selectors for later use
loadKernelNames(gameId);
mapFunctions(); // Map the kernel functions
}
Kernel::~Kernel() {
@ -777,17 +774,19 @@ void Kernel::setDefaultKernelNames(Common::String gameId) {
}
}
bool Kernel::loadKernelNames(Common::String gameId) {
bool Kernel::loadKernelNames(Common::String gameId, EngineState *s) {
_kernelNames.clear();
#ifdef ENABLE_SCI32
if (getSciVersion() >= SCI_VERSION_2_1)
setKernelNamesSci21(gameId);
setKernelNamesSci21(s);
else if (getSciVersion() == SCI_VERSION_2)
setKernelNamesSci2();
else
#endif
setDefaultKernelNames(gameId);
mapFunctions();
return true;
}