diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sci/engine/kernel.cpp | 20 | ||||
-rw-r--r-- | engines/sci/engine/kernel.h | 8 |
2 files changed, 24 insertions, 4 deletions
diff --git a/engines/sci/engine/kernel.cpp b/engines/sci/engine/kernel.cpp index 1b06b78159..6c148833ff 100644 --- a/engines/sci/engine/kernel.cpp +++ b/engines/sci/engine/kernel.cpp @@ -391,6 +391,26 @@ Kernel::Kernel(ResourceManager *resMan) : _resMan(resMan) { Kernel::~Kernel() { } +uint Kernel::getSelectorNamesSize() const { + return _selectorNames.size(); +} +const Common::String &Kernel::getSelectorName(uint selector) const { + return _selectorNames[selector]; +} + +uint Kernel::getKernelNamesSize() const { + return _kernelNames.size(); +} +const Common::String &Kernel::getKernelName(uint number) const { + // FIXME: The following check is a temporary workaround for + // an issue leading to crashes when using the debugger's backtrace + // command. + static const Common::String invalid = "(invalid)"; + if (number >= _kernelNames.size()) + return invalid; + return _kernelNames[number]; +} + void Kernel::detectSciFeatures() { SciVersion version = _resMan->sciVersion(); diff --git a/engines/sci/engine/kernel.h b/engines/sci/engine/kernel.h index 93f8de4157..888db2e0d9 100644 --- a/engines/sci/engine/kernel.h +++ b/engines/sci/engine/kernel.h @@ -65,11 +65,11 @@ public: Kernel(ResourceManager *resMan); ~Kernel(); - uint getSelectorNamesSize() const { return _selectorNames.size(); } - const Common::String &getSelectorName(uint selector) const { return _selectorNames[selector]; } + uint getSelectorNamesSize() const; + const Common::String &getSelectorName(uint selector) const; - uint getKernelNamesSize() const { return _kernelNames.size(); } - const Common::String &getKernelName(uint number) const { return _kernelNames[number]; } + uint getKernelNamesSize() const; + const Common::String &getKernelName(uint number) const; /** * Determines the selector ID of a selector by its name |