diff options
author | Nicola Mettifogo | 2007-03-15 21:56:21 +0000 |
---|---|---|
committer | Nicola Mettifogo | 2007-03-15 21:56:21 +0000 |
commit | 18fb5b485b84f8b129571c11abf04b06009f3e93 (patch) | |
tree | 13e4fdcf6d29a6cb6340066a6eda3c3c0e50968d /engines/parallaction/disk.cpp | |
parent | 62a5f783eeea84520d4bbcee9ce40e466739baf7 (diff) | |
download | scummvm-rg350-18fb5b485b84f8b129571c11abf04b06009f3e93.tar.gz scummvm-rg350-18fb5b485b84f8b129571c11abf04b06009f3e93.tar.bz2 scummvm-rg350-18fb5b485b84f8b129571c11abf04b06009f3e93.zip |
moved remaining background related functions to disk.cpp, and changed Gfx accordingly
svn-id: r26145
Diffstat (limited to 'engines/parallaction/disk.cpp')
-rw-r--r-- | engines/parallaction/disk.cpp | 36 |
1 files changed, 34 insertions, 2 deletions
diff --git a/engines/parallaction/disk.cpp b/engines/parallaction/disk.cpp index 5a72800b7a..49d80215cc 100644 --- a/engines/parallaction/disk.cpp +++ b/engines/parallaction/disk.cpp @@ -388,13 +388,45 @@ void Disk::unpackBackgroundScanline(byte *src, byte *screen, byte *mask, byte *p return; } +void Disk::parseDepths(Common::SeekableReadStream &stream) { + _vm->_gfx->_bgLayers[0] = stream.readByte(); + _vm->_gfx->_bgLayers[1] = stream.readByte(); + _vm->_gfx->_bgLayers[2] = stream.readByte(); + _vm->_gfx->_bgLayers[3] = stream.readByte(); +} + + +void Disk::parseBackground(Common::SeekableReadStream &stream) { + + stream.read(_vm->_gfx->_palette, PALETTE_SIZE); + + parseDepths(stream); + + for (uint32 _si = 0; _si < 6; _si++) { + _vm->_gfx->_palettefx[_si]._timer = stream.readUint16BE(); + _vm->_gfx->_palettefx[_si]._step = stream.readUint16BE(); + _vm->_gfx->_palettefx[_si]._flags = stream.readUint16BE(); + _vm->_gfx->_palettefx[_si]._first = stream.readByte(); + _vm->_gfx->_palettefx[_si]._last = stream.readByte(); + } + +#if 0 + uint16 v147; + for (v147 = 0; v147 < PALETTE_SIZE; v147++) { + byte _al = _vm->_gfx->_palette[v147]; + _vm->_gfx->_palette[PALETTE_SIZE+v147] = _al / 2; + } +#endif + +} + void Disk::loadBackground(const char *filename) { // printf("Gfx::loadBackground(%s)\n", filename); if (!_archive.openArchivedFile(filename)) errorFileNotFound(filename); - _vm->_gfx->parseBackground(_archive); + parseBackground(_archive); byte *bg = (byte*)calloc(1, SCREEN_WIDTH*SCREEN_HEIGHT); byte *mask = (byte*)calloc(1, SCREENMASK_WIDTH*SCREEN_HEIGHT); @@ -440,7 +472,7 @@ void Disk::loadMaskAndPath(const char *name) { byte *maskBuf = (byte*)calloc(1, SCREENMASK_WIDTH*SCREEN_HEIGHT); byte *pathBuf = (byte*)calloc(1, SCREENPATH_WIDTH*SCREEN_HEIGHT); - _vm->_gfx->parseDepths(_archive); + parseDepths(_archive); _archive.read(pathBuf, SCREENPATH_WIDTH*SCREEN_HEIGHT); _archive.read(maskBuf, SCREENMASK_WIDTH*SCREEN_HEIGHT); |