xbmc
TextureBundle.h
1 /*
2  * Copyright (C) 2005-2018 Team Kodi
3  * This file is part of Kodi - https://kodi.tv
4  *
5  * SPDX-License-Identifier: GPL-2.0-or-later
6  * See LICENSES/README.md for more information.
7  */
8 
9 #pragma once
10 
11 #include "TextureBundleXBT.h"
12 
13 #include <memory>
14 #include <string>
15 #include <utility>
16 #include <vector>
17 
18 class CTexture;
19 
21 {
22 public:
24  explicit CTextureBundle(bool useXBT);
25  ~CTextureBundle() = default;
26 
27  void SetThemeBundle(bool themeBundle);
28  bool HasFile(const std::string& Filename);
29  std::vector<std::string> GetTexturesFromPath(const std::string& path);
30  static std::string Normalize(std::string name);
31 
45  bool LoadTexture(const std::string& filename,
46  std::unique_ptr<CTexture>& texture,
47  int& width,
48  int& height);
49 
64  bool LoadAnim(const std::string& filename,
65  std::vector<std::pair<std::unique_ptr<CTexture>, int>>& textures,
66  int& width,
67  int& height,
68  int& nLoops);
69  void Close();
70 private:
71  CTextureBundleXBT m_tbXBT;
72 
73  bool m_useXBT;
74 };
75 
76 
Definition: TextureBundleXBT.h:22
bool LoadTexture(const std::string &filename, std::unique_ptr< CTexture > &texture, int &width, int &height)
Load texture from bundle.
Definition: TextureBundle.cpp:47
bool LoadAnim(const std::string &filename, std::vector< std::pair< std::unique_ptr< CTexture >, int >> &textures, int &width, int &height, int &nLoops)
Load animation from bundle.
Definition: TextureBundle.cpp:58
Base texture class, subclasses of which depend on the render spec (DX, GL etc.)
Definition: Texture.h:34
Definition: TextureBundle.h:20