[Scummvm-git-logs] scummvm master -> cbcebce55ddf90e1d4e7da35299520b53a04be86
mduggan
mgithub at guarana.org
Wed May 26 03:29:53 UTC 2021
This automated email contains information about 4 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
c24f92cb6f IMAGE: Fix decoding bug in Crusader: No Remorse RRV videos
587a2bfb05 ULTIMA8: Remove outdated comment
a5d0a27286 ULTIMA8: Only find blockers for Crusader mover sweep
cbcebce55d ULTIMA8: Fix I_legalMoveToPoint to match original games
Commit: c24f92cb6f214899ddbbe5affcfe63775a6f2d79
https://github.com/scummvm/scummvm/commit/c24f92cb6f214899ddbbe5affcfe63775a6f2d79
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2021-05-26T12:27:44+09:00
Commit Message:
IMAGE: Fix decoding bug in Crusader: No Remorse RRV videos
Previously the upscale test was changing the frame contents with incorrect data
before going back, but the algorithm relies on not changing contents for some
pixels by "skipping" them. Duplicated a bit of code to create a
non-destructive upscale test before decoding the whole frame.
Changed paths:
image/codecs/jyv1.cpp
diff --git a/image/codecs/jyv1.cpp b/image/codecs/jyv1.cpp
index f459bc4355..49a499f5b3 100644
--- a/image/codecs/jyv1.cpp
+++ b/image/codecs/jyv1.cpp
@@ -78,6 +78,34 @@ const Graphics::Surface *JYV1Decoder::decodeFrame(Common::SeekableReadStream &st
int y = 0;
int x = 0;
bool upscale = false;
+
+ //
+ // Slight HACK: test if we need to scale up this frame without
+ // changing the output data yet. This has a bit of duplicated code
+ // with the loop below just to measure the frame size from the
+ // first block.
+ //
+ if (_streamType == ID_RRV1 || _streamType == ID_RRV2) {
+ stream.seek(offsets[0], SEEK_SET);
+ const int cmdLen = stream.readUint32LE();
+ uint8 *cmdData = new uint8[cmdLen];
+ stream.read(cmdData, cmdLen);
+ Common::BitStreamMemoryStream cmdMemStream(cmdData, cmdLen);
+ Common::BitStreamMemory8MSB cmdBitStream(cmdMemStream);
+ int total = 0;
+ while (!cmdBitStream.eos()) {
+ uint32 idx = cmdBitStream.getBits(4);
+ total += BASE_LEN[idx];
+ if (idx != 0 && idx != 8) {
+ total += cmdBitStream.getBits(FINE_LEN_BITS[idx]);
+ }
+ }
+ delete [] cmdData;
+
+ if (total == _width * blockHeight / 2)
+ upscale = true;
+ }
+
for (int i = 0; i < numOffsets; i++) {
stream.seek(offsets[i], SEEK_SET);
const int cmdLen = stream.readUint32LE();
@@ -132,17 +160,7 @@ const Graphics::Surface *JYV1Decoder::decodeFrame(Common::SeekableReadStream &st
}
skipping = !skipping;
}
-
- // Slight HACK - if we only used half the expected height, then
- // this frame should be upscaled. Go back and do it again.
- if (!upscale && y == blockHeight / 2) {
- y = 0;
- i--;
- upscale = true;
- }
-
delete [] cmdData;
-
}
return &_surface;
}
Commit: 587a2bfb056556a128692af0492210ea827a5460
https://github.com/scummvm/scummvm/commit/587a2bfb056556a128692af0492210ea827a5460
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2021-05-26T12:27:44+09:00
Commit Message:
ULTIMA8: Remove outdated comment
Changed paths:
engines/ultima/ultima8/world/current_map.cpp
diff --git a/engines/ultima/ultima8/world/current_map.cpp b/engines/ultima/ultima8/world/current_map.cpp
index d8bdb98f9a..ad342033ed 100644
--- a/engines/ultima/ultima8/world/current_map.cpp
+++ b/engines/ultima/ultima8/world/current_map.cpp
@@ -1033,7 +1033,6 @@ bool CurrentMap::scanForValidPosition(int32 x, int32 y, int32 z, const Item *ite
// dims is the bounding box size.
// item is the item that we are checking to move
// blocking_only forces us to check against blocking items only.
-// skip will skip all items until item num skip is reached
// Returns item hit or 0 if no hit.
// end is set to the colision point
bool CurrentMap::sweepTest(const int32 start[3], const int32 end[3],
Commit: a5d0a27286b20d7a652bd3541386295e32519724
https://github.com/scummvm/scummvm/commit/a5d0a27286b20d7a652bd3541386295e32519724
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2021-05-26T12:27:44+09:00
Commit Message:
ULTIMA8: Only find blockers for Crusader mover sweep
Changed paths:
engines/ultima/ultima8/world/actors/cru_avatar_mover_process.cpp
diff --git a/engines/ultima/ultima8/world/actors/cru_avatar_mover_process.cpp b/engines/ultima/ultima8/world/actors/cru_avatar_mover_process.cpp
index 1fb689c916..548697626a 100644
--- a/engines/ultima/ultima8/world/actors/cru_avatar_mover_process.cpp
+++ b/engines/ultima/ultima8/world/actors/cru_avatar_mover_process.cpp
@@ -439,7 +439,7 @@ void CruAvatarMoverProcess::step(Animation::Sequence action, Direction direction
end[2] = z;
avatar->setLocation(origpt.x, origpt.y, origpt.z);
currentmap->sweepTest(start, end, dims, avatar->getShapeInfo()->_flags,
- avatar->getObjId(),false, &collisions);
+ avatar->getObjId(), true, &collisions);
for (Std::list<CurrentMap::SweepItem>::iterator it = collisions.begin();
it != collisions.end(); it++) {
if (!it->_touching && it->_blocking) {
Commit: cbcebce55ddf90e1d4e7da35299520b53a04be86
https://github.com/scummvm/scummvm/commit/cbcebce55ddf90e1d4e7da35299520b53a04be86
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2021-05-26T12:27:44+09:00
Commit Message:
ULTIMA8: Fix I_legalMoveToPoint to match original games
Inspecting the disassembly more closely and trying to fix the usecode for the
Crusader spider bombs (CRU_SPID::ordinal20), the parameter for this intrinsic
is not "force", but more like "move until blocked", and when it's false the
item should not move at all if there is a block.
The spider bomb usecode tries to move the bomb down every now and then to check
for a fall, but if it meant "force" then the bomb would go into the floor. It
would also never explode because it was always forced into the new position and
never fails.
The return value is whether the move completed.
Changed paths:
engines/ultima/ultima8/world/item.cpp
diff --git a/engines/ultima/ultima8/world/item.cpp b/engines/ultima/ultima8/world/item.cpp
index bf2b3ef7b0..6ee684d337 100644
--- a/engines/ultima/ultima8/world/item.cpp
+++ b/engines/ultima/ultima8/world/item.cpp
@@ -3487,7 +3487,7 @@ uint32 Item::I_move(const uint8 *args, unsigned int /*argsize*/) {
uint32 Item::I_legalMoveToPoint(const uint8 *args, unsigned int argsize) {
ARG_ITEM_FROM_PTR(item);
ARG_WORLDPOINT(point);
- ARG_UINT16(force); // 0/1
+ ARG_UINT16(move_if_blocked); // 0/1
ARG_UINT16(unknown2); // always 0
int32 x = point.getX();
@@ -3501,10 +3501,34 @@ uint32 Item::I_legalMoveToPoint(const uint8 *args, unsigned int argsize) {
if (!item)
return 0;
- //! What should this do to ethereal items?
- if (item->collideMove(x, y, z, false, force == 1) == 0x4000)
- return 1;
- return 0;
+
+ //
+ // Return true when there are no blockers.
+ // If there are blockers, only move if move_if_blocked is set.
+ //
+ int retval = 1;
+ Std::list<CurrentMap::SweepItem> collisions;
+ int32 start[3], end[3], dims[3];
+ end[0] = x;
+ end[1] = y;
+ end[2] = z;
+ item->getLocation(start[0], start[1], start[2]);
+ item->getFootpadWorld(dims[0], dims[1], dims[2]);
+ CurrentMap *map = World::get_instance()->getCurrentMap();
+ map->sweepTest(start, end, dims, item->getShapeInfo()->_flags,
+ item->getObjId(), true, &collisions);
+ for (Std::list<CurrentMap::SweepItem>::iterator it = collisions.begin();
+ it != collisions.end(); it++) {
+ if (it->_blocking && !it->_touching && it->_endTime > 0) {
+ if (!move_if_blocked)
+ return 0;
+ retval = 0;
+ break;
+ }
+ }
+
+ item->collideMove(x, y, z, false, false);
+ return retval;
}
uint32 Item::I_legalMoveToContainer(const uint8 *args, unsigned int /*argsize*/) {
More information about the Scummvm-git-logs
mailing list