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

View file

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

View file

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