[Scummvm-cvs-logs] CVS: scummvm/scumm script_v72he.cpp,2.209,2.210 script_v90he.cpp,2.172,2.173
kirben
kirben at users.sourceforge.net
Wed Mar 2 20:56:03 CET 2005
Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23676/scumm
Modified Files:
script_v72he.cpp script_v90he.cpp
Log Message:
Correct palSlot range
Index: script_v72he.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v72he.cpp,v
retrieving revision 2.209
retrieving revision 2.210
diff -u -d -r2.209 -r2.210
--- script_v72he.cpp 2 Mar 2005 23:14:05 -0000 2.209
+++ script_v72he.cpp 3 Mar 2005 02:51:15 -0000 2.210
@@ -1111,6 +1111,7 @@
break;
case 175: // HE 99+
a->hePaletteNum = pop();
+ a->needRedraw = true;
break;
case 198: // SO_ACTOR_VARIABLE
i = pop();
Index: script_v90he.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/script_v90he.cpp,v
retrieving revision 2.172
retrieving revision 2.173
diff -u -d -r2.172 -r2.173
--- script_v90he.cpp 2 Mar 2005 23:57:20 -0000 2.172
+++ script_v90he.cpp 3 Mar 2005 02:51:15 -0000 2.173
@@ -1889,7 +1889,7 @@
}
uint8 *ScummEngine_v90he::getHEPalette(int palSlot) {
- assert(palSlot >= 1 && palSlot < _numPalettes);
+ assert(palSlot >= 1 && palSlot <= _numPalettes);
if (palSlot == 1) {
return _currentPalette; // XXX won't work, as size == 768
} else {
@@ -1898,7 +1898,7 @@
}
void ScummEngine_v90he::setHEPaletteColor(int palSlot, uint8 color, uint8 r, uint8 g, uint8 b) {
- assert(palSlot >= 1 && palSlot < _numPalettes);
+ assert(palSlot >= 1 && palSlot <= _numPalettes);
uint8 *p = _hePalettes + palSlot * 1024 + color * 3;
*(p + 0) = r;
*(p + 1) = g;
@@ -1907,7 +1907,7 @@
}
void ScummEngine_v90he::setHEPaletteFromPtr(int palSlot, const uint8 *palData) {
- assert(palSlot >= 1 && palSlot < _numPalettes);
+ assert(palSlot >= 1 && palSlot <= _numPalettes);
uint8 *pc = _hePalettes + palSlot * 1024;
uint8 *pi = pc + 768;
for (int i = 0; i < 256; ++i) {
@@ -1919,7 +1919,7 @@
}
void ScummEngine_v90he::setHEPaletteFromCostume(int palSlot, int resId) {
- assert(palSlot >= 1 && palSlot < _numPalettes);
+ assert(palSlot >= 1 && palSlot <= _numPalettes);
const uint8 *data = getResourceAddress(rtCostume, resId);
assert(data);
const uint8 *rgbs = findResourceData(MKID('RGBS'), data);
@@ -1928,7 +1928,7 @@
}
void ScummEngine_v90he::setHEPaletteFromImage(int palSlot, int resId, int state) {
- assert(palSlot >= 1 && palSlot < _numPalettes);
+ assert(palSlot >= 1 && palSlot <= _numPalettes);
const uint8 *data = getResourceAddress(rtImage, resId);
assert(data);
const uint8 *rgbs = findWrappedBlock(MKID('RGBS'), data, state, 0);
@@ -1937,7 +1937,7 @@
}
void ScummEngine_v90he::setHEPaletteFromRoom(int palSlot, int resId, int state) {
- assert(palSlot >= 1 && palSlot < _numPalettes);
+ assert(palSlot >= 1 && palSlot <= _numPalettes);
const uint8 *data = getResourceAddress(rtRoom, resId);
assert(data);
const uint8 *rgbs = findWrappedBlock(MKID('PALS'), data, state, 0);
@@ -1946,22 +1946,22 @@
}
void ScummEngine_v90he::restoreHEPalette(int palSlot) {
- assert(palSlot >= 1 && palSlot < _numPalettes);
+ assert(palSlot >= 1 && palSlot <= _numPalettes);
if (palSlot != 1) {
memcpy(_hePalettes + palSlot * 1024, _hePalettes + 1024, 1024);
}
}
void ScummEngine_v90he::copyHEPalette(int dstPalSlot, int srcPalSlot) {
- assert(dstPalSlot >= 1 && dstPalSlot < _numPalettes);
- assert(srcPalSlot >= 1 && srcPalSlot < _numPalettes);
+ assert(dstPalSlot >= 1 && dstPalSlot <= _numPalettes);
+ assert(srcPalSlot >= 1 && srcPalSlot <= _numPalettes);
if (dstPalSlot != srcPalSlot) {
memcpy(_hePalettes + srcPalSlot * 1024, _hePalettes + dstPalSlot * 1024, 1024);
}
}
void ScummEngine_v90he::copyHEPaletteColor(int palSlot, uint8 dstColor, uint8 srcColor) {
- assert(palSlot >= 1 && palSlot < _numPalettes - 1);
+ assert(palSlot >= 1 && palSlot <= _numPalettes);
uint8 *dstPal = _hePalettes + palSlot * 1024 + dstColor * 3;
uint8 *srcPal = _hePalettes + (palSlot + 1) * 1024 + srcColor * 3;
memcpy(dstPal, srcPal, 3);
More information about the Scummvm-git-logs
mailing list