[Scummvm-git-logs] scummvm master -> 50a018cb2105e54651cfd374ea600a1a7ca0e818

aquadran noreply at scummvm.org
Sat Oct 19 13:21:30 UTC 2024


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

Summary:
50a018cb21 WINTERMUTE: Cleanup/sync DX usage code


Commit: 50a018cb2105e54651cfd374ea600a1a7ca0e818
    https://github.com/scummvm/scummvm/commit/50a018cb2105e54651cfd374ea600a1a7ca0e818
Author: Paweł Kołodziejski (aquadran at gmail.com)
Date: 2024-10-19T15:21:25+02:00

Commit Message:
WINTERMUTE: Cleanup/sync DX usage code

Changed paths:
    engines/wintermute/ad/ad_actor_3dx.cpp
    engines/wintermute/ad/ad_attach_3dx.cpp
    engines/wintermute/ad/ad_scene_geometry.cpp


diff --git a/engines/wintermute/ad/ad_actor_3dx.cpp b/engines/wintermute/ad/ad_actor_3dx.cpp
index c098f9a4a4b..19dd7e92238 100644
--- a/engines/wintermute/ad/ad_actor_3dx.cpp
+++ b/engines/wintermute/ad/ad_actor_3dx.cpp
@@ -557,7 +557,7 @@ bool AdActor3DX::displayAttachments(bool registerObjects) {
 			continue;
 		}
 
-		DXMatrix viewMat = *boneMat;
+		DXMatrix viewMat;
 		DXMatrixMultiply(&viewMat, &origView, boneMat);
 
 		at->displayAttachable(&viewMat, registerObjects);
diff --git a/engines/wintermute/ad/ad_attach_3dx.cpp b/engines/wintermute/ad/ad_attach_3dx.cpp
index cf0f09bad50..ee5b793c009 100644
--- a/engines/wintermute/ad/ad_attach_3dx.cpp
+++ b/engines/wintermute/ad/ad_attach_3dx.cpp
@@ -84,11 +84,9 @@ bool AdAttach3DX::update() {
 
 //////////////////////////////////////////////////////////////////////////
 bool AdAttach3DX::displayAttachable(DXMatrix *viewMat, bool registerObjects) {
-	DXMatrix finalMatrix, worldMatrix, viewMatrix;
-	worldMatrix = DXMatrix(_worldMatrix);
-	viewMatrix = DXMatrix(*viewMat);
-	DXMatrixMultiply(&finalMatrix, &worldMatrix, &viewMatrix);
-	_gameRef->_renderer3D->setWorldTransform(finalMatrix);
+	DXMatrix finalMat;
+	DXMatrixMultiply(&finalMat, &_worldMatrix, viewMat);
+	_gameRef->_renderer3D->setWorldTransform(finalMat);
 
 	if (_xmodel) {
 		_xmodel->render();
@@ -108,9 +106,8 @@ bool AdAttach3DX::displayAttachable(DXMatrix *viewMat, bool registerObjects) {
 
 //////////////////////////////////////////////////////////////////////////
 bool AdAttach3DX::displayShadowVol(DXMatrix *modelMat, DXVector3 *light, float extrusionDepth, bool update) {
-	DXMatrix finalMat, worldMatrix;
-	worldMatrix = DXMatrix(_worldMatrix);
-	DXMatrixMultiply(&finalMat, modelMat, &worldMatrix);
+	DXMatrix finalMat;
+	DXMatrixMultiply(&finalMat, modelMat, &_worldMatrix);
 
 	if (_xmodel) {
 		if (update) {
diff --git a/engines/wintermute/ad/ad_scene_geometry.cpp b/engines/wintermute/ad/ad_scene_geometry.cpp
index f4407d45cef..5365a1c20e1 100644
--- a/engines/wintermute/ad/ad_scene_geometry.cpp
+++ b/engines/wintermute/ad/ad_scene_geometry.cpp
@@ -1326,16 +1326,12 @@ bool AdSceneGeometry::persist(BasePersistenceManager *persistMgr) {
 }
 
 //////////////////////////////////////////////////////////////////////////
-bool AdSceneGeometry::convert3Dto2D(DXVector3 *position, int32 *x, int32 *y) {
+bool AdSceneGeometry::convert3Dto2D(DXVector3 *pos, int32 *x, int32 *y) {
 	DXMatrix worldMat;
 	DXMatrixIdentity(&worldMat);
-	DXMatrix projMat = DXMatrix(_lastProjMat);
-	DXMatrixTranspose(&projMat, &projMat);
-	DXMatrix viewMat = DXMatrix(_lastViewMat);
-	DXMatrixTranspose(&viewMat, &viewMat);
 
-	DXVector3 vect2D, pos = DXVector3(position->_x, position->_y, position->_z);
-	DXVec3Project(&vect2D, &pos, &_drawingViewport, &projMat, &viewMat, &worldMat);
+	DXVector3 vect2D;
+	DXVec3Project(&vect2D, pos, &_drawingViewport, &_lastProjMat, &_lastViewMat, &worldMat);
 	*x = vect2D._x + _lastScrollX;
 	*y = vect2D._y + _lastScrollY;
 




More information about the Scummvm-git-logs mailing list