From 43d3b2f378220278f508bfcea89d1aea6decaf6e Mon Sep 17 00:00:00 2001 From: Littleboy Date: Sat, 14 Jul 2012 16:55:14 -0400 Subject: LASTEXPRESS: Remove strange casts --- engines/lastexpress/data/font.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'engines/lastexpress/data') diff --git a/engines/lastexpress/data/font.cpp b/engines/lastexpress/data/font.cpp index 79cf64e617..8ac1afce9a 100644 --- a/engines/lastexpress/data/font.cpp +++ b/engines/lastexpress/data/font.cpp @@ -149,7 +149,7 @@ uint8 Font::getCharWidth(uint16 c) const{ uint16 Font::getStringWidth(Common::String str) const { uint16 width = 0; for (uint i = 0; i < str.size(); i++) - width += getCharWidth((unsigned) (int)str[i]); + width += getCharWidth((unsigned char)str[i]); return width; } @@ -185,8 +185,8 @@ void Font::drawChar(Graphics::Surface *surface, int16 x, int16 y, uint16 c) { Common::Rect Font::drawString(Graphics::Surface *surface, int16 x, int16 y, Common::String str) { int16 currentX = x; for (uint i = 0; i < str.size(); i++) { - drawChar(surface, currentX, y, (unsigned) (int)str[i]); - currentX += getCharWidth((unsigned) (int)str[i]); + drawChar(surface, currentX, y, (unsigned char)str[i]); + currentX += getCharWidth((unsigned char)str[i]); } return Common::Rect(x, y, x + currentX, y + (int16)_charHeight); -- cgit v1.2.3 From 0181a464eb864e15a02acd3ab7fb700a7cac0007 Mon Sep 17 00:00:00 2001 From: Littleboy Date: Mon, 16 Jul 2012 23:27:43 -0400 Subject: LASTEXPRESS: Use filter 16 as default filter for NIS animations This makes sure the sound is at the correct volume --- engines/lastexpress/data/snd.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/lastexpress/data') diff --git a/engines/lastexpress/data/snd.cpp b/engines/lastexpress/data/snd.cpp index 3deb2d6300..51d0815c1e 100644 --- a/engines/lastexpress/data/snd.cpp +++ b/engines/lastexpress/data/snd.cpp @@ -526,7 +526,7 @@ void AppendableSound::queueBuffer(Common::SeekableReadStream *bufferIn) { // Setup the ADPCM decoder uint32 sizeIn = (uint32)bufferIn->size(); Audio::AudioStream *adpcm = makeDecoder(bufferIn, sizeIn); - ((LastExpress_ADPCMStream *)adpcm)->setFilterId(1); + ((LastExpress_ADPCMStream *)adpcm)->setFilterId(16); // Queue the stream _as->queueAudioStream(adpcm); -- cgit v1.2.3 From 552e8d45b265f29d16a02d7a5b01803d1143ef94 Mon Sep 17 00:00:00 2001 From: Julien Date: Mon, 23 Jul 2012 14:31:33 -0400 Subject: LASTEXPRESS: Switch some warnings to debug console output --- engines/lastexpress/data/animation.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/lastexpress/data') diff --git a/engines/lastexpress/data/animation.cpp b/engines/lastexpress/data/animation.cpp index 12968520bb..ce42acb8fe 100644 --- a/engines/lastexpress/data/animation.cpp +++ b/engines/lastexpress/data/animation.cpp @@ -248,7 +248,7 @@ void Animation::processChunkAudio(Common::SeekableReadStream *in, const Chunk &c // Read Snd header uint32 header1 = in->readUint32LE(); uint16 header2 = in->readUint16LE(); - warning("Start ADPCM: %d, %d", header1, header2); + debugC(4, kLastExpressDebugSound, "Start ADPCM: %d, %d", header1, header2); size -= 6; } -- cgit v1.2.3 From d8acba294d7898ffff70ea679579cd8ae5eab0a7 Mon Sep 17 00:00:00 2001 From: Littleboy Date: Fri, 27 Jul 2012 16:07:23 -0400 Subject: LASTEXPRESS: Add IgnoreSubtype option to AnimFrame --- engines/lastexpress/data/animation.cpp | 2 +- engines/lastexpress/data/sequence.cpp | 2 +- engines/lastexpress/data/sequence.h | 6 ++++-- 3 files changed, 6 insertions(+), 4 deletions(-) (limited to 'engines/lastexpress/data') diff --git a/engines/lastexpress/data/animation.cpp b/engines/lastexpress/data/animation.cpp index ce42acb8fe..7618259e69 100644 --- a/engines/lastexpress/data/animation.cpp +++ b/engines/lastexpress/data/animation.cpp @@ -230,7 +230,7 @@ AnimFrame *Animation::processChunkFrame(Common::SeekableReadStream *in, const Ch i.read(str, false); // Decode the frame - AnimFrame *f = new AnimFrame(str, i); + AnimFrame *f = new AnimFrame(str, i, true); // Delete the temporary chunk buffer delete str; diff --git a/engines/lastexpress/data/sequence.cpp b/engines/lastexpress/data/sequence.cpp index e1e0d9bee8..a5bcba84cd 100644 --- a/engines/lastexpress/data/sequence.cpp +++ b/engines/lastexpress/data/sequence.cpp @@ -76,7 +76,7 @@ void FrameInfo::read(Common::SeekableReadStream *in, bool isSequence) { // AnimFrame -AnimFrame::AnimFrame(Common::SeekableReadStream *in, const FrameInfo &f) : _palette(NULL) { +AnimFrame::AnimFrame(Common::SeekableReadStream *in, const FrameInfo &f, bool ignoreSubtype) : _palette(NULL), _ignoreSubtype(ignoreSubtype) { _palSize = 1; // TODO: use just the needed rectangle _image.create(640, 480, Graphics::PixelFormat::createFormatCLUT8()); diff --git a/engines/lastexpress/data/sequence.h b/engines/lastexpress/data/sequence.h index 9987eae48e..610a55cebf 100644 --- a/engines/lastexpress/data/sequence.h +++ b/engines/lastexpress/data/sequence.h @@ -49,8 +49,9 @@ byte {1} - Compression type byte {1} - Subtype (determines which set of decompression functions will be called) => 0, 1, 2, 3 byte {1} - Unknown + byte {1} - Keep previous frame while drawing + byte {1} - Unknown byte {1} - Unknown - uint16 {2} - Unknown byte {1} - Sound action byte {1} - Unknown uint32 {4} - positionId @@ -129,7 +130,7 @@ struct FrameInfo { class AnimFrame : public Drawable { public: - AnimFrame(Common::SeekableReadStream *in, const FrameInfo &f); + AnimFrame(Common::SeekableReadStream *in, const FrameInfo &f, bool ignoreSubtype = false); ~AnimFrame(); Common::Rect draw(Graphics::Surface *s); @@ -146,6 +147,7 @@ private: uint16 _palSize; uint16 *_palette; Common::Rect _rect; + bool _ignoreSubtype; }; class Sequence { -- cgit v1.2.3 From 1bfd55535fc4b1e25bfeafbaf1bfcb6a3443a40e Mon Sep 17 00:00:00 2001 From: Littleboy Date: Sat, 28 Jul 2012 00:58:34 -0400 Subject: LASTEXPRESS: Disable sound filter reset on each decoded block The filter id should be computed from the sound entry status for each decoded block. The current code was resulting in blocks being skipped. --- engines/lastexpress/data/snd.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/lastexpress/data') diff --git a/engines/lastexpress/data/snd.cpp b/engines/lastexpress/data/snd.cpp index 51d0815c1e..a77e4a06c6 100644 --- a/engines/lastexpress/data/snd.cpp +++ b/engines/lastexpress/data/snd.cpp @@ -378,7 +378,7 @@ public: // Get current filter _currentFilterId = _nextFilterId; - _nextFilterId = -1; + //_nextFilterId = -1; // FIXME: the filter id should be recomputed based on the sound entry status for each block // No filter: skip decoding if (_currentFilterId == -1) -- cgit v1.2.3 From cd5e750a7fdfa0c2ac7904d24b7d8e5a06eff99a Mon Sep 17 00:00:00 2001 From: Littleboy Date: Mon, 13 Aug 2012 00:05:38 -0400 Subject: LASTEXPRESS: Fix analysis warnings --- engines/lastexpress/data/background.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'engines/lastexpress/data') diff --git a/engines/lastexpress/data/background.cpp b/engines/lastexpress/data/background.cpp index 3d866c26f9..60379251a3 100644 --- a/engines/lastexpress/data/background.cpp +++ b/engines/lastexpress/data/background.cpp @@ -107,6 +107,7 @@ byte *Background::decodeComponent(Common::SeekableReadStream *in, uint32 inSize, return NULL; // Initialize the decoding + memset(out, 0, outSize * sizeof(byte)); uint32 inPos = 0; uint32 outPos = 0; -- cgit v1.2.3 From 275aded0b0e485eead8d5bdac48d9c8dc1a6ef9c Mon Sep 17 00:00:00 2001 From: Littleboy Date: Tue, 21 Aug 2012 23:16:52 -0400 Subject: LASTEXPRESS: Remove unnecessary casts --- engines/lastexpress/data/subtitle.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'engines/lastexpress/data') diff --git a/engines/lastexpress/data/subtitle.cpp b/engines/lastexpress/data/subtitle.cpp index a9a8284588..4d19c02aa7 100644 --- a/engines/lastexpress/data/subtitle.cpp +++ b/engines/lastexpress/data/subtitle.cpp @@ -210,10 +210,10 @@ void SubtitleManager::setTime(uint16 time) { _currentIndex = -1; // Find the appropriate line to show - for (int16 i = 0; i < (int16)_subtitles.size(); i++) { + for (uint i = 0; i < _subtitles.size(); i++) { if ((time >= _subtitles[i]->getTimeStart()) && (time <= _subtitles[i]->getTimeStop())) { // Keep the index of the line to show - _currentIndex = i; + _currentIndex = (int16)i; return; } } @@ -237,7 +237,7 @@ Common::Rect SubtitleManager::draw(Graphics::Surface *surface) { // Draw the current line assert(_currentIndex >= 0 && _currentIndex < (int16)_subtitles.size()); - return _subtitles[_currentIndex]->draw(surface, _font); + return _subtitles[(uint16)_currentIndex]->draw(surface, _font); } } // End of namespace LastExpress -- cgit v1.2.3