[Scummvm-git-logs] scummvm master -> d152938cdd89ae443328a500c45aec3da8098483

mgerhardy martin.gerhardy at gmail.com
Thu Aug 5 20:25:22 UTC 2021


This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
6b1de8b10c TWINE: fixed body data line color value parsing
3623706a74 TWINE: fixed circle rendering
d152938cdd TWINE: use the trajector angles, not the location angles


Commit: 6b1de8b10cadaaf4e37be0b0360115ce7610283b
    https://github.com/scummvm/scummvm/commit/6b1de8b10cadaaf4e37be0b0360115ce7610283b
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-08-05T22:25:16+02:00

Commit Message:
TWINE: fixed body data line color value parsing

Changed paths:
    engines/twine/parser/body.cpp


diff --git a/engines/twine/parser/body.cpp b/engines/twine/parser/body.cpp
index ca3cc2258b..715c380275 100644
--- a/engines/twine/parser/body.cpp
+++ b/engines/twine/parser/body.cpp
@@ -129,8 +129,8 @@ void BodyData::loadLines(Common::SeekableReadStream &stream) {
 	_lines.reserve(numLines);
 	for (uint16 i = 0; i < numLines; ++i) {
 		BodyLine line;
-		line.color = stream.readByte();
 		line.unk1 = stream.readByte();
+		line.color = stream.readByte();
 		line.unk2 = stream.readUint16LE();
 		line.vertex1 = stream.readUint16LE() / 6;
 		line.vertex2 = stream.readUint16LE() / 6;


Commit: 3623706a74f832f36841fa58c045c99be11558c7
    https://github.com/scummvm/scummvm/commit/3623706a74f832f36841fa58c045c99be11558c7
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-08-05T22:25:16+02:00

Commit Message:
TWINE: fixed circle rendering

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


diff --git a/engines/twine/renderer/renderer.cpp b/engines/twine/renderer/renderer.cpp
index 28fdb7f13d..d707e6c593 100644
--- a/engines/twine/renderer/renderer.cpp
+++ b/engines/twine/renderer/renderer.cpp
@@ -1052,6 +1052,7 @@ uint8 *Renderer::prepareSpheres(const Common::Array<BodySphere> &spheres, int32
 		const int16 centerIndex = sphere.vertex;
 		cmd->x = modelData->flattenPoints[centerIndex].x;
 		cmd->y = modelData->flattenPoints[centerIndex].y;
+		cmd->z = modelData->flattenPoints[centerIndex].z;
 
 		(*renderCmds)->depth = modelData->flattenPoints[centerIndex].z;
 		(*renderCmds)->renderType = RENDERTYPE_DRAWSPHERE;
@@ -1208,11 +1209,11 @@ bool Renderer::renderModelElements(int32 numOfPrimitives, const BodyData &bodyDa
 			CmdRenderSphere *sphere = (CmdRenderSphere *)pointer;
 			int32 radius = sphere->radius;
 
-			//if (isUsingOrthoProjection) {
-			radius = (radius * 34) / 512;
-			//} else {
-			//	radius = (radius * cameraScaleY) / (cameraDepthOffset + *(const int16 *)pointer); // TODO: this does not make sense.
-			//}
+			if (_isUsingOrthoProjection) {
+				radius = (radius * 34) / 512;
+			} else {
+				radius = (sphere->radius * _cameraScaleY) / (_cameraDepthOffset + sphere->z);
+			}
 
 			radius += 3;
 
diff --git a/engines/twine/renderer/renderer.h b/engines/twine/renderer/renderer.h
index ad3a2dfb75..0b0afd967c 100644
--- a/engines/twine/renderer/renderer.h
+++ b/engines/twine/renderer/renderer.h
@@ -121,9 +121,10 @@ private:
 	 */
 	struct CmdRenderSphere {
 		int8 colorIndex = 0;
+		int16 radius = 0;
 		int16 x = 0;
 		int16 y = 0;
-		int16 radius = 0;
+		int16 z = 0;
 	};
 
 	struct ModelData {


Commit: d152938cdd89ae443328a500c45aec3da8098483
    https://github.com/scummvm/scummvm/commit/d152938cdd89ae443328a500c45aec3da8098483
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-08-05T22:25:16+02:00

Commit Message:
TWINE: use the trajector angles, not the location angles

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


diff --git a/engines/twine/holomap.cpp b/engines/twine/holomap.cpp
index ce56f0f037..2172f2b2d4 100644
--- a/engines/twine/holomap.cpp
+++ b/engines/twine/holomap.cpp
@@ -270,12 +270,12 @@ void Holomap::drawHolomapText(int32 centerx, int32 top, const char *title) {
 	_engine->_text->drawText(x, y, title);
 }
 
-void Holomap::renderHolomapPointModel(const Location &location, int32 x, int32 y) {
+void Holomap::renderHolomapPointModel(const IVec3 &angle, int32 x, int32 y) {
 	_engine->_renderer->setBaseRotation(x, y, 0);
 	_engine->_renderer->getBaseRotationPosition(0, 0, 1000);
 	const IVec3 destPos = _engine->_renderer->_destPos;
 	_engine->_renderer->setBaseTranslation(0, 0, 0);
-	_engine->_renderer->setBaseRotation(location.angle);
+	_engine->_renderer->setBaseRotation(angle);
 	_engine->_renderer->updateCameraAnglePositions(5300);
 	// why is this needed? _engine->_renderer->_baseTransPos = _engine->_renderer->_destPos;
 	_engine->_renderer->getBaseRotationPosition(destPos);
@@ -334,7 +334,7 @@ void Holomap::drawHolomapTrajectory(int32 trajectoryIndex) {
 	renderHolomapSurfacePolygons();
 
 	const Location &loc = _locations[data->locationIdx];
-	renderHolomapPointModel(loc, loc.angle.x, loc.angle.y);
+	renderHolomapPointModel(data->pos, loc.angle.x, loc.angle.y);
 
 	ActorMoveStruct move;
 	AnimTimerDataStruct animTimerData;
@@ -391,7 +391,7 @@ void Holomap::drawHolomapTrajectory(int32 trajectoryIndex) {
 				modelX = loc.angle.x;
 				modelY = loc.angle.y;
 			}
-			renderHolomapPointModel(loc, modelX, modelY);
+			renderHolomapPointModel(data->pos, modelX, modelY);
 			++trajAnimFrameIdx;
 		}
 
diff --git a/engines/twine/holomap.h b/engines/twine/holomap.h
index 21417713fd..1d583f61f3 100644
--- a/engines/twine/holomap.h
+++ b/engines/twine/holomap.h
@@ -79,8 +79,10 @@ private:
 
 	void renderLocations(int xRot, int yRot, int zRot, bool lower);
 
-	void renderHolomapPointModel(const Location &location, int32 x, int32 y);
-
+	/**
+	 * Renders a holomap path with single path points appearing slowly one after another
+	 */
+	void renderHolomapPointModel(const IVec3 &angle, int32 x, int32 y);
 	void prepareHolomapSurface();
 	void prepareHolomapProjectedPositions();
 	void prepareHolomapPolygons();




More information about the Scummvm-git-logs mailing list