PageRenderTime 22ms CodeModel.GetById 11ms app.highlight 7ms RepoModel.GetById 1ms app.codeStats 1ms

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