[Scummvm-git-logs] scummvm master -> 25fa525969a9d41ed6d072d57f18167270f4c0a1

peterkohaut peterkohaut at users.noreply.github.com
Sun Aug 8 18:16:03 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:
c356bb4c67 TINSEL: Add support for loading Scale polygons for Noir
19f6d4f7b5 TINSEL: Add more libcall mapping for Noir
25fa525969 TINSEL: Added base of Noir movers


Commit: c356bb4c674d073f090806eb7a74f3531be384c1
    https://github.com/scummvm/scummvm/commit/c356bb4c674d073f090806eb7a74f3531be384c1
Author: Peter Kohaut (peter.kohaut at gmail.com)
Date: 2021-08-08T20:15:18+02:00

Commit Message:
TINSEL: Add support for loading Scale polygons for Noir

New type of polygon used to construct groundplane

Changed paths:
    engines/tinsel/polygons.cpp
    engines/tinsel/polygons.h


diff --git a/engines/tinsel/polygons.cpp b/engines/tinsel/polygons.cpp
index 7880c59f7f..7ea5cb1e86 100644
--- a/engines/tinsel/polygons.cpp
+++ b/engines/tinsel/polygons.cpp
@@ -42,7 +42,7 @@ namespace Tinsel {
 /** different types of polygon */
 enum POLY_TYPE {
 	POLY_PATH, POLY_NPATH, POLY_BLOCK, POLY_REFER, POLY_EFFECT,
-	POLY_EXIT, POLY_TAG, POLY_UNKNOWN
+	POLY_EXIT, POLY_TAG, POLY_SCALE
 };
 
 // Note 7/10/94, with adjacency reduction ANKHMAP max is 3, UNSEEN max is 4
@@ -184,8 +184,8 @@ public:
 	int32 reel;			// } PATH and NPATH
 	int32 zFactor;		// }
 
-	int32 playfield;	// TinselV3
-	int32 unknown;		// TinselV3
+	int32 playfield;	// Noir field
+	int32 sceneId;		// Noir field
 
 protected:
 	int32 nodecount;		///<The number of nodes in this polygon
@@ -195,6 +195,10 @@ protected:
 	const int32 *nlistx;
 	const int32 *nlisty;
 
+	int32 vx[4]; // Noir field, only for scale polygon
+	int32 vy[4]; // Noir field, only for scale polygon
+	int32 vz[4]; // Noir field, only for scale polygon
+
 public:
 	SCNHANDLE hScript;	///< handle of code segment for polygon events
 };
@@ -249,32 +253,54 @@ void Poly::nextPoly() {
 		yoff = nextLong(_pData);
 		id = nextLong(_pData);
 		if (TinselV3) {
-			warning("TODO: Complete implementation of Polygon loading for Noir");
-			unknown = nextLong(_pData);
+			sceneId = nextLong(_pData);
 			playfield = nextLong(_pData);
 		}
-		reftype = nextLong(_pData);
 	}
 
-	tagx = nextLong(_pData);
-	tagy = nextLong(_pData);
-	hTagtext = nextLong(_pData);
-	nodex = nextLong(_pData);
-	nodey = nextLong(_pData);
-	hFilm = nextLong(_pData);
+	// Noir is for scale polygons using union with some alignment
+	if (TinselV3 && type == POLY_SCALE) {
+		vx[0] = nextLong(_pData);
+		vx[1] = nextLong(_pData);
+		vx[2] = nextLong(_pData);
+		vx[3] = nextLong(_pData);
 
-	if (!TinselV2) {
-		reftype = nextLong(_pData);
-		id = nextLong(_pData);
-	}
+		vy[0] = nextLong(_pData);
+		vy[1] = nextLong(_pData);
+		vy[2] = nextLong(_pData);
+		vy[3] = nextLong(_pData);
 
-	scale1 = nextLong(_pData);
-	scale2 = nextLong(_pData);
+		vz[0] = nextLong(_pData);
+		vz[1] = nextLong(_pData);
+		vz[2] = nextLong(_pData);
+		vz[3] = nextLong(_pData);
+	} else {
+		if (TinselV2) {
+			reftype = nextLong(_pData);
+		}
+		tagx = nextLong(_pData);
+		tagy = nextLong(_pData);
+		hTagtext = nextLong(_pData);
+		nodex = nextLong(_pData);
+		nodey = nextLong(_pData);
+		hFilm = nextLong(_pData);
+
+		if (!TinselV2) {
+			reftype = nextLong(_pData);
+			id = nextLong(_pData);
+		}
+
+		scale1 = nextLong(_pData);
+		scale2 = nextLong(_pData);
+
+		if (TinselV2) {
+			level1 = nextLong(_pData);
+			level2 = nextLong(_pData);
+			bright1 = nextLong(_pData);
+		}
+	}
 
 	if (TinselV2) {
-		level1 = nextLong(_pData);
-		level2 = nextLong(_pData);
-		bright1 = nextLong(_pData);
 		bright2 = nextLong(_pData);
 	}
 
