Opened 18 years ago

Closed 18 years ago

Last modified 17 years ago

#2734 closed defect (fixed)

No Music in Simon1

Reported by: athrxx Owned by: eriktorbjorn
Priority: normal Component: Engine: AGOS
Version: Keywords:
Cc: Game: Simon the Sorcerer 1

Description

I don't know if I am the only one who encountered this, but when compiling with Visual C++ 7.1 and turning on optimizations (one or more of /O1 /O2 /Ox, /Og) the midi music in Simon 1 won't play (Simon 2 works fine).

The offending lines are lines 482 and 489 in simon\midi.cpp. The problem seems to be the order in which the methods that are passed as arguments are called.

Changing both lines from

in->seek(in->readUint32BE() + in->pos(), SEEK_SET);

to

uint32 offset = in->readUint32BE(); in->seek(offset + in->pos(), SEEK_SET);

solves the problem. The uint32 should obviously be declared only once.

Ticket imported from: #1520629. Ticket imported from: bugs/2734.

Change History (5)

comment:1 by eriktorbjorn, 18 years ago

This should work as well:

in->seek(in->readUint32BE(), SEEK_CUR);

I'm going to make that change. Please let me know how that turns out.

comment:2 by athrxx, 18 years ago

That was fast :)

Yes, this seems to work fine.

Thanks, Florian

comment:3 by eriktorbjorn, 18 years ago

Ok, I'll close the bug, then. Thanks for spotting it!

I've committed the fix to both trunk and branch, which means that if there is a ScummVM 0.9.1 (which seems very likely to me) the fix will be there, as well.

comment:4 by eriktorbjorn, 18 years ago

Owner: set to eriktorbjorn
Resolution: fixed
Status: newclosed

comment:5 by Kirben, 17 years ago

Component: Engine: AGIEngine: AGOS
Game: Leisure Suit Larry 1Simon the Sorcerer 1
Note: See TracTickets for help on using tickets.