[Scummvm-git-logs] scummvm master -> 71f3d82c819ee9e9c72b4d0a41af9bc4eb01491a
alxpnv
a04198622 at gmail.com
Fri Jun 11 10:30:26 UTC 2021
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
75c1b820ea ASYLUM: rename two ActorStatus values and related opcodes
71f3d82c81 ASYLUM: rename Scene::pointIntersectsRect() to pointBelowLine()
Commit: 75c1b820ead562d469808bd01f979ca34fb80bdb
https://github.com/scummvm/scummvm/commit/75c1b820ead562d469808bd01f979ca34fb80bdb
Author: alxpnv (alxpnv22 at yahoo.com)
Date: 2021-06-11T13:29:30+03:00
Commit Message:
ASYLUM: rename two ActorStatus values and related opcodes
kActorStatusPickupItem -> kActorStatusStoppedInteracting
kActorStatus20 -> kActorStatusStoppedHitting
Interact -> WalkToActor
UpdateActor -> Interact
Changed paths:
engines/asylum/resources/actor.cpp
engines/asylum/resources/script.cpp
engines/asylum/resources/script.h
engines/asylum/shared.h
diff --git a/engines/asylum/resources/actor.cpp b/engines/asylum/resources/actor.cpp
index 8312f07e54..2797ccbfcd 100644
--- a/engines/asylum/resources/actor.cpp
+++ b/engines/asylum/resources/actor.cpp
@@ -626,7 +626,7 @@ void Actor::update() {
updateStatusInteracting();
break;
- case kActorStatusPickupItem:
+ case kActorStatusStoppedInteracting:
if (getSharedData()->actorEnableForStatus7) {
getSharedData()->actorEnableForStatus7 = false;
enable();
@@ -726,7 +726,7 @@ void Actor::changeStatus(ActorStatus actorStatus) {
getScreen()->setFlag(-1);
break;
- case kActorStatusPickupItem:
+ case kActorStatusStoppedInteracting:
if (getWorld()->chapter == kChapter2 && _index == 10 && _vm->isGameFlagSet(kGameFlag279)) {
Actor *actor = getScene()->getActor(0);
actor->getPoint1()->x = _point2.x + _point1.x - actor->getPoint2()->x;
@@ -2079,9 +2079,9 @@ void Actor::updateStatusInteracting() {
++_frameIndex;
} else {
if (_status == kActorStatusInteracting)
- changeStatus(kActorStatusPickupItem);
+ changeStatus(kActorStatusStoppedInteracting);
else
- changeStatus(kActorStatus20);
+ changeStatus(kActorStatusStoppedHitting);
}
} else {
if (_index == getSharedData()->getPlayerIndex())
diff --git a/engines/asylum/resources/script.cpp b/engines/asylum/resources/script.cpp
index 34f90c7f3f..5d2d337009 100644
--- a/engines/asylum/resources/script.cpp
+++ b/engines/asylum/resources/script.cpp
@@ -152,7 +152,7 @@ ScriptManager::ScriptManager(AsylumEngine *engine) : _vm(engine) {
ADD_OPCODE(SelectInventoryItem);
ADD_OPCODE(JumpIfInventoryItemNotSelected);
ADD_OPCODE(ChangeScene);
- ADD_OPCODE(UpdateActor);
+ ADD_OPCODE(Interact);
ADD_OPCODE(PlayMovie);
ADD_OPCODE(StopAllObjectsSounds);
ADD_OPCODE(StopProcessing);
@@ -194,7 +194,7 @@ ScriptManager::ScriptManager(AsylumEngine *engine) : _vm(engine) {
ADD_OPCODE(SetActorField944);
ADD_OPCODE(SetScriptField1BB0);
ADD_OPCODE(OnScriptField1BB0);
- ADD_OPCODE(Interact);
+ ADD_OPCODE(WalkToActor);
ADD_OPCODE(SetResourcePalette);
ADD_OPCODE(SetObjectFrameIndexAndFlags);
ADD_OPCODE(SetObjectFlags);
@@ -955,7 +955,7 @@ END_OPCODE
//////////////////////////////////////////////////////////////////////////
// Opcode 0x2C
-IMPLEMENT_OPCODE(UpdateActor)
+IMPLEMENT_OPCODE(Interact)
Actor *player = getScene()->getActor();
Actor *actor = getScene()->getActor(_currentQueueEntry->actorIndex);
Common::Point playerPoint((int16)(player->getPoint1()->x + player->getPoint2()->x), (int16)(player->getPoint1()->y + player->getPoint2()->y));
@@ -976,7 +976,7 @@ IMPLEMENT_OPCODE(UpdateActor)
case kActorStatusEnabled2:
return;
- case kActorStatusPickupItem:
+ case kActorStatusStoppedInteracting:
actor->enable();
break;
@@ -984,7 +984,7 @@ IMPLEMENT_OPCODE(UpdateActor)
// We want to continue processing and not go into the default case
break;
- case kActorStatus20:
+ case kActorStatusStoppedHitting:
actor->changeStatus(kActorStatusEnabled2);
}
@@ -1719,7 +1719,7 @@ END_OPCODE
//////////////////////////////////////////////////////////////////////////
// Opcode 0x56
-IMPLEMENT_OPCODE(Interact)
+IMPLEMENT_OPCODE(WalkToActor)
Actor *player = getScene()->getActor(), *actor = getScene()->getActor((ActorIndex)cmd->param1);
if (cmd->param2 == 2) {
diff --git a/engines/asylum/resources/script.h b/engines/asylum/resources/script.h
index 36fb607628..fedc8fed05 100644
--- a/engines/asylum/resources/script.h
+++ b/engines/asylum/resources/script.h
@@ -392,7 +392,7 @@ private:
DECLARE_OPCODE(SelectInventoryItem);
DECLARE_OPCODE(JumpIfInventoryItemNotSelected);
DECLARE_OPCODE(ChangeScene);
- DECLARE_OPCODE(UpdateActor);
+ DECLARE_OPCODE(Interact);
DECLARE_OPCODE(PlayMovie);
DECLARE_OPCODE(StopAllObjectsSounds);
DECLARE_OPCODE(StopProcessing);
@@ -434,7 +434,7 @@ private:
DECLARE_OPCODE(SetActorField944);
DECLARE_OPCODE(SetScriptField1BB0);
DECLARE_OPCODE(OnScriptField1BB0);
- DECLARE_OPCODE(Interact);
+ DECLARE_OPCODE(WalkToActor);
DECLARE_OPCODE(SetResourcePalette);
DECLARE_OPCODE(SetObjectFrameIndexAndFlags);
DECLARE_OPCODE(SetObjectFlags);
diff --git a/engines/asylum/shared.h b/engines/asylum/shared.h
index e23798812d..70c42c85f3 100644
--- a/engines/asylum/shared.h
+++ b/engines/asylum/shared.h
@@ -385,7 +385,7 @@ enum OpcodeType {
kOpcodeSelectInventoryItem,
kOpcodeJumpIfInventoryItemNotSelected,
kOpcodeChangeScene,
- kOpcodeUpdateActor,
+ kOpcodeInteract,
kOpcodePlayMovie, // 45
kOpcodeStopAllObjectsSounds,
kOpcodeStopProcessing,
@@ -427,7 +427,7 @@ enum OpcodeType {
kOpcodeSetPlayerField944,
kOpcodeSetScriptField1BB0,
kOpcodeOnScriptField1BB0, // 85
- kOpcodeInteract,
+ kOpcodeWalkToActor,
kOpcodeSetResourcePalette,
kOpcodeSetObjectFrameIndexAndFlags,
kOpcodeSetObjectFlags,
@@ -466,7 +466,7 @@ enum ActorStatus {
kActorStatusEnabled, // Standing Still
kActorStatusDisabled, // 5
kActorStatusShowingInventory,
- kActorStatusPickupItem,
+ kActorStatusStoppedInteracting,
kActorStatus8,
kActorStatusFidget,
kActorStatus10,
@@ -479,7 +479,7 @@ enum ActorStatus {
kActorStatusRestarting,
kActorStatus18,
kActorStatusHittingPumpkin,
- kActorStatus20,
+ kActorStatusStoppedHitting,
kActorStatusMorphingInto
};
Commit: 71f3d82c819ee9e9c72b4d0a41af9bc4eb01491a
https://github.com/scummvm/scummvm/commit/71f3d82c819ee9e9c72b4d0a41af9bc4eb01491a
Author: alxpnv (alxpnv22 at yahoo.com)
Date: 2021-06-11T13:29:31+03:00
Commit Message:
ASYLUM: rename Scene::pointIntersectsRect() to pointBelowLine()
Changed paths:
engines/asylum/views/scene.cpp
engines/asylum/views/scene.h
diff --git a/engines/asylum/views/scene.cpp b/engines/asylum/views/scene.cpp
index 358faff611..2879537640 100644
--- a/engines/asylum/views/scene.cpp
+++ b/engines/asylum/views/scene.cpp
@@ -2047,7 +2047,7 @@ bool Scene::speak(Common::KeyCode code) {
#undef GET_INDEX
}
-bool Scene::pointIntersectsRect(const Common::Point &point, const Common::Rect &rect) const {
+bool Scene::pointBelowLine(const Common::Point &point, const Common::Rect &rect) const {
if (rect.top || rect.left || rect.bottom || rect.right) {
Common::Rational res(rect.height() * (point.x - rect.left), rect.width());
@@ -2519,7 +2519,7 @@ void Scene::processUpdateList() {
// Check if it intersects with either the object rect or the related polygon
bool isMasked = false;
if (object->flags & kObjectFlag2) {
- isMasked = !pointIntersectsRect(sum, *object->getRect());
+ isMasked = !pointBelowLine(sum, *object->getRect());
} else if (object->flags & kObjectFlag40) {
Polygon poly = _polygons->get(object->getPolygonIndex());
isMasked = poly.contains(sum);
diff --git a/engines/asylum/views/scene.h b/engines/asylum/views/scene.h
index 4302400fc0..a9e92dc7a0 100644
--- a/engines/asylum/views/scene.h
+++ b/engines/asylum/views/scene.h
@@ -436,14 +436,14 @@ private:
bool speak(Common::KeyCode code);
/**
- * Check if point intersects the rectangle.
+ * Check if a point lies below the rectangle's top-left to bottom-right diagonal.
*
* @param point The point.
* @param rect The rectangle.
*
- * @return true if it succeeds, false if it fails.
+ * @return true if below, false if above.
*/
- bool pointIntersectsRect(const Common::Point &point, const Common::Rect &rect) const;
+ bool pointBelowLine(const Common::Point &point, const Common::Rect &rect) const;
/**
* Adjust coordinates.
More information about the Scummvm-git-logs
mailing list