DDraceNetwork Docs
mapimages.h
Go to the documentation of this file.
1/* (c) Magnus Auvinen. See licence.txt in the root of the distribution for more information. */
2/* If you are missing that file, acquire a complete release at teeworlds.com. */
3#ifndef GAME_CLIENT_COMPONENTS_MAPIMAGES_H
4#define GAME_CLIENT_COMPONENTS_MAPIMAGES_H
5
6#include <engine/console.h>
7#include <engine/graphics.h>
8
10#include <game/mapitems.h>
11
13{
16
18};
19
21{
29
31};
32
33extern const char *const gs_apModEntitiesNames[];
34
35class CMapImages : public CComponent
36{
37 friend class CBackground;
38 friend class CMenuBackground;
39
42
44
45public:
46 CMapImages();
47 virtual int Sizeof() const override { return sizeof(*this); }
48
49 IGraphics::CTextureHandle Get(int Index) const { return m_aTextures[Index]; }
50 int Num() const { return m_Count; }
51
52 void OnMapLoadImpl(class CLayers *pLayers, class IMap *pMap);
53 virtual void OnMapLoad() override;
54 virtual void OnInit() override;
55 void LoadBackground(class CLayers *pLayers, class IMap *pMap);
56
57 // DDRace
60
64
65 void SetTextureScale(int Scale);
66 int GetTextureScale() const;
67
68 void ChangeEntitiesPath(const char *pPath);
69
70private:
79
80 static void ConchainClTextEntitiesSize(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData);
82 IGraphics::CTextureHandle UploadEntityLayerText(int TextureSize, int MaxWidth, int YOffset);
83 void UpdateEntityLayerText(CImageInfo &TextImage, int TextureSize, int MaxWidth, int YOffset, int NumbersPower, int MaxNumber = -1);
84};
85
86#endif
Definition: background.h:22
Definition: component.h:20
Definition: image.h:12
Definition: layers.h:13
Definition: mapimages.h:36
char m_aEntitiesPath[IO_MAX_PATH_LENGTH]
Definition: mapimages.h:43
IGraphics::CTextureHandle UploadEntityLayerText(int TextureSize, int MaxWidth, int YOffset)
Definition: mapimages.cpp:414
void ChangeEntitiesPath(const char *pPath)
Definition: mapimages.cpp:359
virtual int Sizeof() const override
Definition: mapimages.h:47
int m_Count
Definition: mapimages.h:41
virtual void OnInit() override
Definition: mapimages.cpp:39
IGraphics::CTextureHandle Get(int Index) const
Definition: mapimages.h:49
IGraphics::CTextureHandle m_SpeedupArrowTexture
Definition: mapimages.h:74
static void ConchainClTextEntitiesSize(IConsole::IResult *pResult, void *pUserData, IConsole::FCommandCallback pfnCallback, void *pCallbackUserData)
Definition: mapimages.cpp:381
IGraphics::CTextureHandle m_aTextures[MAX_MAPIMAGES]
Definition: mapimages.h:40
int GetTextureScale() const
Definition: mapimages.cpp:409
void InitOverlayTextures()
Definition: mapimages.cpp:461
void OnMapLoadImpl(class CLayers *pLayers, class IMap *pMap)
Definition: mapimages.cpp:54
int Num() const
Definition: mapimages.h:50
IGraphics::CTextureHandle m_aaEntitiesTextures[MAP_IMAGE_MOD_TYPE_COUNT *2][MAP_IMAGE_ENTITY_LAYER_TYPE_COUNT]
Definition: mapimages.h:73
bool m_aEntitiesIsLoaded[MAP_IMAGE_MOD_TYPE_COUNT *2]
Definition: mapimages.h:71
virtual void OnMapLoad() override
Definition: mapimages.cpp:182
IGraphics::CTextureHandle m_OverlayBottomTexture
Definition: mapimages.h:75
IGraphics::CTextureHandle m_OverlayTopTexture
Definition: mapimages.h:76
IGraphics::CTextureHandle GetOverlayBottom()
Definition: mapimages.cpp:344
IGraphics::CTextureHandle GetOverlayCenter()
Definition: mapimages.cpp:354
bool m_SpeedupArrowIsLoaded
Definition: mapimages.h:72
void UpdateEntityLayerText(CImageInfo &TextImage, int TextureSize, int MaxWidth, int YOffset, int NumbersPower, int MaxNumber=-1)
Definition: mapimages.cpp:430
int m_TextureScale
Definition: mapimages.h:78
IGraphics::CTextureHandle GetOverlayTop()
Definition: mapimages.cpp:349
IGraphics::CTextureHandle GetSpeedupArrow()
Definition: mapimages.cpp:333
IGraphics::CTextureHandle m_OverlayCenterTexture
Definition: mapimages.h:77
CMapImages()
Definition: mapimages.cpp:28
IGraphics::CTextureHandle GetEntities(EMapImageEntityLayerType EntityLayerType)
Definition: mapimages.cpp:256
void LoadBackground(class CLayers *pLayers, class IMap *pMap)
Definition: mapimages.cpp:189
void SetTextureScale(int Scale)
Definition: mapimages.cpp:391
Definition: menu_background.h:33
Definition: console.h:45
void(* FCommandCallback)(IResult *pResult, void *pUserData)
Definition: console.h:92
Definition: graphics.h:200
Definition: map.h:16
const char *const gs_apModEntitiesNames[]
Definition: mapimages.cpp:18
EMapImageModType
Definition: mapimages.h:21
@ MAP_IMAGE_MOD_TYPE_DDNET
Definition: mapimages.h:22
@ MAP_IMAGE_MOD_TYPE_VANILLA
Definition: mapimages.h:27
@ MAP_IMAGE_MOD_TYPE_DDRACE
Definition: mapimages.h:23
@ MAP_IMAGE_MOD_TYPE_FDDRACE
Definition: mapimages.h:28
@ MAP_IMAGE_MOD_TYPE_COUNT
Definition: mapimages.h:30
@ MAP_IMAGE_MOD_TYPE_BLOCKWORLDS
Definition: mapimages.h:25
@ MAP_IMAGE_MOD_TYPE_RACE
Definition: mapimages.h:24
@ MAP_IMAGE_MOD_TYPE_FNG
Definition: mapimages.h:26
EMapImageEntityLayerType
Definition: mapimages.h:13
@ MAP_IMAGE_ENTITY_LAYER_TYPE_SWITCH
Definition: mapimages.h:15
@ MAP_IMAGE_ENTITY_LAYER_TYPE_ALL_EXCEPT_SWITCH
Definition: mapimages.h:14
@ MAP_IMAGE_ENTITY_LAYER_TYPE_COUNT
Definition: mapimages.h:17
static constexpr size_t MAX_MAPIMAGES
Definition: mapitems.h:216
@ IO_MAX_PATH_LENGTH
Definition: types.h:43