Skip to content

Commit

Permalink
TWINE: renamed variable
Browse files Browse the repository at this point in the history
  • Loading branch information
mgerhardy committed Jun 1, 2022
1 parent 5150fbf commit eead129
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions engines/twine/scene/actor.cpp
Expand Up @@ -197,26 +197,24 @@ void Actor::initModelActor(BodyType bodyIdx, int16 actorIdx) {
const BodyData &bd = _engine->_resources->_bodyData[localActor->_body];
localActor->_boundingBox = bd.bbox;

int32 result = 0;
const int32 distX = localActor->_boundingBox.maxs.x - localActor->_boundingBox.mins.x;
const int32 distZ = localActor->_boundingBox.maxs.z - localActor->_boundingBox.mins.z;
int32 size = 0;
const int32 distX = bd.bbox.maxs.x - bd.bbox.mins.x;
const int32 distZ = bd.bbox.maxs.z - bd.bbox.mins.z;
if (localActor->_staticFlags.bUseMiniZv) {
// take smaller for bound
result = MIN(distX, distZ);

result = ABS(result);
result >>= 1;
if (distX < distZ)
size = distX / 2;
else
size = distZ / 2;
} else {
// take average for bound
result = distZ + distX;
result = ABS(result);
result >>= 2;
size = (distZ + distX) / 4;
}

localActor->_boundingBox.mins.x = -result;
localActor->_boundingBox.maxs.x = result;
localActor->_boundingBox.mins.z = -result;
localActor->_boundingBox.maxs.z = result;
localActor->_boundingBox.mins.x = -size;
localActor->_boundingBox.maxs.x = size;
localActor->_boundingBox.mins.z = -size;
localActor->_boundingBox.maxs.z = size;
}
}

Expand Down

0 comments on commit eead129

Please sign in to comment.