code simplification

svn-id: r10762
This commit is contained in:
Max Horn 2003-10-12 17:33:29 +00:00
parent 7747ef28d3
commit fafb90ddb5
6 changed files with 12 additions and 21 deletions

View file

@ -1770,7 +1770,7 @@ void Gdi::unkDecodeA(byte *dst, const byte *src, int height) {
int x = 8;
do {
FILL_BITS;
*dst++ = (_vm->_features & GF_SMALL_HEADER) ? _vm->_roomPalette[color + _palette_mod] : color + _palette_mod;
*dst++ = _vm->_roomPalette[color + _palette_mod];
againPos:
if (!READ_BIT) {
@ -1795,7 +1795,7 @@ void Gdi::unkDecodeA(byte *dst, const byte *src, int height) {
if (!--height)
return;
}
*dst++ = (_vm->_features & GF_SMALL_HEADER) ? _vm->_roomPalette[color + _palette_mod] : color + _palette_mod;
*dst++ = _vm->_roomPalette[color + _palette_mod];
} while (--reps);
bits >>= 8;
bits |= (*src++) << (cl - 8);
@ -1819,7 +1819,7 @@ void Gdi::unkDecodeA_trans(byte *dst, const byte *src, int height) {
do {
FILL_BITS;
if (color != _transparentColor)
*dst = (_vm->_features & GF_SMALL_HEADER) ? _vm->_roomPalette[color + _palette_mod] : color + _palette_mod;
*dst = _vm->_roomPalette[color + _palette_mod];
dst++;
againPos:
@ -1846,7 +1846,7 @@ void Gdi::unkDecodeA_trans(byte *dst, const byte *src, int height) {
return;
}
if (color != _transparentColor)
*dst = (_vm->_features & GF_SMALL_HEADER) ? _vm->_roomPalette[color + _palette_mod] : color + _palette_mod;
*dst = _vm->_roomPalette[color + _palette_mod];
dst++;
} while (--reps);
bits >>= 8;
@ -1870,7 +1870,7 @@ void Gdi::unkDecodeB(byte *dst, const byte *src, int height) {
int x = 8;
do {
FILL_BITS;
*dst++ = (_vm->_features & GF_SMALL_HEADER) ? _vm->_roomPalette[color + _palette_mod] : color + _palette_mod;
*dst++ = _vm->_roomPalette[color + _palette_mod];
if (!READ_BIT) {
} else if (!READ_BIT) {
FILL_BITS;
@ -1901,7 +1901,7 @@ void Gdi::unkDecodeB_trans(byte *dst, const byte *src, int height) {
do {
FILL_BITS;
if (color != _transparentColor)
*dst = (_vm->_features & GF_SMALL_HEADER) ? _vm->_roomPalette[color + _palette_mod] : color + _palette_mod;
*dst = _vm->_roomPalette[color + _palette_mod];
dst++;
if (!READ_BIT) {
} else if (!READ_BIT) {
@ -1933,7 +1933,7 @@ void Gdi::unkDecodeC(byte *dst, const byte *src, int height) {
int h = height;
do {
FILL_BITS;
*dst = (_vm->_features & GF_SMALL_HEADER) ? _vm->_roomPalette[color + _palette_mod] : color + _palette_mod;
*dst = _vm->_roomPalette[color + _palette_mod];
dst += _vm->_screenWidth;
if (!READ_BIT) {
} else if (!READ_BIT) {
@ -1966,7 +1966,7 @@ void Gdi::unkDecodeC_trans(byte *dst, const byte *src, int height) {
do {
FILL_BITS;
if (color != _transparentColor)
*dst = (_vm->_features & GF_SMALL_HEADER) ? _vm->_roomPalette[color + _palette_mod] : color + _palette_mod;
*dst = _vm->_roomPalette[color + _palette_mod];
dst += _vm->_screenWidth;
if (!READ_BIT) {
} else if (!READ_BIT) {

View file

@ -196,7 +196,6 @@ void ScummEngine_v2::readMAXS() {
_shadowPaletteSize = 256;
_roomPalette = (byte *) calloc(_shadowPaletteSize, 1); // FIXME - needs to be removed later
_shadowPalette = (byte *) calloc(_shadowPaletteSize, 1); // FIXME - needs to be removed later
allocateArrays();
}

View file

@ -208,7 +208,6 @@ void ScummEngine_v3::readMAXS() {
_shadowPaletteSize = 256;
_roomPalette = (byte *) calloc(_shadowPaletteSize, 1); // FIXME - needs to be removed later
_shadowPalette = (byte *) calloc(_shadowPaletteSize, 1); // FIXME - needs to be removed later
allocateArrays();
}

View file

@ -615,7 +615,7 @@ void ScummEngine::saveOrLoad(Serializer *s, uint32 savegameVersion) {
s->saveLoadArrayOf(_shadowPalette, _shadowPaletteSize, 1, sleByte);
// _roomPalette didn't show up until V21 save games
if (savegameVersion >= VER(21) && _version < 5)
s->saveLoadArrayOf (_roomPalette, _shadowPaletteSize, 1, sleByte);
s->saveLoadArrayOf(_roomPalette, sizeof(_roomPalette), 1, sleByte);
}
// PalManip data was not saved before V10 save games

View file

@ -950,7 +950,7 @@ protected:
public:
byte _proc_special_palette[256];
byte *_roomPalette;
byte _roomPalette[256];
byte *_shadowPalette;
protected:

View file

@ -276,6 +276,7 @@ ScummEngine::ScummEngine(GameDetector *detector, OSystem *syst)
// Init all vars - maybe now we can get rid of our custom new/delete operators?
_imuse = NULL;
_imuseDigital = NULL;
_musicEngine = NULL;
_features = 0;
_verbs = NULL;
_objs = NULL;
@ -429,7 +430,6 @@ ScummEngine::ScummEngine(GameDetector *detector, OSystem *syst)
_palManipPalette = NULL;
_palManipIntermediatePal = NULL;
memset(gfxUsageBits, 0, sizeof(gfxUsageBits));
_roomPalette = NULL;
_shadowPalette = NULL;
_shadowPaletteSize = 0;
memset(_currentPalette, 0, sizeof(_currentPalette));
@ -664,9 +664,6 @@ ScummEngine::ScummEngine(GameDetector *detector, OSystem *syst)
_mixer->setMusicVolume(kDefaultMusicVolume);
// Init iMuse
_imuse = NULL;
_imuseDigital = NULL;
_musicEngine = NULL;
if (_features & GF_DIGI_IMUSE) {
_musicEngine = _imuseDigital = new IMuseDigital(this);
#ifndef __PALM_OS__
@ -754,8 +751,6 @@ ScummEngine::ScummEngine(GameDetector *detector, OSystem *syst)
fp.close();
}
}
_audioNames = NULL;
}
ScummEngine::~ScummEngine() {
@ -780,7 +775,6 @@ ScummEngine::~ScummEngine() {
delete _costumeRenderer;
free(_roomPalette);
free(_shadowPalette);
freeResources();
@ -1900,7 +1894,6 @@ void ScummEngine::startScene(int room, Actor *a, int objectNr) {
if (_version < 7) {
for (i = 0; i < 256; i++) {
if (_features & GF_SMALL_HEADER)
_roomPalette[i] = i;
_shadowPalette[i] = i;
}