[Scummvm-git-logs] scummvm master -> 07beec2957a31883172d7042333a2aa144efaf53

mgerhardy martin.gerhardy at gmail.com
Tue Aug 17 16:35:45 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:
ca7e9ae08e TWINE: removed unused getBaseRotationPosition call
07beec2957 TWINE: fixed div0 zero for rendering circles


Commit: ca7e9ae08ee8a22728dbce44413e6b8e6c2d3b1e
    https://github.com/scummvm/scummvm/commit/ca7e9ae08ee8a22728dbce44413e6b8e6c2d3b1e
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-08-17T18:30:30+02:00

Commit Message:
TWINE: removed unused getBaseRotationPosition call

this is already part of setBaseRotation

Changed paths:
    engines/twine/holomap.cpp
    engines/twine/renderer/renderer.cpp


diff --git a/engines/twine/holomap.cpp b/engines/twine/holomap.cpp
index b50a638a4d..ef4d86852c 100644
--- a/engines/twine/holomap.cpp
+++ b/engines/twine/holomap.cpp
@@ -277,9 +277,6 @@ void Holomap::renderHolomapPointModel(const IVec3 &angle, int32 x, int32 y) {
 	_engine->_renderer->setBaseTranslation(0, 0, 0);
 	_engine->_renderer->setBaseRotation(angle);
 	_engine->_renderer->updateCameraAnglePositions(5300);
-	// why is this needed? _engine->_renderer->_baseTransPos = _engine->_renderer->_destPos;
-	// TODO: shouldn't the new destpos be used for the model rendering
-	_engine->_renderer->getBaseRotationPosition(destPos);
 	_engine->_interface->resetClip();
 	Common::Rect dummy;
 	_engine->_renderer->renderIsoModel(destPos, x, y, ANGLE_0, _engine->_resources->_holomapPointModelPtr, dummy);
diff --git a/engines/twine/renderer/renderer.cpp b/engines/twine/renderer/renderer.cpp
index ad228e999e..40983637f4 100644
--- a/engines/twine/renderer/renderer.cpp
+++ b/engines/twine/renderer/renderer.cpp
@@ -1263,6 +1263,7 @@ bool Renderer::renderAnimatedModel(ModelData *modelData, const BodyData &bodyDat
 			const int32 coY = pointPtr->y + renderPos.y;
 			const int32 coZ = -(pointPtr->z + renderPos.z);
 
+			// TODO: use projectPositionOnScreen()
 			pointPtrDest->x = (coX + coZ) * 24 / BRICK_SIZE + _orthoProjPos.x;
 			pointPtrDest->y = (((coX - coZ) * 12) - coY * 30) / BRICK_SIZE + _orthoProjPos.y;
 			pointPtrDest->z = coZ - coX - coY;


Commit: 07beec2957a31883172d7042333a2aa144efaf53
    https://github.com/scummvm/scummvm/commit/07beec2957a31883172d7042333a2aa144efaf53
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-08-17T18:30:55+02:00

Commit Message:
TWINE: fixed div0 zero for rendering circles

Changed paths:
    engines/twine/renderer/renderer.cpp


diff --git a/engines/twine/renderer/renderer.cpp b/engines/twine/renderer/renderer.cpp
index 40983637f4..7eecda96f6 100644
--- a/engines/twine/renderer/renderer.cpp
+++ b/engines/twine/renderer/renderer.cpp
@@ -1001,6 +1001,9 @@ void Renderer::renderPolygons(const CmdRenderPolygon &polygon, Vertex *vertices,
 }
 
 void Renderer::circleFill(int32 x, int32 y, int32 radius, uint8 color) {
+	if (radius <= 0) {
+		return;
+	}
 	radius += 1;
 
 	for (int32 currentLine = -radius; currentLine <= radius; currentLine++) {
@@ -1184,7 +1187,12 @@ bool Renderer::renderModelElements(int32 numOfPrimitives, const BodyData &bodyDa
 			if (_isUsingOrthoProjection) {
 				radius = (radius * 34) / 512;
 			} else {
-				radius = (sphere->radius * _cameraScaleY) / (_cameraDepthOffset + sphere->z);
+				int32 delta = _cameraDepthOffset + sphere->z;
+				if (delta <= 0) {
+					radius = 0;
+				} else {
+					radius = ((sphere->radius * _cameraScaleY) / delta) & 0xFFFF;
+				}
 			}
 
 			radius += 3;




More information about the Scummvm-git-logs mailing list