DDraceNetwork Docs
background.h
Go to the documentation of this file.
1#ifndef GAME_CLIENT_COMPONENTS_BACKGROUND_H
2#define GAME_CLIENT_COMPONENTS_BACKGROUND_H
3
4#include <engine/shared/map.h>
5
7
8#include <cstdint>
9
10class CLayers;
11class CMapImages;
12
13// Special value to use background of current map
14#define CURRENT_MAP "%current%"
15
17{
18 MACRO_INTERFACE("background_enginemap")
19};
20
21class CBackground : public CMapLayers
22{
23protected:
27
28 //to avoid memory leak when switching to %current%
32
34
35 const char *LoadingTitle() const override;
36
37public:
38 CBackground(int MapType = CMapLayers::TYPE_BACKGROUND_FORCE, bool OnlineOnly = true);
39 virtual ~CBackground();
40 virtual int Sizeof() const override { return sizeof(*this); }
41
42 virtual void OnInit() override;
43 virtual void OnMapLoad() override;
44 virtual void OnRender() override;
45
46 void LoadBackground();
47 const char *MapName() const { return m_aMapName; }
48};
49
50#endif
Definition: background.h:17
Definition: background.h:22
CBackgroundEngineMap * m_pBackgroundMap
Definition: background.h:29
CLayers * m_pBackgroundLayers
Definition: background.h:30
virtual int Sizeof() const override
Definition: background.h:40
bool m_Loaded
Definition: background.h:25
CMapImages * m_pBackgroundImages
Definition: background.h:31
virtual ~CBackground()
Definition: background.cpp:26
const char * LoadingTitle() const override
Definition: background.cpp:37
virtual void OnRender() override
Definition: background.cpp:106
void LoadBackground()
Definition: background.cpp:53
IEngineMap * m_pMap
Definition: background.h:24
virtual void OnMapLoad() override
Definition: background.cpp:98
virtual CBackgroundEngineMap * CreateBGMap()
Definition: background.cpp:32
char m_aMapName[MAX_MAP_LENGTH]
Definition: background.h:26
const char * MapName() const
Definition: background.h:47
virtual void OnInit() override
Definition: background.cpp:42
Definition: layers.h:13
Definition: mapimages.h:36
Definition: maplayers.h:27
@ TYPE_BACKGROUND_FORCE
Definition: maplayers.h:137
friend class CBackground
Definition: maplayers.h:28
Definition: map.h:12
Definition: map.h:35
#define MACRO_INTERFACE(Name)
Definition: kernel.h:25
@ MAX_MAP_LENGTH
Definition: map.h:12