- unsigned int DDSImageLoader::RequestData(const unsigned int Offset,const SeekDirection::Type SeekDir, const unsigned int Size, void* Data)
- {
- if (!m_Seekable && Offset!=0)
- throw NotSupportedException();//Tried to seek on a not seekable stream.
- else
- {
- #ifdef DEBUGMODE
- int spos=m_Stream->tellg();
- #endif
- switch (SeekDir)
- {
- case Begin: m_Stream->seekg(Offset,ios::beg); break;
- case End: m_Stream->seekg(Offset,ios::end); break;
- case Current:m_Stream->seekg(Offset,ios::cur); break;
- //If this exception was thrown then is this code out of date.
- //Solution: Add the missing SeekDirection type.
- else throw NotSupportedException();
- }
- #ifdef DEBUGMODE
- if (m_Stream->tellg()-spos!=Offset)
- std::cout<<"Info("<<__FILE__<<":"<<__LINE__<<"):m_Stream->seekg() operation out of range"<<std::endl;
- #endif
- }
- ...