[Scummvm-git-logs] scummvm master -> 995ac9bf0924d12eab1aa37b1ff5d808bc1db409

mgerhardy martin.gerhardy at gmail.com
Wed Aug 4 15:58:10 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:
699124c6a8 TWINE: fixed commented code
3172b17a8a TWINE: extract to holomap vehicle rendering into own method
ae6754b2bd TWINE: leave hint on how to finish unanimated model support
995ac9bf09 TWINE removed todo comment


Commit: 699124c6a8c239f2f98a5d6b9771bf4e73d58b7b
    https://github.com/scummvm/scummvm/commit/699124c6a8c239f2f98a5d6b9771bf4e73d58b7b
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-08-04T17:57:32+02:00

Commit Message:
TWINE: fixed commented code

Changed paths:
    engines/twine/holomap.cpp


diff --git a/engines/twine/holomap.cpp b/engines/twine/holomap.cpp
index f745ce96e5..dc1d1c52b7 100644
--- a/engines/twine/holomap.cpp
+++ b/engines/twine/holomap.cpp
@@ -614,7 +614,7 @@ void Holomap::processHolomap() {
 		if (fadeInPalette) {
 			fadeInPalette = false;
 			// TODO: this does a flip - which puts stuff onto the screen that shouldn't be there
-			//_engine->_screens->fadeToPal(_engine->_screens->paletteRGBA);
+			//_engine->_screens->fadeToPal(_engine->_screens->_paletteRGBA);
 		}
 	}
 


Commit: 3172b17a8aed76024f3de859ae7c8935a542955f
    https://github.com/scummvm/scummvm/commit/3172b17a8aed76024f3de859ae7c8935a542955f
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-08-04T17:57:32+02:00

Commit Message:
TWINE: extract to holomap vehicle rendering into own method

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


diff --git a/engines/twine/holomap.cpp b/engines/twine/holomap.cpp
index dc1d1c52b7..ce56f0f037 100644
--- a/engines/twine/holomap.cpp
+++ b/engines/twine/holomap.cpp
@@ -286,6 +286,29 @@ void Holomap::renderHolomapPointModel(const Location &location, int32 x, int32 y
 	// TODO: update the screen _engine->copyBlockPhys(_engine->rect());
 }
 
