PRIVATE: implemented NoStopSounds

This commit is contained in:
neuromancer 2021-02-07 17:34:19 -03:00 committed by Eugene Sandulenko
parent e92e29bc02
commit 760e06f443
3 changed files with 18 additions and 8 deletions

View file

@ -35,7 +35,11 @@ void ChgMode(ArgArray args) {
if (args.size() == 3)
setSymbol(args[2].u.sym, true);
g_private->stopSound(true);
if (!g_private->_noStopSounds) {
// This is the only place where this should be used
g_private->stopSound(true);
g_private->_noStopSounds = false;
}
}
void VSPicture(ArgArray args) {
@ -241,7 +245,9 @@ void DossierNextSuspect(ArgArray args) {
void NoStopSounds(ArgArray args) {
// assert types
debug("WARNING: NoStopSounds is not implemented");
assert(args.size() == 0);
debug("NoStopSounds()");
g_private->_noStopSounds = true;
}
void Inventory(ArgArray args) {
@ -706,6 +712,7 @@ static struct FuncTable {
// Diary
{DiaryLocList, "DiaryLocList"},
{DiaryInvList, "DiaryInvList"},
{DiaryGoLoc, "DiaryGoLoc"},
{ Exit, "Exit"},

View file

@ -85,6 +85,7 @@ PrivateEngine::PrivateEngine(OSystem *syst)
_paperShuffleSound = new Common::String("global/audio/glsfx0");
_takeSound = new Common::String("global/audio/took");
_leaveSound = new Common::String("global/audio/left");
_noStopSounds = false;
// Radios and phone
_policeRadioArea = NULL;
@ -1103,7 +1104,7 @@ void PrivateEngine::loadLocations(Common::Rect *rect) {
i++;
if (sym->u.val) {
offset = offset + 22;
char *f = (char*) malloc(12*sizeof(char));
char *f = (char*) malloc(13*sizeof(char));
sprintf(f, "dryloc%d.bmp", i);
debug("%s, %d, %d", f, i, offset);
Common::String s(*_diaryLocPrefix + f);
@ -1116,11 +1117,11 @@ void PrivateEngine::loadLocations(Common::Rect *rect) {
}
void PrivateEngine::loadInventory(uint32 x, Common::Rect *r1, Common::Rect *r2) {
int16 offset = 44;
int16 offset = 0;
for (NameList::iterator it = inventory.begin(); it != inventory.end(); ++it) {
offset = offset + 22;
//debug("%hd %hd", rect->left, rect->top + offset);
loadMask(*it, r1->left + 120, r1->top + offset, true);
//debug("%hd %hd", rect->left, rect->top + offset);
loadMask(*it, r1->left, r1->top + offset, true);
}
}

View file

@ -150,10 +150,8 @@ public:
void syncGameStream(Common::Serializer &s);
Common::String convertPath(Common::String);
void playSound(const Common::String &, uint, bool, bool);
void playVideo(const Common::String &);
void skipVideo();
void stopSound(bool);
void loadImage(const Common::String &file, int x, int y);
void drawScreenFrame(Graphics::Surface *);
@ -224,6 +222,10 @@ public:
// Sounds
void playSound(const Common::String &, uint, bool, bool);
void stopSound(bool);
bool _noStopSounds;
Common::String *getPaperShuffleSound();
Common::String *_paperShuffleSound;