[Scummvm-git-logs] scummvm master -> 0de8dd3311c24bc18969d378e4dfe3a18084b889
dreammaster
paulfgilbert at gmail.com
Sun Mar 8 16:53:26 UTC 2020
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
0de8dd3311 ULTIMA8: Remove a bit of redundant logic for getFootpadWorld
Commit: 0de8dd3311c24bc18969d378e4dfe3a18084b889
https://github.com/scummvm/scummvm/commit/0de8dd3311c24bc18969d378e4dfe3a18084b889
Author: Matthew Duggan (mgithub at guarana.org)
Date: 2020-03-08T09:53:22-07:00
Commit Message:
ULTIMA8: Remove a bit of redundant logic for getFootpadWorld
Changed paths:
engines/ultima/ultima8/world/current_map.cpp
engines/ultima/ultima8/world/item.h
diff --git a/engines/ultima/ultima8/world/current_map.cpp b/engines/ultima/ultima8/world/current_map.cpp
index f81fa269af..e5c000c452 100644
--- a/engines/ultima/ultima8/world/current_map.cpp
+++ b/engines/ultima/ultima8/world/current_map.cpp
@@ -698,7 +698,7 @@ bool CurrentMap::isValidPosition(int32 x, int32 y, int32 z,
continue; // not an interesting item
int32 ix, iy, iz, ixd, iyd, izd;
- si->getFootpadWorld(ixd, iyd, izd, item->getFlags() & Item::FLG_FLIPPED);
+ item->getFootpadWorld(ixd, iyd, izd);
item->getLocation(ix, iy, iz);
#if 0
@@ -1016,6 +1016,7 @@ bool CurrentMap::sweepTest(const int32 start[3], const int32 end[3],
continue;
}
+ // Make oext the distance to midpoint in each dim
oext[0] /= 2;
oext[1] /= 2;
oext[2] /= 2;
diff --git a/engines/ultima/ultima8/world/item.h b/engines/ultima/ultima8/world/item.h
index a5e13fad6b..23db88e669 100644
--- a/engines/ultima/ultima8/world/item.h
+++ b/engines/ultima/ultima8/world/item.h
@@ -611,7 +611,7 @@ inline ShapeInfo *Item::getShapeInfo() const {
}
inline void Item::getFootpadData(int32 &X, int32 &Y, int32 &Z) const {
- ShapeInfo *si = getShapeInfo();
+ const ShapeInfo *si = getShapeInfo();
Z = si->_z;
if (_flags & Item::FLG_FLIPPED) {
@@ -625,16 +625,8 @@ inline void Item::getFootpadData(int32 &X, int32 &Y, int32 &Z) const {
// like getFootpadData, but scaled to world coordinates
inline void Item::getFootpadWorld(int32 &X, int32 &Y, int32 &Z) const {
- ShapeInfo *si = getShapeInfo();
- Z = si->_z * 8;
-
- if (_flags & Item::FLG_FLIPPED) {
- X = si->_y * 32;
- Y = si->_x * 32;
- } else {
- X = si->_x * 32;
- Y = si->_y * 32;
- }
+ const ShapeInfo *si = getShapeInfo();
+ si->getFootpadWorld(X, Y, Z, _flags & Item::FLG_FLIPPED);
}
inline void Item::getLocation(int32 &X, int32 &Y, int32 &Z) const {
More information about the Scummvm-git-logs
mailing list