@@ -1764,10 +1790,10 @@ static void InitTag(const Poly &ptp, int pno, bool bRestart) {
 
 
 /**
- * Initialize an unknown polygon.
+ * Initialize a scale polygon. Noir only.
  */
-static void InitUnknown(const Poly &ptp, int pno, bool bRestart) {
-	CommonInits(UNKNOWN, pno, ptp, bRestart);
+static void InitScale(const Poly &ptp, int pno, bool bRestart) {
+	CommonInits(SCALE, pno, ptp, bRestart);
 }
 
 
@@ -1802,8 +1828,8 @@ static void KillDeadPolygons() {
 				Polys[i]->polyType = EX_TAG;
 				break;
 
-			case UNKNOWN:
-				Polys[i]->polyType = EX_UNKNOWN;
+			case SCALE:
+				Polys[i]->polyType = EX_SCALE;
 				break;
 
 			default:
@@ -1882,8 +1908,8 @@ void InitPolygons(SCNHANDLE ph, int numPoly, bool bRestart) {
 				InitTag(ptp, i, bRestart);
 				break;
 
-			case POLY_UNKNOWN:
-				InitUnknown(ptp, i, bRestart);
+			case POLY_SCALE:
+				InitScale(ptp, i, bRestart);
 				break;
 
 			default:
@@ -1912,7 +1938,7 @@ void InitPolygons(SCNHANDLE ph, int numPoly, bool bRestart) {
 				if (Polys[i]->polyType == TAG){
 					if (TinselV3) {
 						Poly ptp(_vm->_handle->LockMem(pHandle), Polys[i]->pIndex);
-						if (ptp.unknown != -1) {
+						if (ptp.sceneId != -1) {
 							continue;
 						}
 					}
diff --git a/engines/tinsel/polygons.h b/engines/tinsel/polygons.h
index fcdd938857..bf3c30110b 100644
--- a/engines/tinsel/polygons.h
+++ b/engines/tinsel/polygons.h
@@ -39,7 +39,7 @@ enum PTYPE {
 	// Extra polygon types from Tinsel v1
 	EXIT, EX_EXIT,
 	// Extra polygon types from Tinsel v3
-	UNKNOWN, EX_UNKNOWN
+	SCALE, EX_SCALE
 };
 
 // subtype


Commit: 19f6d4f7b57fc820d1b72ba2754c038ce01fd654
    https://github.com/scummvm/scummvm/commit/19f6d4f7b57fc820d1b72ba2754c038ce01fd654
Author: Peter Kohaut (peter.kohaut at gmail.com)
Date: 2021-08-08T20:15:18+02:00

Commit Message:
TINSEL: Add more libcall mapping for Noir

Changed paths:
    engines/tinsel/tinlib.cpp


diff --git a/engines/tinsel/tinlib.cpp b/engines/tinsel/tinlib.cpp
index 98d784d802..6218cec7ab 100644
--- a/engines/tinsel/tinlib.cpp
+++ b/engines/tinsel/tinlib.cpp
@@ -4413,12 +4413,22 @@ NoirMapping translateNoirLibCode(int libCode, int32 *pp) {
 		pp -= mapping.numArgs - 1;
 		debug(7, "%s(0x%08X, 0x%08X, 0x%08X, 0x%08X)", mapping.name, pp[0], pp[1], pp[2], pp[3]);
 		break;
+	case 114:
+		mapping = NoirMapping{"POINTACTOR", POINTACTOR, 1};
+		pp -= mapping.numArgs - 1;
+		debug(7, "%s(0x%08X)", mapping.name, pp[0]);
+		break;
 	case 121:
 		mapping = NoirMapping{"POSTTAG", POSTTAG, 2};
 		pp -= mapping.numArgs - 1;
 		debug(7, "%s(0x%08X, 0x%08X)", mapping.name, pp[0], pp[1]);
 		break;
 	case 124:
+		mapping = NoirMapping{"PRINTCURSOR", PRINTCURSOR, 1};
+		pp -= mapping.numArgs - 1;
+		debug(7, "%s(%d)", mapping.name, pp[0]);
+		break;
+	case 126:
 		mapping = NoirMapping{"PRINTTAG", PRINTTAG, 1};
 		pp -= mapping.numArgs - 1;
 		debug(7, "%s(%d)", mapping.name, pp[0]);
@@ -4527,8 +4537,8 @@ NoirMapping translateNoirLibCode(int libCode, int32 *pp) {
 		pp -= mapping.numArgs - 1;
 		debug(7, "%s(0x%08X)", mapping.name, pp[0]);
 		break;
-	case 111:
-	case 225: // STUBBED
+	case 111: // no hold frame
+	case 225: // hold frame
 		mapping = NoirMapping{"PLAYMOVIE", PLAYMOVIE, 1};
 		pp -= mapping.numArgs - 1;
 		debug(7, "%s(0x%08X)", mapping.name, pp[0]);
@@ -5423,7 +5433,7 @@ int CallLibraryRoutine(CORO_PARAM, int operand, int32 *pp, const INT_CONTEXT *pi
 		}
 
 	case PRINTCURSOR:
-		// DW2 only
+		// DW2 / Noir only
 		PrintTag(pic->hPoly, pp[0], pic->idActor, true);
 		return -1;
 
@@ -5434,7 +5444,7 @@ int CallLibraryRoutine(CORO_PARAM, int operand, int32 *pp, const INT_CONTEXT *pi
 
 	case PRINTTAG:
 		// Common to DW1 / DW2 / Noir
-		PrintTag(pic->hPoly, pp[0], TinselV2 ? pic->idActor : 0,  TinselV3 ? true : false);
+		PrintTag(pic->hPoly, pp[0], TinselV2 ? pic->idActor : 0, false);
 		return -1;
 
 	case QUITGAME:


Commit: 25fa525969a9d41ed6d072d57f18167270f4c0a1
    https://github.com/scummvm/scummvm/commit/25fa525969a9d41ed6d072d57f18167270f4c0a1
Author: Peter Kohaut (peter.kohaut at gmail.com)
Date: 2021-08-08T20:15:18+02:00

Commit Message:
TINSEL: Added base of Noir movers

Renamed rince.* files to movers to be more game independent.
Added elementary support for Noir movers which can use different logic.

Allows game to boot to the first interactive scene, but there is no 3D model rendered (that is WIP).

Changed paths:
  A engines/tinsel/movers.cpp
  A engines/tinsel/movers.h
  R engines/tinsel/rince.cpp
  R engines/tinsel/rince.h
    engines/tinsel/actors.cpp
    engines/tinsel/actors.h
    engines/tinsel/dialogs.h
    engines/tinsel/effect.cpp
    engines/tinsel/events.cpp
    engines/tinsel/mareels.cpp
    engines/tinsel/mareels.h
    engines/tinsel/module.mk
    engines/tinsel/move.cpp
    engines/tinsel/move.h
    engines/tinsel/pdisplay.cpp
    engines/tinsel/play.cpp
    engines/tinsel/polygons.cpp
    engines/tinsel/saveload.cpp
    engines/tinsel/savescn.cpp
    engines/tinsel/savescn.h
    engines/tinsel/scene.cpp
    engines/tinsel/scroll.cpp
    engines/tinsel/sysvar.h
    engines/tinsel/tinlib.cpp
    engines/tinsel/tinsel.cpp


diff --git a/engines/tinsel/actors.cpp b/engines/tinsel/actors.cpp
index 6770eea252..343cb969e3 100644
--- a/engines/tinsel/actors.cpp
+++ b/engines/tinsel/actors.cpp
@@ -34,7 +34,7 @@
 #include "tinsel/pid.h"
 #include "tinsel/play.h"
 #include "tinsel/polygons.h"
-#include "tinsel/rince.h"
+#include "tinsel/movers.h"
 #include "tinsel/sched.h"
 #include "common/serializer.h"
 #include "tinsel/sysvar.h"
diff --git a/engines/tinsel/actors.h b/engines/tinsel/actors.h
index 0c8f00f866..cd287f444c 100644
--- a/engines/tinsel/actors.h
+++ b/engines/tinsel/actors.h
@@ -28,7 +28,7 @@
 #include "tinsel/dw.h"		// for SCNHANDLE
 #include "tinsel/events.h"	// for TINSEL_EVENT
 #include "tinsel/palette.h"	// for COLORREF
-#include "tinsel/rince.h"	// for PMOVER
+#include "tinsel/movers.h"	// for PMOVER
 
 namespace Common {
 class Serializer;
diff --git a/engines/tinsel/dialogs.h b/engines/tinsel/dialogs.h
index af8f42464d..ff5e94940c 100644
--- a/engines/tinsel/dialogs.h
+++ b/engines/tinsel/dialogs.h
@@ -28,7 +28,7 @@
 #include "tinsel/dw.h"
 #include "tinsel/events.h"	// for PLR_EVENT, PLR_EVENT
 #include "tinsel/object.h"
-#include "tinsel/rince.h"
+#include "tinsel/movers.h"
 
 namespace Common {
 class Serializer;
diff --git a/engines/tinsel/effect.cpp b/engines/tinsel/effect.cpp
index 11e849e101..1a335174f5 100644
--- a/engines/tinsel/effect.cpp
+++ b/engines/tinsel/effect.cpp
@@ -36,7 +36,7 @@
 #include "tinsel/pid.h"
 #include "tinsel/pcode.h"		// LEAD_ACTOR
 #include "tinsel/polygons.h"
-#include "tinsel/rince.h"
+#include "tinsel/movers.h"
 #include "tinsel/sched.h"
 #include "tinsel/tinsel.h"
 
diff --git a/engines/tinsel/events.cpp b/engines/tinsel/events.cpp
index 9c526f199e..a251346f67 100644
--- a/engines/tinsel/events.cpp
+++ b/engines/tinsel/events.cpp
@@ -36,7 +36,7 @@
 #include "tinsel/pdisplay.h"
 #include "tinsel/pid.h"
 #include "tinsel/polygons.h"
-#include "tinsel/rince.h"	// For walking lead actor
+#include "tinsel/movers.h"	// For walking lead actor
 #include "tinsel/sched.h"
 #include "tinsel/scroll.h"	// For DontScrollCursor()
 #include "tinsel/timers.h"	// DwGetCurrentTime()
diff --git a/engines/tinsel/mareels.cpp b/engines/tinsel/mareels.cpp
index 98474d106e..8d280d4d4b 100644
--- a/engines/tinsel/mareels.cpp
+++ b/engines/tinsel/mareels.cpp
@@ -23,7 +23,7 @@
 
 #include "tinsel/handle.h"
 #include "tinsel/pcode.h"	// For D_UP, D_DOWN
-#include "tinsel/rince.h"
+#include "tinsel/movers.h"
 
 #include "common/textconsole.h"
 #include "common/util.h"
diff --git a/engines/tinsel/mareels.h b/engines/tinsel/mareels.h
index 3ef1cd43ea..63e9e714cd 100644
--- a/engines/tinsel/mareels.h
+++ b/engines/tinsel/mareels.h
@@ -24,7 +24,7 @@
 #define TINSEL_MAREELS_H
 
 #include "tinsel/dw.h"	// for SCNHANDLE
-#include "tinsel/rince.h"
+#include "tinsel/movers.h"
 
 namespace Tinsel {
 
diff --git a/engines/tinsel/module.mk b/engines/tinsel/module.mk
index b2cafcf7e5..82eab89fe1 100644
--- a/engines/tinsel/module.mk
+++ b/engines/tinsel/module.mk
@@ -24,6 +24,7 @@ MODULE_OBJS := \
 	mareels.o \
 	metaengine.o \
 	move.o \
+	movers.o \
 	multiobj.o \
 	music.o \
 	object.o \
@@ -32,7 +33,6 @@ MODULE_OBJS := \
 	pdisplay.o \
 	play.o \
 	polygons.o \
-	rince.o \
 	saveload.o \
 	savescn.o \
 	scene.o \
diff --git a/engines/tinsel/move.cpp b/engines/tinsel/move.cpp
index b297431b62..42da7046e3 100644
--- a/engines/tinsel/move.cpp
+++ b/engines/tinsel/move.cpp
@@ -33,7 +33,7 @@
 #include "tinsel/multiobj.h"	// multi-part object defintions etc.
 #include "tinsel/object.h"
 #include "tinsel/polygons.h"
-#include "tinsel/rince.h"
+#include "tinsel/movers.h"
 #include "tinsel/scroll.h"
 #include "tinsel/tinlib.h"	// For Stand()
 #include "tinsel/tinsel.h"
diff --git a/engines/tinsel/move.h b/engines/tinsel/move.h
index 7fb284baed..3d7169d9e1 100644
--- a/engines/tinsel/move.h
+++ b/engines/tinsel/move.h
@@ -24,7 +24,7 @@
 #define TINSEL_MOVE_H
 
 #include "tinsel/dw.h"	// for SCNHANDLE
-#include "tinsel/rince.h"
+#include "tinsel/movers.h"
 
 namespace Tinsel {
 
diff --git a/engines/tinsel/rince.cpp b/engines/tinsel/movers.cpp
similarity index 92%
rename from engines/tinsel/rince.cpp
rename to engines/tinsel/movers.cpp
index 8420207ce7..2706f0e59c 100644
--- a/engines/tinsel/rince.cpp
+++ b/engines/tinsel/movers.cpp
@@ -37,7 +37,7 @@
 #include "tinsel/pid.h"
 #include "tinsel/play.h"
 #include "tinsel/polygons.h"
-#include "tinsel/rince.h"
+#include "tinsel/movers.h"
 #include "tinsel/sched.h"
 #include "tinsel/sysvar.h"
 #include "tinsel/timers.h"
@@ -475,9 +475,13 @@ void GetMoverMidTop(PMOVER pMover, int *aniX, int *aniY) {
  */
 int GetMoverLeft(PMOVER pMover) {
 	assert(pMover); // Getting null moving actor's leftmost position
-	assert(pMover->actorObj); // Getting null moving actor's leftmost position
-
-	return MultiLeftmost(pMover->actorObj);
+	if (pMover->type == MOVER_3D) {
+		warning("TODO: Finish implementation of GetMoverLeft() for Noir");
+		return 0;
+	} else {
+		assert(pMover->actorObj); // Getting null moving actor's leftmost position
+		return MultiLeftmost(pMover->actorObj);
+	}
 }
 
 /**
@@ -485,9 +489,13 @@ int GetMoverLeft(PMOVER pMover) {
  */
 int GetMoverRight(PMOVER pMover) {
 	assert(pMover); // Getting null moving actor's rightmost position
-	assert(pMover->actorObj); // Getting null moving actor's rightmost position
-
-	return MultiRightmost(pMover->actorObj);
+	if (pMover->type == MOVER_3D) {
+		warning("TODO: Finish implementation of GetMoverRight() for Noir");
+		return 0;
+	} else {
+		assert(pMover->actorObj); // Getting null moving actor's rightmost position
+		return MultiRightmost(pMover->actorObj);
+	}
 }
 
 /**
@@ -495,9 +503,14 @@ int GetMoverRight(PMOVER pMover) {
  */
 int GetMoverTop(PMOVER pMover) {
 	assert(pMover); // Getting null moving actor's topmost position
-	assert(pMover->actorObj); // Getting null moving actor's topmost position
 
-	return MultiHighest(pMover->actorObj);
+	if (pMover->type == MOVER_3D) {
+		warning("TODO: Finish implementation of GetMoverTop() for Noir");
+		return 0;
+	} else {
+		assert(pMover->actorObj); // Getting null moving actor's topmost position
+		return MultiHighest(pMover->actorObj);
+	}
 }
 
 /**
@@ -505,9 +518,13 @@ int GetMoverTop(PMOVER pMover) {
  */
 int GetMoverBottom(PMOVER pMover) {
 	assert(pMover); // Getting null moving actor's bottommost position
-	assert(pMover->actorObj); // Getting null moving actor's bottommost position
-
-	return MultiLowest(pMover->actorObj);
+	if (pMover->type == MOVER_3D) {
+		warning("TODO: Finish implementation of GetMoverBottom() for Noir");
+		return 0;
+	} else {
+		assert(pMover->actorObj); // Getting null moving actor's bottommost position
+		return MultiLowest(pMover->actorObj);
+	}
 }
 
 /**
@@ -608,6 +625,10 @@ void SetMoverDirection(PMOVER pMover, DIRECTION dirn) {
  * Get actor to adopt its appropriate standing reel.
  */
 void SetMoverStanding(PMOVER pMover) {
+	if (TinselV3) {
+		warning("TODO: Finish implementation of GetMoverStanding() for Noir");
+		return;
+	}
 	assert(pMover->actorObj);
 	AlterMover(pMover, pMover->standReels[pMover->scale - 1][pMover->direction], AR_NORMAL);
 }
@@ -690,7 +711,11 @@ static void InitialPathChecks(PMOVER pMover, int xpos, int ypos) {
 
 		z = GetScale(FirstPathPoly(), pMover->objY);
 	}
-	SetMoverWalkReel(pMover, FORWARD, z, false);
+	if (TinselV3) {
+		warning("TODO: Finish implementation of InitialPathChecks() for Noir");
+	} else {
+		SetMoverWalkReel(pMover, FORWARD, z, false);
+	}
 }
 
 static void MoverProcessHelper(int X, int Y, int id, PMOVER pMover) {
@@ -850,17 +875,51 @@ void T2MoverProcess(CORO_PARAM, const void *param) {
 	CORO_END_CODE;
 }
 
+/**
+ * Tinsel 3 Moving actor process
+ * - 1 per moving actor in current scene.
+ */
+void T3MoverProcess(CORO_PARAM, const void *param) {
+	CORO_BEGIN_CONTEXT;
+	CORO_END_CONTEXT(_ctx);
+
+	// Get the co-ordinates - copied to process when it was created
+	const MAINIT *rpos = (const MAINIT *)param;
+	PMOVER pMover = rpos->pMover;
+
+	CORO_BEGIN_CODE(_ctx);
+
+	warning("TODO: Finish implementation of T3MoverProcess() for Noir");
+
+	InitMover(pMover);
+	InitialPathChecks(pMover, rpos->X, rpos->Y);
+
+	HideMover(pMover);		// Allows a play to come in before this appears
+	pMover->bHidden = false;	// ...but don't stay hidden
+
+	for (;;) {
+		DoMoveActor(pMover);
+
+		CheckBrightness(pMover);
+
+		CORO_SLEEP(1);
+	}
+
+	CORO_END_CODE;
+}
+
+
 /**
  * Creates a handling process for a moving actor
  */
 void MoverProcessCreate(int X, int Y, int id, PMOVER pMover) {
-	if (TinselV2) {
+	if (TinselV2 || TinselV3) {
 		MAINIT iStruct;
 		iStruct.X = X;
 		iStruct.Y = Y;
 		iStruct.pMover = pMover;
 
-		CoroScheduler.createProcess(PID_MOVER, T2MoverProcess, &iStruct, sizeof(MAINIT));
+		CoroScheduler.createProcess(PID_MOVER, TinselV3 ? T3MoverProcess : T2MoverProcess, &iStruct, sizeof(MAINIT));
 	} else {
 		MoverProcessHelper(X, Y, id, pMover);
 		pMover->pProc = CoroScheduler.createProcess(PID_MOVER, T1MoverProcess, &pMover, sizeof(PMOVER));
diff --git a/engines/tinsel/rince.h b/engines/tinsel/movers.h
similarity index 95%
rename from engines/tinsel/rince.h
rename to engines/tinsel/movers.h
index db59012a57..6217c276e4 100644
--- a/engines/tinsel/rince.h
+++ b/engines/tinsel/movers.h
@@ -21,8 +21,8 @@
  * Should really be called "moving actors.h"
  */
 
-#ifndef TINSEL_RINCE_H	// prevent multiple includes
-#define TINSEL_RINCE_H
+#ifndef TINSEL_MOVERS_H	// prevent multiple includes
+#define TINSEL_MOVERS_H
 
 #include "tinsel/anim.h"	// for ANIM
 #include "tinsel/scene.h"	// for TFTYPE
@@ -46,8 +46,9 @@ enum DIRECTION { LEFTREEL, RIGHTREEL, FORWARD, AWAY };
 
 #define BOGUS_BRIGHTNESS -1
 
-struct MOVER {
+enum MOVER_TYPE { MOVER_2D, MOVER_3D };
 
+struct MOVER {
 	int		objX, objY;           /* Co-ordinates object  */
 
 	int     targetX, targetY;
@@ -118,6 +119,13 @@ struct MOVER {
 	int			startColor;
 	int			paletteLength;
 	HPOLYGON	hRpath;		// Recent path
+
+	// Noir specific, just for 3D actors
+	MOVER_TYPE type;
+	SCNHANDLE hModelName;
+	SCNHANDLE hTextureName;
+	bool bIsValid;
+
 };
 typedef MOVER *PMOVER;
 
@@ -220,4 +228,4 @@ enum {
 
 } // End of namespace Tinsel
 
-#endif /* TINSEL_RINCE_H */
+#endif /* TINSEL_MOVERS_H */
diff --git a/engines/tinsel/pdisplay.cpp b/engines/tinsel/pdisplay.cpp
index da780ddea0..646b2c5189 100644
--- a/engines/tinsel/pdisplay.cpp
+++ b/engines/tinsel/pdisplay.cpp
@@ -35,7 +35,7 @@
 #include "tinsel/object.h"
 #include "tinsel/pcode.h"
 #include "tinsel/polygons.h"
-#include "tinsel/rince.h"
+#include "tinsel/movers.h"
 #include "tinsel/sched.h"
 #include "tinsel/strres.h"
 #include "tinsel/text.h"
diff --git a/engines/tinsel/play.cpp b/engines/tinsel/play.cpp
index ee67b0606e..78025bcdca 100644
--- a/engines/tinsel/play.cpp
+++ b/engines/tinsel/play.cpp
@@ -32,7 +32,7 @@
 #include "tinsel/pid.h"
 #include "tinsel/play.h"
 #include "tinsel/polygons.h"
-#include "tinsel/rince.h"
+#include "tinsel/movers.h"
 #include "tinsel/sched.h"
 #include "tinsel/scn.h"
 #include "tinsel/sound.h"
diff --git a/engines/tinsel/polygons.cpp b/engines/tinsel/polygons.cpp
index 7ea5cb1e86..1282bec082 100644
--- a/engines/tinsel/polygons.cpp
+++ b/engines/tinsel/polygons.cpp
@@ -25,7 +25,7 @@
 #include "tinsel/pcode.h"
 #include "tinsel/pid.h"
 #include "tinsel/polygons.h"
-#include "tinsel/rince.h"
+#include "tinsel/movers.h"
 #include "tinsel/sched.h"
 #include "common/serializer.h"
 #include "tinsel/tinsel.h"
diff --git a/engines/tinsel/saveload.cpp b/engines/tinsel/saveload.cpp
index 5763b43ada..4668e8b5a5 100644
--- a/engines/tinsel/saveload.cpp
+++ b/engines/tinsel/saveload.cpp
@@ -26,7 +26,7 @@
 #include "tinsel/dialogs.h"
 #include "tinsel/drives.h"
 #include "tinsel/dw.h"
-#include "tinsel/rince.h"
+#include "tinsel/movers.h"
 #include "tinsel/savescn.h"
 #include "tinsel/timers.h"
 #include "tinsel/tinlib.h"
diff --git a/engines/tinsel/savescn.cpp b/engines/tinsel/savescn.cpp
index 258df34dc8..49b184dc34 100644
--- a/engines/tinsel/savescn.cpp
+++ b/engines/tinsel/savescn.cpp
@@ -35,7 +35,7 @@
 #include "tinsel/pid.h"
 #include "tinsel/play.h"
 #include "tinsel/polygons.h"
-#include "tinsel/rince.h"
+#include "tinsel/movers.h"
 #include "tinsel/savescn.h"
 #include "tinsel/scene.h"
 #include "tinsel/sched.h"
diff --git a/engines/tinsel/savescn.h b/engines/tinsel/savescn.h
index 794d504cf7..07ffdc12b8 100644
--- a/engines/tinsel/savescn.h
+++ b/engines/tinsel/savescn.h
@@ -26,7 +26,7 @@
 
 #include "tinsel/actors.h"	// SAVED_ACTOR
 #include "tinsel/dw.h"	// SCNHANDLE
-#include "tinsel/rince.h"	// SAVED_MOVER
+#include "tinsel/movers.h"	// SAVED_MOVER
 #include "tinsel/pcode.h"	// INT_CONTEXT
 #include "tinsel/play.h"
 #include "tinsel/polygons.h"
diff --git a/engines/tinsel/scene.cpp b/engines/tinsel/scene.cpp
index fe6a2b8913..293824f2b2 100644
--- a/engines/tinsel/scene.cpp
+++ b/engines/tinsel/scene.cpp
@@ -40,7 +40,7 @@
 #include "tinsel/pid.h"	// process IDs
 #include "tinsel/play.h"
 #include "tinsel/polygons.h"
-#include "tinsel/rince.h"
+#include "tinsel/movers.h"
 #include "tinsel/sched.h"
 #include "tinsel/scn.h"
 #include "tinsel/scroll.h"
diff --git a/engines/tinsel/scroll.cpp b/engines/tinsel/scroll.cpp
index bade548b14..a4a68398f8 100644
--- a/engines/tinsel/scroll.cpp
+++ b/engines/tinsel/scroll.cpp
@@ -27,7 +27,7 @@
 #include "tinsel/dw.h"
 #include "tinsel/graphics.h"
 #include "tinsel/polygons.h"
-#include "tinsel/rince.h"
+#include "tinsel/movers.h"
 #include "tinsel/scroll.h"
 #include "tinsel/sched.h"
 #include "tinsel/sysvar.h"
diff --git a/engines/tinsel/sysvar.h b/engines/tinsel/sysvar.h
index 2efc8e89c0..adc750eb96 100644
--- a/engines/tinsel/sysvar.h
+++ b/engines/tinsel/sysvar.h
@@ -78,12 +78,16 @@ typedef enum {	SV_DEFAULT_INV,
 		SYS_Platform,			// Hardware platform     **READ ONLY**
 		SYS_Debug,			// TRUE for debug build/'cheat'**READ ONLY**
 
-		ISV_DIVERT_ACTOR,
+		//SV_SPRITER_SCENE_ID = 0x2f // Noir, loaded scene
+
+		ISV_DIVERT_ACTOR, // for DW2 = 0x28, for Noir = 0x32
 		ISV_NO_BLOCKING,
 		ISV_GHOST_ACTOR,
 		ISV_GHOST_BASE,
 		ISV_GHOST_COLOR,
 
+		//SV_SPRITER_SCALE = 0x37 // Noir, scale used for 3D rendering
+		//SV_SPRITER_OVERLAY = 0x38 // Noir, if additional model is loaded
 
 		SV_TOPVALID } SYSVARS;
 
diff --git a/engines/tinsel/tinlib.cpp b/engines/tinsel/tinlib.cpp
index 6218cec7ab..4125aceec0 100644
--- a/engines/tinsel/tinlib.cpp
+++ b/engines/tinsel/tinlib.cpp
@@ -53,7 +53,7 @@
 #include "tinsel/pid.h"
 #include "tinsel/play.h"
 #include "tinsel/polygons.h"
-#include "tinsel/rince.h"
+#include "tinsel/movers.h"
 #include "tinsel/savescn.h"
 #include "tinsel/sched.h"
 #include "tinsel/scn.h"
@@ -906,6 +906,26 @@ static int CursorPos(int xory) {
 	return (xory == CURSORXPOS) ? x : y;
 }
 
+/**
+ * Declare 3d model for an actor.
+ */
+void Dec3D(int ano, SCNHANDLE hModelName, SCNHANDLE hTextureName) {
+	MOVER* pMover = GetMover(ano);
+	assert(pMover != nullptr);
+
+	pMover->type = MOVER_3D;
+	pMover->hModelName = hModelName;
+	pMover->hTextureName = hTextureName;
+
+	// if (_hModelNameLoaded == 0) {
+	// 	_hModelNameLoaded = hModelName;
+	// 	const char* modelName = (const char *)_vm->_handle->LockMem(hModelName);
+	// 	const char* textureName = (const char *)_vm->_handle->LockMem(hTextureName);
+	// 	LoadModels(modelName, textureName);
+	// }
+	//assert(_hModelNameLoaded == hModelName);
+}
+
 /**
  * Declare conversation window.
  */
@@ -4870,7 +4890,8 @@ int CallLibraryRoutine(CORO_PARAM, int operand, int32 *pp, const INT_CONTEXT *pi
 
 	case DEC3D:
 		// Noir only
-		warning("TODO: Implement DEC3D");
+		pp -= 2;
+		Dec3D(pp[0], pp[1], pp[2]);
 		return -3;
 
 	case DECCONVW:
diff --git a/engines/tinsel/tinsel.cpp b/engines/tinsel/tinsel.cpp
index 0cafe75ba3..8b04c6ae63 100644
--- a/engines/tinsel/tinsel.cpp
+++ b/engines/tinsel/tinsel.cpp
@@ -968,7 +968,7 @@ TinselEngine::~TinselEngine() {
 	ResetVarsPDisplay();	// pdisplay.cpp
 	ResetVarsPlay();	// play.cpp
 	ResetVarsPolygons();	// polygons.cpp
-	RebootMovers();       // rince.cpp
+	RebootMovers();       // movers.cpp
 	ResetVarsSaveLoad();	// saveload.cpp
 	ResetVarsSaveScn();	// savescn.cpp
 	ResetVarsScene();	// scene.cpp




More information about the Scummvm-git-logs mailing list