diff options
Diffstat (limited to 'engines/sci/engine/seg_manager.cpp')
-rw-r--r-- | engines/sci/engine/seg_manager.cpp | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/engines/sci/engine/seg_manager.cpp b/engines/sci/engine/seg_manager.cpp index 97e33f256b..58c2b8d3e3 100644 --- a/engines/sci/engine/seg_manager.cpp +++ b/engines/sci/engine/seg_manager.cpp @@ -8,12 +8,12 @@ * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. - + * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. - + * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. @@ -28,7 +28,8 @@ namespace Sci { -SegManager::SegManager(ResourceManager *resMan) { +SegManager::SegManager(ResourceManager *resMan, ScriptPatcher *scriptPatcher) + : _resMan(resMan), _scriptPatcher(scriptPatcher) { _heap.push_back(0); _clonesSegId = 0; @@ -44,8 +45,6 @@ SegManager::SegManager(ResourceManager *resMan) { _stringSegId = 0; #endif - _resMan = resMan; - createClassTable(); } @@ -262,8 +261,14 @@ const char *SegManager::getObjectName(reg_t pos) { const char *name = 0; if (nameReg.getSegment()) name = derefString(nameReg); - if (!name) - return "<invalid name>"; + if (!name) { + // Crazy Nick Laura Bow is missing some object names needed for the static + // selector vocabulary + if (g_sci->getGameId() == GID_CNICK_LAURABOW && pos == make_reg(1, 0x2267)) + return "Character"; + else + return "<invalid name>"; + } return name; } @@ -366,7 +371,7 @@ void SegManager::freeHunkEntry(reg_t addr) { HunkTable *ht = (HunkTable *)getSegment(addr.getSegment(), SEG_TYPE_HUNK); if (!ht) { - warning("Attempt to free Hunk from address %04x:%04x: Invalid segment type", PRINT_REG(addr)); + warning("Attempt to free Hunk from address %04x:%04x: Invalid segment type %d", PRINT_REG(addr), getSegmentType(addr.getSegment())); return; } @@ -977,7 +982,7 @@ int SegManager::instantiateScript(int scriptNum) { scr = allocateScript(scriptNum, &segmentId); } - scr->load(scriptNum, _resMan); + scr->load(scriptNum, _resMan, _scriptPatcher); scr->initializeLocals(this); scr->initializeClasses(this); scr->initializeObjects(this, segmentId); |