[Scummvm-git-logs] scummvm master -> 2e78933b46373ce240e3ac0f9c04645216928dcd
bluegr
bluegr at gmail.com
Tue Jun 15 22:20:19 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:
3297cb2669 TRECISION: Fix incorrect actor dirty rects - bug #12639
2e78933b46 TRECISION: Use ABS() instead of fabs()
Commit: 3297cb2669eb4072e7e3ca3e5c5b14b5e7d918ec
https://github.com/scummvm/scummvm/commit/3297cb2669eb4072e7e3ca3e5c5b14b5e7d918ec
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2021-06-16T01:18:52+03:00
Commit Message:
TRECISION: Fix incorrect actor dirty rects - bug #12639
Get rid of _actorRect, and reference the last dirty rect to be drawn
directly. Fixes invalid actor dirty rects causing Joshua to be drawn
over his action animations causing them be partially drawn, such as
the animation where Joshua is looking down the well at the castle
Changed paths:
engines/trecision/graphics.cpp
engines/trecision/graphics.h
engines/trecision/video.cpp
diff --git a/engines/trecision/graphics.cpp b/engines/trecision/graphics.cpp
index a666d202f0..a20c859716 100644
--- a/engines/trecision/graphics.cpp
+++ b/engines/trecision/graphics.cpp
@@ -45,7 +45,6 @@ GraphicsManager::GraphicsManager(TrecisionEngine *vm) : _vm(vm), _font(nullptr)
_drawObjRect = Common::Rect(0, 0, 0, 0);
_drawObjIndex = -1;
_drawMask = false;
- _actorRect = nullptr;
for (int i = 0; i < 3; ++i)
_bitMask[i] = 0;
}
@@ -103,14 +102,11 @@ bool GraphicsManager::init() {
return true;
}
-void GraphicsManager::addDirtyRect(Common::Rect rect, bool translateRect, bool updateActorRect) {
+void GraphicsManager::addDirtyRect(Common::Rect rect, bool translateRect) {
if (translateRect)
rect.translate(0, TOP);
_dirtyRects.push_back(rect);
-
- if (updateActorRect)
- _actorRect = &_dirtyRects.back();
}
void GraphicsManager::drawObj() {
@@ -498,7 +494,6 @@ void GraphicsManager::dissolve() {
void GraphicsManager::paintScreen(bool flag) {
_vm->_animTypeMgr->next();
- _actorRect = nullptr;
_dirtyRects.clear();
_vm->_flagPaintCharacter = true; // always redraws the character
@@ -515,7 +510,7 @@ void GraphicsManager::paintScreen(bool flag) {
_drawMask = false;
drawObj();
- addDirtyRect(_drawObjRect, true, true);
+ addDirtyRect(_drawObjRect, true);
} else if (_vm->_animMgr->_animRect.left != MAXX) {
_drawRect = Common::Rect(0, TOP, MAXX, AREA + TOP);
_drawObjRect = _vm->_animMgr->_animRect;
@@ -523,7 +518,7 @@ void GraphicsManager::paintScreen(bool flag) {
_drawMask = false;
drawObj();
- addDirtyRect(_drawObjRect, true, true);
+ addDirtyRect(_drawObjRect, true);
}
// If there's text to remove
@@ -668,10 +663,10 @@ void GraphicsManager::paintObjAnm(uint16 curBox) {
int y2 = _vm->_actor->_lim[3];
if (x2 > x1 && y2 > y1) {
- // enlarge the rectangle of the character
+ // enlarge the last dirty rectangle with the actor's rectangle
Common::Rect l(x1, y1, x2, y2);
- if (_actorRect)
- _actorRect->extend(l);
+ if (!_dirtyRects.empty())
+ _dirtyRects.back().extend(l);
_vm->_renderer->resetZBuffer(x1, y1, x2, y2);
}
diff --git a/engines/trecision/graphics.h b/engines/trecision/graphics.h
index ce773d8467..037af1a74e 100644
--- a/engines/trecision/graphics.h
+++ b/engines/trecision/graphics.h
@@ -52,7 +52,6 @@ class GraphicsManager {
uint8 *_font;
Common::List<Common::Rect> _dirtyRects;
- Common::Rect *_actorRect;
Common::Rect _drawRect;
Common::Rect _drawObjRect;
int _drawObjIndex;
@@ -98,7 +97,7 @@ public:
void pixelAliasing(uint16 x, uint16 y);
void dissolve();
- void addDirtyRect(Common::Rect rect, bool translateRect, bool updateActorRect = false);
+ void addDirtyRect(Common::Rect rect, bool translateRect);
uint16 getCharWidth(byte character);
void drawChar(byte curChar, uint16 textColor, uint16 line, Common::Rect rect, Common::Rect subtitleRect, uint16 inc, Graphics::Surface *externalSurface);
diff --git a/engines/trecision/video.cpp b/engines/trecision/video.cpp
index 1cbaa88c0e..2c3dba7b29 100644
--- a/engines/trecision/video.cpp
+++ b/engines/trecision/video.cpp
@@ -565,7 +565,7 @@ void AnimManager::drawSmkActionFrame() {
if (_animRect.width() > 0 && _animRect.height() > 0) {
Graphics::Surface anim = frame->getSubArea(_animRect);
_vm->_graphicsMgr->blitToScreenBuffer(&anim, _animRect.left, _animRect.top + TOP, palette, false);
- _vm->_graphicsMgr->addDirtyRect(_animRect, true, true);
+ _vm->_graphicsMgr->addDirtyRect(_animRect, true);
}
}
Commit: 2e78933b46373ce240e3ac0f9c04645216928dcd
https://github.com/scummvm/scummvm/commit/2e78933b46373ce240e3ac0f9c04645216928dcd
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2021-06-16T01:18:52+03:00
Commit Message:
TRECISION: Use ABS() instead of fabs()
Let's be absolute, vol. 2
Changed paths:
engines/trecision/pathfinding3d.cpp
diff --git a/engines/trecision/pathfinding3d.cpp b/engines/trecision/pathfinding3d.cpp
index bf46f8e2bb..fbf72e1f79 100644
--- a/engines/trecision/pathfinding3d.cpp
+++ b/engines/trecision/pathfinding3d.cpp
@@ -146,7 +146,7 @@ void PathFinding3D::findPath() {
}
} else if (_curPanel >= 0 && (b == _panel[_curPanel]._nearPanel1 || b == _panel[_curPanel]._nearPanel2)) {
// otherwise if it is near the finish panel
- if (fabs(_pathNode[_numPathNodes - 1]._dist - dist) < EPSILON && b != _oldPanel && b != _curPanel) {
+ if (ABS(_pathNode[_numPathNodes - 1]._dist - dist) < EPSILON && b != _oldPanel && b != _curPanel) {
// and the distance is very small to the intersection
--inters;
--_numPathNodes;
More information about the Scummvm-git-logs
mailing list