[Scummvm-git-logs] scummvm master -> e6955a58534d6b323a3ea9e38435deb5a3083144
bluegr
bluegr at gmail.com
Wed Jun 9 23:06:43 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:
863a9260cf TRECISION: Fix inventory item description when opening the inventory
e6955a5853 TRECISION: Move _actorPos and _forcedActorPos into PathFinding3D
Commit: 863a9260cfc6789c88a1c90f9b74dec3903e37ad
https://github.com/scummvm/scummvm/commit/863a9260cfc6789c88a1c90f9b74dec3903e37ad
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2021-06-10T02:05:07+03:00
Commit Message:
TRECISION: Fix inventory item description when opening the inventory
Changed paths:
engines/trecision/utils.cpp
diff --git a/engines/trecision/utils.cpp b/engines/trecision/utils.cpp
index adae94059f..6d3ba63c13 100644
--- a/engines/trecision/utils.cpp
+++ b/engines/trecision/utils.cpp
@@ -192,8 +192,6 @@ void TrecisionEngine::processTime() {
_curTime = readTime();
if (_curTime >= _nextRefresh) {
- _textMgr->drawTexts();
-
if (_inventoryStatus == INV_PAINT || _inventoryStatus == INV_DEPAINT)
rollInventory(_inventoryStatus);
@@ -207,6 +205,7 @@ void TrecisionEngine::processTime() {
_lightIconOld = _lightIcon;
}
+ _textMgr->drawTexts();
_graphicsMgr->paintScreen(false);
_textMgr->clearTextStack();
Commit: e6955a58534d6b323a3ea9e38435deb5a3083144
https://github.com/scummvm/scummvm/commit/e6955a58534d6b323a3ea9e38435deb5a3083144
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2021-06-10T02:06:32+03:00
Commit Message:
TRECISION: Move _actorPos and _forcedActorPos into PathFinding3D
Changed paths:
engines/trecision/anim.cpp
engines/trecision/graphics.cpp
engines/trecision/pathfinding3d.cpp
engines/trecision/pathfinding3d.h
engines/trecision/trecision.cpp
engines/trecision/trecision.h
diff --git a/engines/trecision/anim.cpp b/engines/trecision/anim.cpp
index bfa5601bdd..864f527289 100644
--- a/engines/trecision/anim.cpp
+++ b/engines/trecision/anim.cpp
@@ -107,13 +107,13 @@ void AnimTypeManager::executeAtFrameDoit(ATFHandle *h, int doit, uint16 objectId
_vm->_flagShowCharacter = true;
break;
case fCHARACTERFOREGROUND:
- _vm->_forcedActorPos = BOX_FOREGROUND;
+ _vm->_pathFind->setForcedActorPos(BOX_FOREGROUND);
break;
case fCHARACTERBACKGROUND:
- _vm->_forcedActorPos = BOX_BACKGROUND;
+ _vm->_pathFind->setForcedActorPos(BOX_BACKGROUND);
break;
case fCHARACTERNORM:
- _vm->_forcedActorPos = BOX_NORMAL;
+ _vm->_pathFind->setForcedActorPos(BOX_NORMAL);
break;
case fSETEXTRA:
_vm->_obj[objectId].setFlagExtra(true);
diff --git a/engines/trecision/graphics.cpp b/engines/trecision/graphics.cpp
index 11531dab90..a666d202f0 100644
--- a/engines/trecision/graphics.cpp
+++ b/engines/trecision/graphics.cpp
@@ -659,7 +659,7 @@ void GraphicsManager::paintObjAnm(uint16 curBox) {
}
}
- if (_vm->_actorPos == curBox && _vm->_flagShowCharacter) {
+ if (_vm->_pathFind->getActorPos() == curBox && _vm->_flagShowCharacter) {
_vm->_renderer->drawCharacter(CALCPOINTS);
int x1 = _vm->_actor->_lim[0];
@@ -678,7 +678,7 @@ void GraphicsManager::paintObjAnm(uint16 curBox) {
_vm->_renderer->drawCharacter(DRAWFACES);
- } else if (_vm->_actorPos == curBox && !_vm->_flagDialogActive) {
+ } else if (_vm->_pathFind->getActorPos() == curBox && !_vm->_flagDialogActive) {
_vm->_animMgr->refreshActionAnimation();
}
}
diff --git a/engines/trecision/pathfinding3d.cpp b/engines/trecision/pathfinding3d.cpp
index 777d7bce46..bf46f8e2bb 100644
--- a/engines/trecision/pathfinding3d.cpp
+++ b/engines/trecision/pathfinding3d.cpp
@@ -38,14 +38,15 @@ PathFinding3D::PathFinding3D(TrecisionEngine *vm) : _vm(vm) {
_characterInMovement = false;
_characterGoToPosition = -1;
+ _actorPos = 0;
+ _forcedActorPos = 0;
_panelNum = 0;
+ _curPanel = -1;
+ _oldPanel = -1;
for (int i = 0; i < MAXPATHNODES; ++i)
_pathNode[i].clear();
- _curPanel = -1;
- _oldPanel = -1;
-
_numPathNodes = 0;
_numSortPanel = 0;
_x3d = 0.0f;
@@ -1659,8 +1660,8 @@ void PathFinding3D::actorOrder() {
const float largeValue = 15.0f; // 30 cm (max)
Actor *actor = _vm->_actor;
- if (_vm->_forcedActorPos != BOX_NORMAL) {
- _vm->_actorPos = _vm->_forcedActorPos;
+ if (_forcedActorPos != BOX_NORMAL) {
+ _actorPos = _forcedActorPos;
return;
}
@@ -1674,7 +1675,7 @@ void PathFinding3D::actorOrder() {
oz = actor->_pz + actor->_dz;
// It must be copied in front of the nearest box
- _vm->_actorPos = _sortPan[1]._num;
+ _actorPos = _sortPan[1]._num;
// from closest to farthest
for (int b = 1; b < _numSortPanel; ++b) {
for (int a = 0; a < _panelNum; ++a) {
@@ -1683,7 +1684,7 @@ void PathFinding3D::actorOrder() {
// If it intersects the center of the character camera
if (intersectLineLine(_panel[a]._x1, _panel[a]._z1, _panel[a]._x2, _panel[a]._z2, actor->_camera->_ex, actor->_camera->_ez, ox, oz) || intersectLineLine(_panel[a]._x1, _panel[a]._z1, _panel[a]._x2, _panel[a]._z2, actor->_camera->_ex, actor->_camera->_ez, ox + lx, oz + lz) || intersectLineLine(_panel[a]._x1, _panel[a]._z1, _panel[a]._x2, _panel[a]._z2, actor->_camera->_ex, actor->_camera->_ez, ox - lx, oz - lz)) {
// If it intersects it must be copied after the next box
- _vm->_actorPos = _sortPan[b + 1]._num;
+ _actorPos = _sortPan[b + 1]._num;
}
}
}
diff --git a/engines/trecision/pathfinding3d.h b/engines/trecision/pathfinding3d.h
index 778b97d010..be574b88d8 100644
--- a/engines/trecision/pathfinding3d.h
+++ b/engines/trecision/pathfinding3d.h
@@ -98,6 +98,8 @@ class PathFinding3D {
float _lookX, _lookZ;
int32 _panelNum;
int16 _oldPanel;
+ int _actorPos;
+ int _forcedActorPos;
bool pointInside(int pan, float x, float z) const;
void sortPanel();
@@ -139,6 +141,8 @@ public:
void whereIs(int px, int py);
void actorOrder();
void syncGameStream(Common::Serializer &ser);
+ int getActorPos() const { return _actorPos; }
+ void setForcedActorPos(int actorPos) { _forcedActorPos = actorPos; }
};
} // End of namespace Trecision
diff --git a/engines/trecision/trecision.cpp b/engines/trecision/trecision.cpp
index 752ad36e2c..bc0e409bff 100644
--- a/engines/trecision/trecision.cpp
+++ b/engines/trecision/trecision.cpp
@@ -155,9 +155,6 @@ TrecisionEngine::TrecisionEngine(OSystem *syst, const ADGameDescription *desc) :
_curTime = 0;
_characterSpeakTime = 0;
- _actorPos = 0;
- _forcedActorPos = 0;
-
maskMouse = false;
_pauseStartTime = 0;
diff --git a/engines/trecision/trecision.h b/engines/trecision/trecision.h
index 542478f5db..42f246c914 100644
--- a/engines/trecision/trecision.h
+++ b/engines/trecision/trecision.h
@@ -321,10 +321,8 @@ public:
uint32 _curTime;
uint32 _characterSpeakTime;
- int _actorPos;
int _cx, _cy;
- int _forcedActorPos;
uint8 _textStatus;
uint32 _pauseStartTime;
More information about the Scummvm-git-logs
mailing list