aboutsummaryrefslogtreecommitdiff
path: root/engines/toltecs/palette.cpp
diff options
context:
space:
mode:
authorBenjamin Haisch2009-06-18 08:22:52 +0000
committerWillem Jan Palenstijn2011-11-20 22:43:07 +0100
commitce7febcd70092ce0015e952af6dbfaae23bed22d (patch)
treea7772c9b72de65662cf094eb0dc9e2d85a7083df /engines/toltecs/palette.cpp
parentaf7e1c16833c2fb3df5c6079262d1e18d7959365 (diff)
downloadscummvm-rg350-ce7febcd70092ce0015e952af6dbfaae23bed22d.tar.gz
scummvm-rg350-ce7febcd70092ce0015e952af6dbfaae23bed22d.tar.bz2
scummvm-rg350-ce7febcd70092ce0015e952af6dbfaae23bed22d.zip
TOLTECS: Reworked the ArchiveReader and ResourceCache classes.
ResourceCache needs more work since resources are never freed (which is bad).
Diffstat (limited to 'engines/toltecs/palette.cpp')
-rw-r--r--engines/toltecs/palette.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/engines/toltecs/palette.cpp b/engines/toltecs/palette.cpp
index 0d5faec090..52f847e8dd 100644
--- a/engines/toltecs/palette.cpp
+++ b/engines/toltecs/palette.cpp
@@ -102,8 +102,8 @@ void Palette::setDeltaPalette(byte *palette, byte mask, char deltaValue, int16 c
}
void Palette::loadAddPalette(uint resIndex, byte startIndex) {
- byte *data = _vm->_res->load(resIndex);
- memcpy(&_mainPalette[startIndex * 3], data, _vm->_res->getCurItemSize());
+ Resource *paletteResource = _vm->_res->load(resIndex);
+ memcpy(&_mainPalette[startIndex * 3], paletteResource->data, paletteResource->size);
}
void Palette::loadAddPaletteFrom(byte *source, byte startIndex, byte count) {
@@ -113,10 +113,10 @@ void Palette::loadAddPaletteFrom(byte *source, byte startIndex, byte count) {
void Palette::addFragment(uint resIndex, int16 id) {
debug(0, "Palette::addFragment(%d, %d)", resIndex, id);
- byte *fragmentData = _vm->_res->load(resIndex);
- byte count = _vm->_res->getCurItemSize() / 3;
+ Resource *fragmentResource = _vm->_res->load(resIndex);
+ byte count = fragmentResource->size / 3;
- memcpy(&_mainPalette[_fragmentIndex * 3], fragmentData, count * 3);
+ memcpy(&_mainPalette[_fragmentIndex * 3], fragmentResource->data, count * 3);
PaletteFragment fragment;
fragment.id = id;