diff options
author | Max Horn | 2005-01-07 14:42:51 +0000 |
---|---|---|
committer | Max Horn | 2005-01-07 14:42:51 +0000 |
commit | 071b09cab4881287d702d45726438797b143f7d5 (patch) | |
tree | 9b1e407b1c31dd2b5aeb0a7d3effe1db952fc91b /scumm | |
parent | b4d547c736d6c8718cdd1bc36aa4a2fc083b6c52 (diff) | |
download | scummvm-rg350-071b09cab4881287d702d45726438797b143f7d5.tar.gz scummvm-rg350-071b09cab4881287d702d45726438797b143f7d5.tar.bz2 scummvm-rg350-071b09cab4881287d702d45726438797b143f7d5.zip |
Flag 64 bit problem in iMuse, as well as what I think might be very old regression in our code
svn-id: r16477
Diffstat (limited to 'scumm')
-rw-r--r-- | scumm/imuse_player.cpp | 7 | ||||
-rw-r--r-- | scumm/instrument.h | 13 |
2 files changed, 19 insertions, 1 deletions
diff --git a/scumm/imuse_player.cpp b/scumm/imuse_player.cpp index 712336e83d..444501af1f 100644 --- a/scumm/imuse_player.cpp +++ b/scumm/imuse_player.cpp @@ -951,7 +951,12 @@ int Player::query_part_param(int param, byte chan) { case 15: return part->_vol; case 16: - return (int)part->_instrument; +// FIXME: Need to know where this occurs... +error("Trying to cast instrument (%d, %d) -- please tell Fingolfin\n", param, chan); +// In old versions of the code, this used to return part->_program. +// This was changed in revision 2.29 of imuse.cpp (where this code used +// to reside). +// return (int)part->_instrument; case 17: return part->_transpose; default: diff --git a/scumm/instrument.h b/scumm/instrument.h index c8b9b0b3f4..1d8c84a5d2 100644 --- a/scumm/instrument.h +++ b/scumm/instrument.h @@ -60,7 +60,20 @@ public: void clear(); void copy_to (Instrument *dest) { if (_instrument) _instrument->copy_to (dest); else dest->clear(); } + + // FIXME: This is evil! We cast a pointer to an int. Besides not being + // portable to 64bit systems, it is unclear why this is needed. + // If the only reason is to supply a unique identifier of that + // instrument: there are better ways do do that. + // OTOH, maybe the code is simply wrong, and what is really meant + // here is to first dereference _instrument, then cast it? Like + // this: (int)*_instrument + // At least this would explain the otherwise unused operator int() + // supplied by class Instrument_Program. + // If that is the case, the operator int() should all be replaced by + // a proper method, like "get_something()" operator int() { return (_instrument ? (int) _instrument : 255); } + void program (byte program, bool mt32); void adlib (byte *instrument); void roland (byte *instrument); |