[Scummvm-git-logs] scummvm master -> 06a0fa4f2a969c91608442728a1006f96d75b712
bluegr
noreply at scummvm.org
Sun Nov 5 10:39:17 UTC 2023
This automated email contains information about 2 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
7769a3da85 CHEWY: Hide the mouse cursor when showing the notebook
06a0fa4f2a TINSEL: Simplify Dialogs::addInvObject()
Commit: 7769a3da85b28f6b179a7a5805eec20f05cdc49e
https://github.com/scummvm/scummvm/commit/7769a3da85b28f6b179a7a5805eec20f05cdc49e
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2023-11-05T12:38:57+02:00
Commit Message:
CHEWY: Hide the mouse cursor when showing the notebook
This follows the same behavior as the original
Changed paths:
engines/chewy/t_event.cpp
diff --git a/engines/chewy/t_event.cpp b/engines/chewy/t_event.cpp
index 6a08062b499..70a3e64bbae 100644
--- a/engines/chewy/t_event.cpp
+++ b/engines/chewy/t_event.cpp
@@ -2166,6 +2166,7 @@ void useItemWithInvItem(int16 itemId) {
scrolly = _G(gameState).scrolly;
_G(gameState).scrollx = 0;
_G(gameState).scrolly = 0;
+ _G(cur)->hideCursor();
_G(room)->load_tgp(NOTEBOOK_START, &_G(room_blk), GBOOK_TGP, false, GBOOK);
_G(out)->setPointer(_G(workptr));
@@ -2184,6 +2185,7 @@ void useItemWithInvItem(int16 itemId) {
_G(room)->load_tgp(_G(gameState)._personRoomNr[P_CHEWY], &_G(room_blk), EPISODE1_TGP, true, EPISODE1);
+ _G(cur)->showCursor();
_G(gameState).scrollx = scrollx;
_G(gameState).scrolly = scrolly;
break;
Commit: 06a0fa4f2a969c91608442728a1006f96d75b712
https://github.com/scummvm/scummvm/commit/06a0fa4f2a969c91608442728a1006f96d75b712
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2023-11-05T12:38:57+02:00
Commit Message:
TINSEL: Simplify Dialogs::addInvObject()
We only need specific variables (script + ani speed) that are then used
in InitStepAnimScript() below, so we can reduce the scope of the
pointers used inside fillInInventory()
Changed paths:
engines/tinsel/dialogs.cpp
engines/tinsel/dialogs.h
diff --git a/engines/tinsel/dialogs.cpp b/engines/tinsel/dialogs.cpp
index 3e07d742ba1..8c36e3d8633 100644
--- a/engines/tinsel/dialogs.cpp
+++ b/engines/tinsel/dialogs.cpp
@@ -2278,15 +2278,16 @@ void Dialogs::adjustTop() {
/**
* Insert an inventory icon object onto the display list.
*/
-OBJECT *Dialogs::addInvObject(int num, const FREEL **pfreel, const FILM **pfilm) {
+OBJECT *Dialogs::addInvObject(int num, SCNHANDLE *hNewScript, int *aniSpeed) {
auto invObj = getInvObject(num);
const FILM *pFilm = (const FILM *)_vm->_handle->LockMem(invObj->getIconFilm());
const FREEL *pfr = (const FREEL *)&pFilm->reels[0];
const MULTI_INIT *pmi = pfr->GetMultiInit();
OBJECT *pPlayObj; // The object we insert
- *pfreel = pfr;
- *pfilm = pFilm;
+ *hNewScript = FROM_32(pfr->script);
+ *aniSpeed = ONE_SECOND / FROM_32(pFilm->frate);
+
PokeInPalette(pmi);
pPlayObj = MultiInitObject(pmi); // Needs to be initialized after the palette is set
@@ -2299,19 +2300,19 @@ OBJECT *Dialogs::addInvObject(int num, const FREEL **pfreel, const FILM **pfilm)
* Create display objects for the displayed icons in an inventory window.
*/
void Dialogs::fillInInventory() {
- int Index; // Index into contents[]
+ int index; // Index into contents[]
int n = 0; // index into iconArray[]
int xpos, ypos;
int row, col;
- const FREEL *pfr;
- const FILM *pfilm;
+ SCNHANDLE hNewScript;
+ int aniSpeed;
dumpIconArray();
if (_invDragging != ID_SLIDE)
adjustTop(); // Set up slideStuff[]
- Index = _invD[_activeInv].FirstDisp; // Start from first displayed object
+ index = _invD[_activeInv].FirstDisp; // Start from first displayed object
n = 0;
ypos = START_ICONY; // Y-offset of first display row
@@ -2319,21 +2320,21 @@ void Dialogs::fillInInventory() {
xpos = START_ICONX; // X-offset of first display column
for (col = 0; col < _invD[_activeInv].NoofHicons; col++) {
- if (Index >= _invD[_activeInv].NoofItems)
+ if (index >= _invD[_activeInv].NoofItems)
break;
- else if (_invD[_activeInv].contents[Index] != _heldItem) {
+ else if (_invD[_activeInv].contents[index] != _heldItem) {
// Create a display object and position it
- _iconArray[n] = addInvObject(_invD[_activeInv].contents[Index], &pfr, &pfilm);
+ _iconArray[n] = addInvObject(_invD[_activeInv].contents[index], &hNewScript, &aniSpeed);
MultiSetAniXYZ(_iconArray[n],
_invD[_activeInv].inventoryX + xpos,
_invD[_activeInv].inventoryY + ypos,
Z_INV_ICONS);
- InitStepAnimScript(&_iconAnims[n], _iconArray[n], FROM_32(pfr->script), ONE_SECOND / FROM_32(pfilm->frate));
+ InitStepAnimScript(&_iconAnims[n], _iconArray[n], hNewScript, aniSpeed);
n++;
}
- Index++;
+ index++;
xpos += ITEM_WIDTH + 1; // X-offset of next display column
}
}
diff --git a/engines/tinsel/dialogs.h b/engines/tinsel/dialogs.h
index de52cfd35a6..f64c2b38eda 100644
--- a/engines/tinsel/dialogs.h
+++ b/engines/tinsel/dialogs.h
@@ -403,7 +403,7 @@ private:
void invBoxes(bool InBody, int curX, int curY);
void invLabels(bool InBody, int aniX, int aniY);
void adjustTop();
- OBJECT *addInvObject(int num, const FREEL **pfreel, const FILM **pfilm);
+ OBJECT *addInvObject(int num, SCNHANDLE *hNewScript, int *aniSpeed);
void addBackground(OBJECT **rect, const Common::Rect &bounds, OBJECT **title = nullptr, int textFrom = 0);
void addTitle(OBJECT **title, const Common::Rect &rect);
void addSlider(OBJECT **slide, const FILM *pfilm);
More information about the Scummvm-git-logs
mailing list