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
35public:
36 CBackground(int MapType = CMapLayers::TYPE_BACKGROUND_FORCE, bool OnlineOnly = true);
37 virtual ~CBackground();
38 virtual int Sizeof() const override { return sizeof(*this); }
39
40 virtual void OnInit() override;
41 virtual void OnMapLoad() override;
42 virtual void OnRender() override;
43
44 void LoadBackground();
45 const char *MapName() const { return m_aMapName; }
46};
47
48#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:38
bool m_Loaded
Definition: background.h:25
CMapImages * m_pBackgroundImages
Definition: background.h:31
virtual ~CBackground()
Definition: background.cpp:25
virtual void OnRender() override
Definition: background.cpp:100
void LoadBackground()
Definition: background.cpp:47
IEngineMap * m_pMap
Definition: background.h:24
virtual void OnMapLoad() override
Definition: background.cpp:92
virtual CBackgroundEngineMap * CreateBGMap()
Definition: background.cpp:31
char m_aMapName[MAX_MAP_LENGTH]
Definition: background.h:26
const char * MapName() const
Definition: background.h:45
virtual void OnInit() override
Definition: background.cpp:36
Definition: layers.h:13
Definition: mapimages.h:36
Definition: maplayers.h:27
@ TYPE_BACKGROUND_FORCE
Definition: maplayers.h:139
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