diff options
author | Max Horn | 2002-12-24 15:27:27 +0000 |
---|---|---|
committer | Max Horn | 2002-12-24 15:27:27 +0000 |
commit | 908de409193053d28dd23ff733d2edfdd83b8714 (patch) | |
tree | 31c42ad692d7a5ebaca679abd00d964238bd0529 | |
parent | 45aec3ef0dc5404dd47784ba7bb452ca502cf445 (diff) | |
download | scummvm-rg350-908de409193053d28dd23ff733d2edfdd83b8714.tar.gz scummvm-rg350-908de409193053d28dd23ff733d2edfdd83b8714.tar.bz2 scummvm-rg350-908de409193053d28dd23ff733d2edfdd83b8714.zip |
some hacks to get V8 loading further. It now fails because it can't find the SMAP resource
svn-id: r6102
-rw-r--r-- | scumm/gfx.cpp | 7 | ||||
-rw-r--r-- | scumm/object.cpp | 29 | ||||
-rw-r--r-- | scumm/vars.cpp | 15 |
3 files changed, 34 insertions, 17 deletions
diff --git a/scumm/gfx.cpp b/scumm/gfx.cpp index 1fc58feb22..0ff6ddf858 100644 --- a/scumm/gfx.cpp +++ b/scumm/gfx.cpp @@ -668,7 +668,7 @@ void Scumm::redrawBGStrip(int start, int num) gfxUsageBits[s + i] |= 0x80000000; gdi.drawBitmap(getResourceAddress(rtRoom, _roomResource) + _IM00_offs, - &virtscr[0], s, 0, virtscr[0].height, s, num, 0); + &virtscr[0], s, 0, virtscr[0].height, s, num, 0); } void Scumm::restoreCharsetBg() @@ -1708,7 +1708,10 @@ void Scumm::setCameraAt(int pos_x, int pos_y) && _vars[VAR_SCROLL_SCRIPT]) { _vars[VAR_CAMERA_POS_X] = camera._cur.x; _vars[VAR_CAMERA_POS_Y] = camera._cur.y; - runScript(_vars[VAR_SCROLL_SCRIPT], 0, 0, 0); + // FIXME - HACK - for now disable scroll script in V8, until we figure out + // what value VAR_SCROLL_SCRIPT has. + if (!(_features & GF_AFTER_V8)) + runScript(_vars[VAR_SCROLL_SCRIPT], 0, 0, 0); } } else { int t; diff --git a/scumm/object.cpp b/scumm/object.cpp index a86c9e51b6..25a526624f 100644 --- a/scumm/object.cpp +++ b/scumm/object.cpp @@ -402,7 +402,8 @@ void Scumm::loadRoomObjects() RoomHeader *roomhdr; CodeHeader *cdhd; - CHECK_HEAP room = getResourceAddress(rtRoom, _roomResource); + CHECK_HEAP + room = getResourceAddress(rtRoom, _roomResource); roomhdr = (RoomHeader *)findResourceData(MKID('RMHD'), room); if (_features & GF_AFTER_V8) @@ -459,8 +460,8 @@ void Scumm::loadRoomObjects() imhd = (ImageHeader *)findResourceData(MKID('IMHD'), ptr); if (_features & GF_AFTER_V8) // FIXME - in v8, IMHD seems to contain no obj_id, but rather a name string - obim_id = 0; -// obim_id = READ_LE_UINT32(&imhd->v8.obj_id); + // EVIL HACK to allow loading of the first COMI room + obim_id = 1373 + i; else if (_features & GF_AFTER_V7) obim_id = READ_LE_UINT16(&imhd->v7.obj_id); else @@ -473,13 +474,12 @@ void Scumm::loadRoomObjects() searchptr = NULL; } - od = &_objs[1]; - - for (i = 1; i <= _numObjectsInRoom; i++, od++) { - setupRoomObject(od, room); + for (i = 1; i <= _numObjectsInRoom; i++) { + setupRoomObject(&_objs[i], room); } -CHECK_HEAP} + CHECK_HEAP +} void Scumm::loadRoomObjectsSmall() { @@ -541,7 +541,8 @@ void Scumm::loadRoomObjectsSmall() setupRoomObject(od, room); } -CHECK_HEAP} + CHECK_HEAP +} void Scumm::setupRoomObject(ObjectData *od, byte *room) { @@ -574,15 +575,13 @@ void Scumm::setupRoomObject(ObjectData *od, byte *room) od->actordir = (*(ptr + 17)) & 7; od->height = *(ptr + 17); // ok - - return; } - if (_features & GF_AFTER_V8) - searchptr = getResourceAddress(rtRoomScripts, _roomResource); - else - searchptr = room; + if (_features & GF_AFTER_V8) + searchptr = getResourceAddress(rtRoomScripts, _roomResource); + else + searchptr = room; cdhd = (CodeHeader *)findResourceData(MKID('CDHD'), searchptr + od->offs_obcd_to_room); if (cdhd == NULL) diff --git a/scumm/vars.cpp b/scumm/vars.cpp index 411ac0fb3f..58324b3ce3 100644 --- a/scumm/vars.cpp +++ b/scumm/vars.cpp @@ -232,4 +232,19 @@ void Scumm_v8::setupScummVars() VAR_PAUSE_KEY = 64; // ??? VAR_SAVELOADDIALOG_KEY = 65; // ??? + + + // FIXME - HACK: no clue where these really are located, but we need to put them + // somewhere so that camera clamping works. So for now just assume they are on their + // V6 positions (which is somewhat unlikely, considering most stuff moved...) + VAR_CAMERA_MIN_X = 101; + VAR_CAMERA_MAX_X = 102; + VAR_CAMERA_MIN_Y = 103; + VAR_CAMERA_MAX_Y = 104; + VAR_CAMERA_THRESHOLD_X = 105; + VAR_CAMERA_THRESHOLD_Y = 106; + VAR_CAMERA_SPEED_X = 107; + VAR_CAMERA_SPEED_Y = 108; + VAR_CAMERA_ACCEL_X = 109; + VAR_CAMERA_ACCEL_Y = 110; } |