[Scummvm-git-logs] scummvm master -> 0be8059cecfa154b998e4aa53bdb3ccaa136ef68
somaen
noreply at scummvm.org
Sat May 7 19:26:45 UTC 2022
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:
492651b03a TINSEL: Stub Notebook-polygon functions
58fa9fa6da TINSEL: Implement WhichInventoryOpen for Noir.
0c908cd1db TINSEL: Use scoped enum for system reels.
0be8059cec TINSEL: Size WCOMP appropriately for Noir.
Commit: 492651b03a5eb114199e3ea87dc4227f05d39e2b
https://github.com/scummvm/scummvm/commit/492651b03a5eb114199e3ea87dc4227f05d39e2b
Author: Einar Johan Trøan SømaÌen (einarjohants at gmail.com)
Date: 2022-05-07T21:24:47+02:00
Commit Message:
TINSEL: Stub Notebook-polygon functions
Changed paths:
engines/tinsel/polygons.cpp
engines/tinsel/polygons.h
engines/tinsel/tinlib.cpp
diff --git a/engines/tinsel/polygons.cpp b/engines/tinsel/polygons.cpp
index ad35a0cb74a..07f34a3ff07 100644
--- a/engines/tinsel/polygons.cpp
+++ b/engines/tinsel/polygons.cpp
@@ -2460,10 +2460,11 @@ void UpdateGroundPlane() {
break;
}
}
- if (i >= noofPolys) return;
- //assert(i < noofPolys);// No scale polygon
+ if (i >= noofPolys)
+ return;
+ // assert(i < noofPolys);// No scale polygon
- POLYGON* pp = Polys[i];
+ POLYGON *pp = Polys[i];
Poly ptp(_vm->_handle->LockMem(pHandle), pp->pIndex);
// Vertex2c v[4];
@@ -2476,4 +2477,17 @@ void UpdateGroundPlane() {
//...
}
+// Notebook (Tinsel)
+void NotebookPolyEntry(Common::Point c0, Common::Point c1, Common::Point c2, Common::Point c3) {
+ warning("TODO: Finish implementation of NotebookPolyEntry(%d, %d, %d, %d, %d, %d, %d, %d)", c0.x, c0.y, c1.x, c1.y, c2.x, c2.y, c3.x, c3.y);
+}
+
+void NotebookPolyNextPage(Common::Point c0, Common::Point c1, Common::Point c2, Common::Point c3) {
+ warning("TODO: Finish implementation of NotebookPolyNextPage(%d, %d, %d, %d, %d, %d, %d, %d)", c0.x, c0.y, c1.x, c1.y, c2.x, c2.y, c3.x, c3.y);
+}
+
+void NotebookPolyPrevPage(Common::Point c0, Common::Point c1, Common::Point c2, Common::Point c3) {
+ warning("TODO: Finish implementation of NotebookPolyPrevPage(%d, %d, %d, %d, %d, %d, %d, %d)", c0.x, c0.y, c1.x, c1.y, c2.x, c2.y, c3.x, c3.y);
+}
+
} // End of namespace Tinsel
diff --git a/engines/tinsel/polygons.h b/engines/tinsel/polygons.h
index 83a9f9ace70..31f5a1f8cb6 100644
--- a/engines/tinsel/polygons.h
+++ b/engines/tinsel/polygons.h
@@ -152,6 +152,10 @@ int PathCount();
void MovePolygon(PTYPE ptype, int id, int x, int y);
void MovePolygonTo(PTYPE ptype, int id, int x, int y);
+void NotebookPolyEntry(Common::Point c0, Common::Point c1, Common::Point c2, Common::Point c3);
+void NotebookPolyNextPage(Common::Point c0, Common::Point c1, Common::Point c2, Common::Point c3);
+void NotebookPolyPrevPage(Common::Point c0, Common::Point c1, Common::Point c2, Common::Point c3);
+
/*-------------------------------------------------------------------------*/
void UpdateGroundPlane();
diff --git a/engines/tinsel/tinlib.cpp b/engines/tinsel/tinlib.cpp
index 4eb73b815d3..7bddb995152 100644
--- a/engines/tinsel/tinlib.cpp
+++ b/engines/tinsel/tinlib.cpp
@@ -155,7 +155,8 @@ enum MASTER_LIB_CODES {
WAITSCROLL, WAITTIME, WALK, WALKED, WALKEDPOLY, WALKEDTAG, WALKINGACTOR, WALKPOLY,
WALKTAG, WALKXPOS, WALKYPOS, WHICHCD, WHICHINVENTORY, ZZZZZZ, DEC3D, DECINVMAIN,
ADDNOTEBOOK, ADDINV3, ADDCONV, SET3DTEXTURE, FADEMUSIC, VOICEOVER, SETVIEW,
- HELDOBJECTORTOPIC, BOOKADDHYPERLINK, OPENNOTEBOOK, HIGHEST_LIBCODE
+ HELDOBJECTORTOPIC, BOOKADDHYPERLINK, OPENNOTEBOOK, NTBPOLYENTRY, NTBPOLYPREVPAGE,
+ NTBPOLYNEXTPAGE, HIGHEST_LIBCODE
};
static const MASTER_LIB_CODES DW1DEMO_CODES[] = {
@@ -5207,22 +5208,19 @@ NoirMapping translateNoirLibCode(int libCode, int32 *pp) {
debug(7, "%s()", mapping.name);
break;
case 210: // STUBBED
- warning("TODO: Implement OP210");
- mapping = NoirMapping{"OP210", ZZZZZZ, 8};
+ mapping = NoirMapping{"NTBPOLYENTRY", NTBPOLYENTRY, 8};
pp -= mapping.numArgs - 1;
debug(7, "%s(0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X)", mapping.name, pp[0], pp[1], pp[2], pp[3], pp[4], pp[5], pp[6], pp[7]);
break;
case 211: // 4 parameters
error("Unsupported libCode %d PLAYSEQUENCE", libCode);
case 212: // STUBBED
- warning("TODO: Implement OP212");
- mapping = NoirMapping{"OP212", ZZZZZZ, 8};
+ mapping = NoirMapping{"NTBPOLYPREVPAGE", NTBPOLYPREVPAGE, 8};
pp -= mapping.numArgs - 1;
debug(7, "%s(0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X)", mapping.name, pp[0], pp[1], pp[2], pp[3], pp[4], pp[5], pp[6], pp[7]);
break;
case 213: // STUBBED
- warning("TODO: Implement OP213");
- mapping = NoirMapping{"OP213", ZZZZZZ, 8};
+ mapping = NoirMapping{"NTBPOLYNEXTPAGE", NTBPOLYNEXTPAGE, 8};
pp -= mapping.numArgs - 1;
debug(7, "%s(0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X, 0x%08X)", mapping.name, pp[0], pp[1], pp[2], pp[3], pp[4], pp[5], pp[6], pp[7]);
break;
@@ -6006,6 +6004,33 @@ int CallLibraryRoutine(CORO_PARAM, int operand, int32 *pp, const INT_CONTEXT *pi
g_bNoPause = true;
return 0;
+ case NTBPOLYENTRY:
+ // Noir only
+ pp -= 7; // 8 Parameters
+ NotebookPolyEntry(Common::Point(pp[0], pp[1]),
+ Common::Point(pp[2], pp[3]),
+ Common::Point(pp[4], pp[5]),
+ Common::Point(pp[6], pp[7]));
+ return -8;
+
+ case NTBPOLYNEXTPAGE:
+ // Noir only
+ pp -= 7; // 8 Parameters
+ NotebookPolyNextPage(Common::Point(pp[0], pp[1]),
+ Common::Point(pp[2], pp[3]),
+ Common::Point(pp[4], pp[5]),
+ Common::Point(pp[6], pp[7]));
+ return -8;
+
+ case NTBPOLYPREVPAGE:
+ // Noir only
+ pp -= 7; // 8 Parameters
+ NotebookPolyPrevPage(Common::Point(pp[0], pp[1]),
+ Common::Point(pp[2], pp[3]),
+ Common::Point(pp[4], pp[5]),
+ Common::Point(pp[6], pp[7]));
+ return -8;
+
case NOSCROLL:
// Common to both DW1 & DW2
pp -= 3; // 4 parameters
Commit: 58fa9fa6da2efaef4b84e295c5a54b89683cc0af
https://github.com/scummvm/scummvm/commit/58fa9fa6da2efaef4b84e295c5a54b89683cc0af
Author: Einar Johan Trøan SømaÌen (einarjohants at gmail.com)
Date: 2022-05-07T21:25:23+02:00
Commit Message:
TINSEL: Implement WhichInventoryOpen for Noir.
Changed paths:
engines/tinsel/dialogs.cpp
engines/tinsel/noir/notebook.cpp
engines/tinsel/noir/notebook.h
engines/tinsel/tinlib.cpp
diff --git a/engines/tinsel/dialogs.cpp b/engines/tinsel/dialogs.cpp
index 12f648a2d92..df180d0b2fe 100644
--- a/engines/tinsel/dialogs.cpp
+++ b/engines/tinsel/dialogs.cpp
@@ -57,6 +57,7 @@
#include "tinsel/tinlib.h"
#include "tinsel/tinsel.h" // For engine access
#include "tinsel/token.h"
+#include "tinsel/noir/notebook.h"
#include "tinsel/noir/sysreel.h"
#include "common/textconsole.h"
@@ -1182,10 +1183,14 @@ bool Dialogs::InventoryActive() {
}
int Dialogs::WhichInventoryOpen() {
+ if (TinselVersion == 3 && _vm->_notebook->IsOpen()) {
+ return INV_NOTEBOOK;
+ }
if (_inventoryState != ACTIVE_INV)
return 0;
- else
+ else {
return _activeInv;
+ }
}
/**************************************************************************/
diff --git a/engines/tinsel/noir/notebook.cpp b/engines/tinsel/noir/notebook.cpp
index 138609c7267..5237ab4dab0 100644
--- a/engines/tinsel/noir/notebook.cpp
+++ b/engines/tinsel/noir/notebook.cpp
@@ -64,4 +64,8 @@ void Notebook::Show(bool isOpen) {
error("TODO: Implement Notebook::Show()");
}
+bool Notebook::IsOpen() const {
+ return _state != BOOKSTATE::CLOSED;
+}
+
} // End of namespace Tinsel
diff --git a/engines/tinsel/noir/notebook.h b/engines/tinsel/noir/notebook.h
index 0553cb327f0..79b7bcdb071 100644
--- a/engines/tinsel/noir/notebook.h
+++ b/engines/tinsel/noir/notebook.h
@@ -64,6 +64,7 @@ public:
void EventToNotebook(PLR_EVENT event, bool p2, bool p3);
// Called from OPENNOTEBOOK
void Show(bool isOpen);
+ bool IsOpen() const;
private:
const static uint32 MAX_ENTRIES = 100;
const static uint32 MAX_PAGES = 0x15;
diff --git a/engines/tinsel/tinlib.cpp b/engines/tinsel/tinlib.cpp
index 7bddb995152..c7c990d5f56 100644
--- a/engines/tinsel/tinlib.cpp
+++ b/engines/tinsel/tinlib.cpp
@@ -5198,8 +5198,7 @@ NoirMapping translateNoirLibCode(int libCode, int32 *pp) {
mapping = NoirMapping{"WHICHCD", WHICHCD, 0};
debug(7, "%s()", mapping.name);
break;
- case 208: // WhichInventory is implemented differently in v3, checking notebookstate
- warning("TODO: Implement WHICHINVENTORY v3");
+ case 208:
mapping = NoirMapping{"WHICHINVENTORY", WHICHINVENTORY, 0};
debug(7, "%s()", mapping.name);
break;
Commit: 0c908cd1db5bb7163d3dd3a6df4d765cdece1f80
https://github.com/scummvm/scummvm/commit/0c908cd1db5bb7163d3dd3a6df4d765cdece1f80
Author: Einar Johan Trøan SømaÌen (einarjohants at gmail.com)
Date: 2022-05-07T21:25:32+02:00
Commit Message:
TINSEL: Use scoped enum for system reels.
Also map a few more of them.
Changed paths:
engines/tinsel/dialogs.cpp
engines/tinsel/noir/sysreel.cpp
engines/tinsel/noir/sysreel.h
diff --git a/engines/tinsel/dialogs.cpp b/engines/tinsel/dialogs.cpp
index df180d0b2fe..9386d40350a 100644
--- a/engines/tinsel/dialogs.cpp
+++ b/engines/tinsel/dialogs.cpp
@@ -1159,7 +1159,7 @@ void Dialogs::InventoryIconCursor(bool bNewItem) {
INV_OBJECT *invObj = GetInvObject(_heldItem);
if (invObj->attribute & V3ATTR_X200) {
- _heldFilm = _vm->_systemReel->Get(objIndex);
+ _heldFilm = _vm->_systemReel->Get((SysReel)objIndex);
} else {
_heldFilm = _invFilms[objIndex];
}
diff --git a/engines/tinsel/noir/sysreel.cpp b/engines/tinsel/noir/sysreel.cpp
index 78db14202d3..15512876818 100644
--- a/engines/tinsel/noir/sysreel.cpp
+++ b/engines/tinsel/noir/sysreel.cpp
@@ -34,10 +34,10 @@ namespace Tinsel {
*
* @param index reel to get the handle to
*/
-SCNHANDLE SystemReel::Get(int32 index) {
- assert(index >= 0 && index < MAX_SYSREELS);
+SCNHANDLE SystemReel::Get(SysReel index) {
+ assert((int)index >= 0 && (int)index < MAX_SYSREELS);
- return _reels[index];
+ return _reels[(int)index];
}
/**
@@ -49,7 +49,7 @@ SCNHANDLE SystemReel::Get(int32 index) {
void SystemReel::Set(int32 index, SCNHANDLE reel) {
assert(index >= 0 && index < MAX_SYSREELS);
- if (index == SYSREEL_LOADSCREEN) {
+ if (index == (int)SysReel::LOADSCREEN) {
if (CoroScheduler.getCurrentPID() != PID_SCENE) {
return;
}
@@ -59,7 +59,7 @@ void SystemReel::Set(int32 index, SCNHANDLE reel) {
// Noir actually calls a function specifically for doing DwInitCursor on
// system reel 11.
- if (index == SYSREEL_CURSOR && reel != 0) {
+ if (index == (int)SysReel::CURSOR && reel != 0) {
_vm->_cursor->DwInitCursor(reel);
}
}
diff --git a/engines/tinsel/noir/sysreel.h b/engines/tinsel/noir/sysreel.h
index 8bf7ed21821..b5f23c539ec 100644
--- a/engines/tinsel/noir/sysreel.h
+++ b/engines/tinsel/noir/sysreel.h
@@ -26,21 +26,35 @@
namespace Tinsel {
+enum class SysReel {
+ NOTEPAD_OPENING = 4,
+ NOTEPAD_OPEN = 5,
+ NOTEPAD_CLOSED = 6,
+ NOTEPAD_FLIPDOWN = 7,
+ NOTEPAD_FLIPUP = 8,
+ CURSOR = 11,
+ INVMAIN = 15,
+ SLIDER = 16,
+ OPTIONS_MENU = 21,
+ LOADSAVE_MENU = 22,
+ QUIT_MENU = 23,
+ SUBTITLES_MENU = 24,
+ SLIDER_BG = 25,
+ SLIDER_HI = 26,
+ LEFT = 29,
+ RIGHT = 30,
+ LOADSCREEN = 31
+};
+
class SystemReel {
public:
SystemReel() = default;
- SCNHANDLE Get(int32 index);
+ SCNHANDLE Get(SysReel index);
void Set(int32 index, SCNHANDLE reel);
-
private:
const static int32 MAX_SYSREELS = 0x28;
- enum {
- SYSREEL_CURSOR = 11,
- SYSREEL_LOADSCREEN = 0x1f
- };
-
SCNHANDLE _reels[MAX_SYSREELS];
};
Commit: 0be8059cecfa154b998e4aa53bdb3ccaa136ef68
https://github.com/scummvm/scummvm/commit/0be8059cecfa154b998e4aa53bdb3ccaa136ef68
Author: Einar Johan Trøan SømaÌen (einarjohants at gmail.com)
Date: 2022-05-07T21:25:44+02:00
Commit Message:
TINSEL: Size WCOMP appropriately for Noir.
Changed paths:
engines/tinsel/dialogs.h
diff --git a/engines/tinsel/dialogs.h b/engines/tinsel/dialogs.h
index 5b727796971..8db8be40656 100644
--- a/engines/tinsel/dialogs.h
+++ b/engines/tinsel/dialogs.h
@@ -119,9 +119,11 @@ enum InvCursorFN { IC_AREA,
#define SG_DESC_LEN 40 // Max. saved game description length
// Number of objects that makes up an empty window
-#define MAX_WCOMP 21 // 4 corners + (3+3) sides + (2+2) extra sides
- // + Bground + title + slider
- // + more Needed for save game window
+#define MAX_WCOMP_T0 21 // 4 corners + (3+3) sides + (2+2) extra sides
+ // + Bground + title + slider
+ // + more Needed for save game window
+#define MAX_WCOMP_T3 84
+#define MAX_WCOMP (TinselVersion == 3 ? MAX_WCOMP_T3 : MAX_WCOMP_T0)
#define MAX_ICONS MAXHICONS *MAXVICONS
#define MAX_ININV_TOT 160
@@ -503,8 +505,8 @@ private:
LANGUAGE _displayedLanguage;
- OBJECT *_objArray[MAX_WCOMP]; // Current display objects (window)
- OBJECT *_dispObjArray[MAX_WCOMP]; // Current display objects (re-sizing window)
+ OBJECT *_objArray[MAX_WCOMP_T3]; // Current display objects (window)
+ OBJECT *_dispObjArray[MAX_WCOMP_T3]; // Current display objects (re-sizing window)
ANIM _iconAnims[MAX_ICONS];
OBJECT *_rectObject, *_slideObject; // Current display objects, for reference
More information about the Scummvm-git-logs
mailing list