2015-08-27 14:28:25 +00:00
|
|
|
#ifndef GAME_CLIENT_COMPONENTS_BACKGROUND_H
|
|
|
|
#define GAME_CLIENT_COMPONENTS_BACKGROUND_H
|
|
|
|
#include <game/client/component.h>
|
2017-09-12 18:13:53 +00:00
|
|
|
#include <game/client/components/maplayers.h>
|
2015-08-27 14:28:25 +00:00
|
|
|
|
2016-05-02 19:35:32 +00:00
|
|
|
// Special value to use background of current map
|
2015-08-27 14:32:45 +00:00
|
|
|
#define CURRENT "%current%"
|
|
|
|
|
2017-09-12 18:13:53 +00:00
|
|
|
class CBackground : public CMapLayers
|
2015-08-27 14:28:25 +00:00
|
|
|
{
|
|
|
|
IEngineMap *m_pMap;
|
|
|
|
bool m_Loaded;
|
|
|
|
char m_aMapName[128];
|
|
|
|
|
|
|
|
//to avoid spam when in menu
|
|
|
|
int64 m_LastLoad;
|
|
|
|
|
|
|
|
//to avoid memory leak when switching to %current%
|
2017-02-21 16:10:08 +00:00
|
|
|
IEngineMap *m_pBackgroundMap;
|
2015-08-27 14:28:25 +00:00
|
|
|
CLayers *m_pBackgroundLayers;
|
|
|
|
CMapImages *m_pBackgroundImages;
|
|
|
|
|
|
|
|
public:
|
|
|
|
CBackground();
|
|
|
|
~CBackground();
|
|
|
|
|
|
|
|
virtual void OnInit();
|
|
|
|
virtual void OnMapLoad();
|
|
|
|
virtual void OnRender();
|
|
|
|
|
|
|
|
void LoadBackground();
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|