1#ifndef GAME_CLIENT_COMPONENTS_BACKGROUND_H
2#define GAME_CLIENT_COMPONENTS_BACKGROUND_H
3
4#include <engine/map.h>
5
6#include <game/client/components/maplayers.h>
7
8#include <cstdint>
9#include <memory>
10
11class CLayers;
12class CMapImages;
13
14// Special value to use background of current map
15#define CURRENT_MAP "%current%"
16
17class CBackground : public CMapLayers
18{
19protected:
20 IMap *m_pMap;
21 bool m_Loaded;
22 char m_aMapName[MAX_MAP_LENGTH];
23
24 std::unique_ptr<IMap> m_pBackgroundMap;
25 CLayers *m_pBackgroundLayers;
26 CMapImages *m_pBackgroundImages;
27
28public:
29 CBackground(ERenderType MapType = ERenderType::RENDERTYPE_BACKGROUND_FORCE, bool OnlineOnly = true);
30 ~CBackground() override;
31 int Sizeof() const override { return sizeof(*this); }
32
33 void OnInit() override;
34 void OnMapLoad() override;
35 void OnRender() override;
36
37 void LoadBackground();
38 const char *MapName() const { return m_aMapName; }
39};
40
41#endif
42