//========= Copyright © 1996-2001, Valve LLC, All rights reserved. ============ // // Purpose: // // $NoKeywords: $ //============================================================================= #include "../cl_dll/wrect.h" #include "../cl_dll/cl_dll.h" #include "VGUI.h" #include "vgui_loadtga.h" #include "VGUI_InputStream.h" //#include "ui/MemoryInputStream.h" // : HACK // Implemented old MemoryInputStream to work around bugs(?) in the other implementation or in // the vgui's handling of the other one class MemoryInputStream2 : public vgui::InputStream { public: MemoryInputStream2() { m_pData = NULL; m_DataLen = m_ReadPos = 0; } virtual void seekStart(bool& success) {m_ReadPos=0; success=true;} virtual void seekRelative(int count,bool& success) {m_ReadPos+=count; success=true;} virtual void seekEnd(bool& success) {m_ReadPos=m_DataLen; success=true;} virtual int getAvailable(bool& success) {success=false; return 0;} // This is what vgui does for files... virtual uchar readUChar(bool& success) { if(m_ReadPos>=0 && m_ReadPos