diff --git a/src/map/IMG/huffmanstream.cpp b/src/map/IMG/huffmanstream.cpp index bb4fc4fe..39c89317 100644 --- a/src/map/IMG/huffmanstream.cpp +++ b/src/map/IMG/huffmanstream.cpp @@ -23,29 +23,6 @@ HuffmanStream::HuffmanStream(const SubFile &file, SubFile::Handle &hdl, } } -bool HuffmanStream::readNext(qint32 &lonDelta, qint32 &latDelta) -{ - if (!readDelta(_lonSign, lonDelta)) - return false; - if (!readDelta(_latSign, latDelta)) - return false; - - if (!(lonDelta|latDelta)) - return false; - - return true; -} - -bool HuffmanStream::readOffset(qint32 &lonDelta, qint32 &latDelta) -{ - if (!readDelta(1, lonDelta)) - return false; - if (!readDelta(1, latDelta)) - return false; - - return true; -} - bool HuffmanStream::sign(int &val) { quint32 bit; diff --git a/src/map/IMG/huffmanstream.h b/src/map/IMG/huffmanstream.h index 38f1d490..ad44443f 100644 --- a/src/map/IMG/huffmanstream.h +++ b/src/map/IMG/huffmanstream.h @@ -9,8 +9,16 @@ public: HuffmanStream(const SubFile &file, SubFile::Handle &hdl, quint32 length, const HuffmanTable &table, bool line); - bool readNext(qint32 &lonDelta, qint32 &latDelta); - bool readOffset(qint32 &lonDelta, qint32 &latDelta); + bool readNext(qint32 &lonDelta, qint32 &latDelta) + { + if (!(readDelta(_lonSign, lonDelta) && readDelta(_latSign, latDelta))) + return false; + + return (lonDelta || latDelta); + } + + bool readOffset(qint32 &lonDelta, qint32 &latDelta) + {return (readDelta(1, lonDelta) && readDelta(1, latDelta));} bool atEnd() const {return _symbolDataSize + bitsAvailable() < _table.maxSymbolSize();}