[Scummvm-cvs-logs] CVS: scummvm/scumm imuse.cpp,2.7,2.8 instrument.cpp,2.6,2.7
Jamieson Christian
jamieson630 at users.sourceforge.net
Sat Dec 21 15:20:08 CET 2002
Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1:/tmp/cvs-serv3565
Modified Files:
imuse.cpp instrument.cpp
Log Message:
Fix to instrument load/save
Index: imuse.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/imuse.cpp,v
retrieving revision 2.7
retrieving revision 2.8
diff -u -d -r2.7 -r2.8
--- imuse.cpp 21 Dec 2002 21:09:36 -0000 2.7
+++ imuse.cpp 21 Dec 2002 23:19:42 -0000 2.8
@@ -3094,13 +3094,17 @@
ser->saveLoadArrayOf(_players, ARRAYSIZE(_players), sizeof(_players[0]), playerEntries);
ser->saveLoadArrayOf(_parts, ARRAYSIZE(_parts), sizeof(_parts[0]), partEntries);
- // Load/save the instrument definitions, which were revamped with V11.
- if (ser->getVersion() >= VER_V11) {
+ { // Load/save the instrument definitions, which were revamped with V11.
int i;
Part *part = &_parts[0];
- for (i = ARRAYSIZE(_parts); i; --i, ++part) {
- part->_program = 255;
- part->_instrument.saveOrLoad (ser);
+ if (ser->getVersion() >= VER_V11) {
+ for (i = ARRAYSIZE(_parts); i; --i, ++part) {
+ part->_program = 255;
+ part->_instrument.saveOrLoad (ser);
+ }
+ } else {
+ for (i = ARRAYSIZE(_parts); i; --i, ++part)
+ part->_instrument.clear();
}
}
Index: instrument.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/instrument.cpp,v
retrieving revision 2.6
retrieving revision 2.7
diff -u -d -r2.6 -r2.7
--- instrument.cpp 21 Dec 2002 20:10:47 -0000 2.6
+++ instrument.cpp 21 Dec 2002 23:19:42 -0000 2.7
@@ -286,8 +286,8 @@
_instrument->saveOrLoad (s);
} else {
clear();
- byte type = s->loadByte();
- switch (type) {
+ _type = s->loadByte();
+ switch (_type) {
case itNone:
break;
case itProgram:
@@ -300,7 +300,8 @@
_instrument = new Instrument_Roland (s);
break;
default:
- warning ("No known instrument classification #%d", (int) type);
+ warning ("No known instrument classification #%d", (int) _type);
+ _type = itNone;
}
}
}
More information about the Scummvm-git-logs
mailing list