+void Holomap::renderHolomapVehicle(uint &frameNumber, ActorMoveStruct &move, AnimTimerDataStruct &animTimerData, BodyData &bodyData, AnimData &animData) {
+	const int16 newAngle = move.getRealAngle(_engine->_lbaTime);
+	if (move.numOfStep == 0) {
+		_engine->_movements->setActorAngleSafe(ANGLE_0, -ANGLE_90, 500, &move);
+	}
+
+	if (_engine->_animations->setModelAnimation(frameNumber, animData, bodyData, &animTimerData)) {
+		frameNumber++;
+		if (frameNumber >= animData.getNumKeyframes()) {
+			frameNumber = animData.getLoopFrame();
+		}
+	}
+	const Common::Rect rect(0, _engine->height() - 280, 200, _engine->height() - 1);
+	_engine->_renderer->setCameraPosition(rect.width() / 2, _engine->height() - 80, 128, 900, 900);
+	_engine->_renderer->setCameraAngle(0, 0, 0, 60, 128, 0, 30000);
+	_engine->_renderer->setLightVector(-60, 128, 0);
+	// background of the vehicle
+	_engine->_interface->drawFilledRect(rect, COLOR_BLACK);
+	Common::Rect dummy;
+	_engine->_renderer->renderIsoModel(0, 0, 0, ANGLE_0, newAngle, ANGLE_0, bodyData, dummy);
+	_engine->copyBlockPhys(rect);
+}
+
 void Holomap::drawHolomapTrajectory(int32 trajectoryIndex) {
 	debug("Draw trajectory index %i", trajectoryIndex);
 
@@ -302,8 +325,11 @@ void Holomap::drawHolomapTrajectory(int32 trajectoryIndex) {
 
 	loadHolomapGFX();
 	ScopedEngineFreeze timeFreeze(_engine);
-	_engine->_renderer->setCameraPosition(400, 240, 128, 1024, 1024);
-	_engine->_renderer->setCameraAngle(0, 0, 0, data->pos.x, data->pos.y, data->pos.z, 5300);
+	const int32 cameraPosX = _engine->width() / 2 + 80;
+	const int32 cameraPosY = _engine->height() / 2;
+	const int32 extraZRot = 5300;
+	_engine->_renderer->setCameraPosition(cameraPosX, cameraPosY, 128, 1024, 1024);
+	_engine->_renderer->setCameraAngle(0, 0, 0, data->pos.x, data->pos.y, data->pos.z, extraZRot);
 
 	renderHolomapSurfacePolygons();
 
@@ -342,32 +368,15 @@ void Holomap::drawHolomapTrajectory(int32 trajectoryIndex) {
 			local18 = _engine->_lbaTime + 3;
 		}
 
-		const int16 newAngle = move.getRealAngle(_engine->_lbaTime);
-		if (move.numOfStep == 0) {
-			_engine->_movements->setActorAngleSafe(ANGLE_0, -ANGLE_90, 500, &move);
-		}
+		renderHolomapVehicle(frameNumber, move, animTimerData, bodyData, animData);
 
-		// render the vehicle you travel with
-		if (_engine->_animations->setModelAnimation(frameNumber, animData, bodyData, &animTimerData)) {
-			frameNumber++;
-			if (frameNumber >= animData.getNumKeyframes()) {
-				frameNumber = animData.getLoopFrame();
-			}
-		}
-		_engine->_renderer->setCameraPosition(100, 400, 128, 900, 900);
-		_engine->_renderer->setCameraAngle(0, 0, 0, 60, 128, 0, 30000);
-		_engine->_renderer->setLightVector(-60, 128, 0);
-		const Common::Rect rect(0, 200, 199, 479);
-		_engine->_interface->drawFilledRect(rect, COLOR_BLACK);
-		Common::Rect dummy;
-		_engine->_renderer->renderIsoModel(0, 0, 0, ANGLE_0, newAngle, ANGLE_0, bodyData, dummy);
-		_engine->copyBlockPhys(rect);
-		_engine->_renderer->setCameraPosition(400, 240, 128, 1024, 1024);
-		_engine->_renderer->setCameraAngle(0, 0, 0, data->pos.x, data->pos.y, data->pos.z, 5300);
+		// now render the holomap path
+		_engine->_renderer->setCameraPosition(cameraPosX, cameraPosY, 128, 1024, 1024);
+		_engine->_renderer->setCameraAngle(0, 0, 0, data->pos.x, data->pos.y, data->pos.z, extraZRot);
 		_engine->_renderer->setLightVector(data->pos.x, data->pos.y, 0);
 
 		// animate the path from point 1 to point 2 by rendering a point model on each position
-		// on the global every 40 timeunits
+		// on the globe every 40 timeunits
 		if (frameTime + 40 <= _engine->_lbaTime) {
 			frameTime = _engine->_lbaTime;
 			int32 modelX;
diff --git a/engines/twine/holomap.h b/engines/twine/holomap.h
index 84b7ff9f85..21417713fd 100644
--- a/engines/twine/holomap.h
+++ b/engines/twine/holomap.h
@@ -85,6 +85,7 @@ private:
 	void prepareHolomapProjectedPositions();
 	void prepareHolomapPolygons();
 	void renderHolomapSurfacePolygons();
+	void renderHolomapVehicle(uint &frameNumber, ActorMoveStruct &move, AnimTimerDataStruct &animTimerData, BodyData &bodyData, AnimData &animData);
 
 public:
 	Holomap(TwinEEngine *engine);


Commit: ae6754b2bd9f2e0d884b970c8b2a08aba06ab263
    https://github.com/scummvm/scummvm/commit/ae6754b2bd9f2e0d884b970c8b2a08aba06ab263
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-08-04T17:57:32+02:00

Commit Message:
TWINE: leave hint on how to finish unanimated model support

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


diff --git a/engines/twine/renderer/renderer.cpp b/engines/twine/renderer/renderer.cpp
index 77d91b5169..f79d102043 100644
--- a/engines/twine/renderer/renderer.cpp
+++ b/engines/twine/renderer/renderer.cpp
@@ -1451,7 +1451,14 @@ bool Renderer::renderIsoModel(int32 x, int32 y, int32 z, int32 angleX, int32 ang
 	}
 
 	if (!bodyData.isAnimated()) {
+#if 0
+		// TODO: fill modeldata.flattenedpoints
+		int32 numOfPrimitives = 0;
+		RenderCommand* renderCmds = _renderCmds;
+		return renderModelElements(numOfPrimitives, bodyData, &renderCmds, &_modelData, modelRect);
+#else
 		error("Unsupported unanimated model render!");
+#endif
 	}
 	// restart at the beginning of the renderTable
 	if (!renderAnimatedModel(&_modelData, bodyData, _renderCmds, renderAngle, renderPos, modelRect)) {


Commit: 995ac9bf0924d12eab1aa37b1ff5d808bc1db409
    https://github.com/scummvm/scummvm/commit/995ac9bf0924d12eab1aa37b1ff5d808bc1db409
Author: Martin Gerhardy (martin.gerhardy at gmail.com)
Date: 2021-08-04T17:57:32+02:00

Commit Message:
TWINE removed todo comment

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


diff --git a/engines/twine/renderer/renderer.cpp b/engines/twine/renderer/renderer.cpp
index f79d102043..28fdb7f13d 100644
--- a/engines/twine/renderer/renderer.cpp
+++ b/engines/twine/renderer/renderer.cpp
@@ -1447,7 +1447,7 @@ bool Renderer::renderIsoModel(int32 x, int32 y, int32 z, int32 angleX, int32 ang
 	} else {
 		getBaseRotationPosition(x, y, z);
 
-		renderPos = _destPos - _baseRotPos; // RECHECK y
+		renderPos = _destPos - _baseRotPos;
 	}
 
 	if (!bodyData.isAnimated()) {




More information about the Scummvm-git-logs mailing list