/xbmc/guilib/TextureBundleXPR.h

http://github.com/xbmc/xbmc · C Header · 68 lines · 34 code · 15 blank · 19 comment · 0 complexity · e419958212feb6bf2c286c30231e7f31 MD5 · raw file

  1. #pragma once
  2. /*
  3. * Copyright (C) 2005-2013 Team XBMC
  4. * http://xbmc.org
  5. *
  6. * This Program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License as published by
  8. * the Free Software Foundation; either version 2, or (at your option)
  9. * any later version.
  10. *
  11. * This Program is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  14. * GNU General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU General Public License
  17. * along with XBMC; see the file COPYING. If not, see
  18. * <http://www.gnu.org/licenses/>.
  19. *
  20. */
  21. #include "utils/StdString.h"
  22. #include <stdint.h>
  23. #include <map>
  24. class CAutoTexBuffer;
  25. class CBaseTexture;
  26. class CTextureBundleXPR
  27. {
  28. struct FileHeader_t
  29. {
  30. uint32_t Offset;
  31. uint32_t UnpackedSize;
  32. uint32_t PackedSize;
  33. };
  34. FILE* m_hFile;
  35. time_t m_TimeStamp;
  36. std::map<CStdString, FileHeader_t> m_FileHeaders;
  37. typedef std::map<CStdString, FileHeader_t>::iterator iFiles;
  38. bool m_themeBundle;
  39. bool OpenBundle();
  40. bool LoadFile(const CStdString& Filename, CAutoTexBuffer& UnpackedBuf);
  41. public:
  42. CTextureBundleXPR(void);
  43. ~CTextureBundleXPR(void);
  44. void Cleanup();
  45. void SetThemeBundle(bool themeBundle);
  46. bool HasFile(const CStdString& Filename);
  47. void GetTexturesFromPath(const CStdString &path, std::vector<CStdString> &textures);
  48. static CStdString Normalize(const CStdString &name);
  49. bool LoadTexture(const CStdString& Filename, CBaseTexture** ppTexture,
  50. int &width, int &height);
  51. int LoadAnim(const CStdString& Filename, CBaseTexture*** ppTextures,
  52. int &width, int &height, int& nLoops, int** ppDelays);
  53. };