Make use of the mixer's mutex instead of creating a new one. Otherwise there can still be lock-ups when the main thread and the mixer thread lock each other up in different mutexes (causing a deadlock/freeze). I just noticed this with KQ5 FM-Towns.
We had the same issue in AGOS, it was fixed by allowing to access the mixer's mutex. We can use the same thing here...
The tracks built for the SE Talkie already have little to no silence at
the beginning, and the outlook has its own separate track instead of a
continuation of the first one.
That means the settings are of limited use here, and removing them
simplifies the code.
When ripping the audio tracks from CD, you may not get quite what the
game expects, e.g. my copy of Loom has less silence at the start of the
track than the CDDA.SOU file from the Steam version. And the MI1 intro
appears to be timed with the assumption that there is no silence at all
at the start of that track.
This makes it possible to compensate for that without having to edit the
audio file. It may also be of some help with fan soundtrack replacements
for MI1, though I have little experience with that.
Reported by GCC 12:
../scummvm/engines/hypno/cursors.cpp:146:96: warning: the address of 'Hypno::HypnoEngine::_pixelFormat' will never be NULL [-Waddress]
146 | CursorMan.replaceCursor(entry->getPixels(), entry->w, entry->h, hotspotX, hotspotY, 0, &_pixelFormat);
| ^~~~~~~~~~~~~
Reported by GCC 12:
goblin.cpp: In destructor 'virtual Gob::Goblin::~Goblin()':
goblin.cpp:110:77: warning: comparing the result of pointer addition '(((Gob::Goblin*)this)->Gob::Goblin::_goblins[i]->Gob::Goblin::Gob_Object::realStateMach + ((sizetype)(((long long unsigned int)state) * 48)))' and NULL [-Waddress]
110 | if (_goblins[i]->realStateMach[state])
| ^
It had remained stubbed for who knows how long :) This fixes a class of bugs in which
the game requested the camera to be frozen, like for example while the inventory box is shown.
This fixes an issue in COMI, in which bringing up the recipe book and then pulling it down
left the recipe texts on screen on the new room for several frames.
This reverts commit 1030283cf44605fa385fa4cb679d58cf6b938dbd.
Giving this some more thought, it seems the safer thing to do. In practive, it shouldn't matter. I haven't encountered a single situation with an emty string...