[Scummvm-git-logs] scummvm master -> 92f9cf81cf3dfc13d489ede5f51d6c1ac72b84a9
Strangerke
Strangerke at scummvm.org
Wed Jun 9 07:15:15 UTC 2021
This automated email contains information about 4 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
60bf6d659a TRECISION: Reduce some variable scopes in Actor
1cdfa93e83 TRECISION: Reorder initializations in constructor to match declaration, change decompress() signature to use uint8 inste
6bb213c385 TRECISION: Reduce some variable scopes in textureTriangle()
92f9cf81cf TRECISION: Merge two levels of 'if' in LogicManager
Commit: 60bf6d659a33e20a032626008ef5a11b48da97a8
https://github.com/scummvm/scummvm/commit/60bf6d659a33e20a032626008ef5a11b48da97a8
Author: Strangerke (arnaud.boutonne at gmail.com)
Date: 2021-06-09T07:40:27+01:00
Commit Message:
TRECISION: Reduce some variable scopes in Actor
Changed paths:
engines/trecision/actor.cpp
diff --git a/engines/trecision/actor.cpp b/engines/trecision/actor.cpp
index 08879658cd..a851c4ad87 100644
--- a/engines/trecision/actor.cpp
+++ b/engines/trecision/actor.cpp
@@ -176,7 +176,6 @@ void Actor::microproseHeadFix(uint32 actionNum) {
static const uint16 idx3 = 288;
double v1[3], v2[3], v[3], q[3], m1[3][3], m2[3][3];
- int c, d, f;
v1[0] = _vertex[idx2]._x - _vertex[idx1]._x;
v1[1] = _vertex[idx2]._y - _vertex[idx1]._y;
@@ -262,6 +261,7 @@ void Actor::microproseHeadFix(uint32 actionNum) {
v1[2] = _vertex[idx1]._z;
for (int e = 279; e < 383; ++e) {
+ int f;
for (f = 0; f < 84; ++f) {
if (_vertsCorrList[f] == e)
break;
@@ -276,15 +276,15 @@ void Actor::microproseHeadFix(uint32 actionNum) {
q[0] = 0.0;
q[1] = 0.0;
q[2] = 0.0;
- for (d = 0; d < 3; ++d) {
- for (c = 0; c < 3; ++c)
+ for (int d = 0; d < 3; ++d) {
+ for (int c = 0; c < 3; ++c)
q[c] += m1[c][d] * v[d];
}
v[0] = 0.0;
v[1] = 0.0;
v[2] = 0.0;
- for (d = 0; d < 3; ++d) {
- for (c = 0; c < 3; ++c)
+ for (int d = 0; d < 3; ++d) {
+ for (int c = 0; c < 3; ++c)
v[c] += m2[d][c] * q[d];
}
Commit: 1cdfa93e8395b12d2e1da06e4899ee83a4ba8d1b
https://github.com/scummvm/scummvm/commit/1cdfa93e8395b12d2e1da06e4899ee83a4ba8d1b
Author: Strangerke (arnaud.boutonne at gmail.com)
Date: 2021-06-09T07:41:42+01:00
Commit Message:
TRECISION: Reorder initializations in constructor to match declaration, change decompress() signature to use uint8 instead of unsigned char
Changed paths:
engines/trecision/fastfile.cpp
engines/trecision/fastfile.h
diff --git a/engines/trecision/fastfile.cpp b/engines/trecision/fastfile.cpp
index f3f3e3b8bd..715f757516 100644
--- a/engines/trecision/fastfile.cpp
+++ b/engines/trecision/fastfile.cpp
@@ -31,7 +31,7 @@
namespace Trecision {
-FastFile::FastFile() : Common::Archive(), _stream(nullptr), _compBuffer(nullptr), _compStream(nullptr) {
+FastFile::FastFile() : Common::Archive(), _stream(nullptr), _compStream(nullptr), _compBuffer(nullptr) {
}
FastFile::~FastFile() {
@@ -119,7 +119,7 @@ Common::SeekableReadStream *FastFile::createReadStreamForMember(const Common::St
return stream;
}
-void FastFile::decompress(const unsigned char *src, uint32 srcSize, unsigned char *dst, uint32 decompSize) {
+void FastFile::decompress(const uint8 *src, uint32 srcSize, uint8 *dst, uint32 decompSize) {
const uint16 *sw = (const uint16 *)(src + srcSize);
uint8 *d = dst;
uint32 bytesWritten = 0;
diff --git a/engines/trecision/fastfile.h b/engines/trecision/fastfile.h
index 2fcdea3540..e318384301 100644
--- a/engines/trecision/fastfile.h
+++ b/engines/trecision/fastfile.h
@@ -59,7 +59,7 @@ private:
uint8 *_compBuffer;
const FileEntry *getEntry(const Common::String &name) const;
- void decompress(const unsigned char *src, uint32 srcSize, unsigned char *dst, uint32 decompSize);
+ void decompress(const uint8 *src, uint32 srcSize, uint8 *dst, uint32 decompSize);
};
} // End of namespace Trecision
Commit: 6bb213c385dcc38bbffc0cf8fbf4ae9b7749c5bf
https://github.com/scummvm/scummvm/commit/6bb213c385dcc38bbffc0cf8fbf4ae9b7749c5bf
Author: Strangerke (arnaud.boutonne at gmail.com)
Date: 2021-06-09T07:54:28+01:00
Commit Message:
TRECISION: Reduce some variable scopes in textureTriangle()
Changed paths:
engines/trecision/renderer3d.cpp
diff --git a/engines/trecision/renderer3d.cpp b/engines/trecision/renderer3d.cpp
index 8eb115aa62..dbb88924ef 100644
--- a/engines/trecision/renderer3d.cpp
+++ b/engines/trecision/renderer3d.cpp
@@ -119,12 +119,6 @@ void Renderer3D::textureTriangle(int32 x1, int32 y1, int32 z1, int32 c1, int32 t
int32 x2, int32 y2, int32 z2, int32 c2, int32 tx2, int32 ty2,
int32 x3, int32 y3, int32 z3, int32 c3, int32 tx3, int32 ty3,
const STexture *t) {
- int32 cl; // color of left edge of horizontal scanline
- int32 zl; // zbuffer of left edge of horizontal scanline
- int32 olx; // texture x of left edge of horizontal scanline
- int32 oly; // texture y of left edge of horizontal scanline
- int16 y; // looping variable
-
if (y1 > _maxYClip)
y1 = _maxYClip;
if (y1 < _minYClip)
@@ -154,7 +148,7 @@ void Renderer3D::textureTriangle(int32 x1, int32 y1, int32 z1, int32 c1, int32 t
y3 = _maxYClip;
yTop = y3;
}
- for (y = yBottom; y < yTop; ++y) {
+ for (int16 y = yBottom; y < yTop; ++y) {
_lEdge[y] = _maxXClip;
_rEdge[y] = _minXClip;
}
@@ -165,7 +159,7 @@ void Renderer3D::textureTriangle(int32 x1, int32 y1, int32 z1, int32 c1, int32 t
textureScanEdge(x3, y3, z3, c3, tx3, ty3, x1, y1, z1, c1, tx1, ty1);
// Gouraud fill the horizontal scanlines
- for (y = yBottom; y < yTop; ++y) {
+ for (int16 y = yBottom; y < yTop; ++y) {
int32 el = _lEdge[y];
if (el < _minXClip)
el = _minXClip;
@@ -177,14 +171,22 @@ void Renderer3D::textureTriangle(int32 x1, int32 y1, int32 z1, int32 c1, int32 t
int16 dx = er - el;
if (dx > 0) {
+ // color of left edge of horizontal scanline
+ int32 cl = _lColor[y];
// slope dc/_dx
- int32 mc = ((int16)(_rColor[y] - (cl = _lColor[y])) << 8) / dx;
+ int32 mc = ((int16)(_rColor[y] - cl) << 8) / dx;
+ // zbuffer of left edge of horizontal scanline
+ int32 zl = _lZ[y];
// slope _dz/_dx
- int32 mz = ((int32)(_rZ[y] - (zl = _lZ[y])) << 16) / dx;
+ int32 mz = ((int32)(_rZ[y] - zl) << 16) / dx;
+ // texture x of left edge of horizontal scanline
+ int32 olx = _lTextX[y];
// slope dty/_dx
- int32 mtx = ((int32)(_rTextX[y] - (olx = _lTextX[y])) << 16) / dx;
+ int32 mtx = ((int32)(_rTextX[y] - olx) << 16) / dx;
+ // texture y of left edge of horizontal scanline
+ int32 oly = _lTextY[y];
// slope dty/_dx
- int32 mty = ((int32)(_rTextY[y] - (oly = _lTextY[y])) << 16) / dx;
+ int32 mty = ((int32)(_rTextY[y] - oly) << 16) / dx;
// pointer to zbuffer
int16 *z = _zBuffer + (y - _zBufStartY) * _zBufWid + (el - _zBufStartX);
uint16 x = el;
Commit: 92f9cf81cf3dfc13d489ede5f51d6c1ac72b84a9
https://github.com/scummvm/scummvm/commit/92f9cf81cf3dfc13d489ede5f51d6c1ac72b84a9
Author: Strangerke (arnaud.boutonne at gmail.com)
Date: 2021-06-09T08:15:05+01:00
Commit Message:
TRECISION: Merge two levels of 'if' in LogicManager
Changed paths:
engines/trecision/logic.cpp
diff --git a/engines/trecision/logic.cpp b/engines/trecision/logic.cpp
index 9684020c92..526b17bb5a 100644
--- a/engines/trecision/logic.cpp
+++ b/engines/trecision/logic.cpp
@@ -3683,12 +3683,10 @@ void LogicManager::handleClickPositioner() {
}
void LogicManager::handleClickSnakeEscape() {
- if (_vm->isObjectVisible(oSNAKEU52)) {
- if (_vm->isGameArea(_vm->_mousePos) && !_vm->_flagUseWithStarted && _vm->_curObj != oSNAKEU52) {
- _vm->startCharacterAction(a526, 0, 1, 0);
- _vm->setObjectAnim(oSCAVO51, a516);
- _vm->_snake52.set(_vm->_curMessage);
- }
+ if (_vm->isObjectVisible(oSNAKEU52) && _vm->isGameArea(_vm->_mousePos) && !_vm->_flagUseWithStarted && _vm->_curObj != oSNAKEU52) {
+ _vm->startCharacterAction(a526, 0, 1, 0);
+ _vm->setObjectAnim(oSCAVO51, a516);
+ _vm->_snake52.set(_vm->_curMessage);
}
}
More information about the Scummvm-git-logs
mailing list