DDNet documentation
Toggle main menu visibility
Loading...
Searching...
No Matches
countryflags.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_COUNTRYFLAGS_H
4
#define GAME_CLIENT_COMPONENTS_COUNTRYFLAGS_H
5
6
#include <
engine/graphics.h
>
7
#include <
engine/shared/protocol.h
>
8
9
#include <
game/client/component.h
>
10
11
#include <cstddef>
12
#include <vector>
13
14
class
CCountryFlags
:
public
CComponent
15
{
16
public
:
17
class
CCountryFlag
18
{
19
public
:
23
int
m_CountryCode
;
24
char
m_aCountryCodeString
[8];
25
IGraphics::CTextureHandle
m_Texture
;
26
27
bool
operator<
(
const
CCountryFlag
&Other)
const
;
28
};
29
30
int
Sizeof
()
const override
{
return
sizeof
(*this); }
31
void
OnInit
()
override
;
32
33
size_t
Num
()
const
;
34
const
CCountryFlag &
GetByCountryCode
(
int
CountryCode
)
const
;
35
const
CCountryFlag &
GetByIndex
(
size_t
Index)
const
;
36
void
Render
(
const
CCountryFlag &Flag,
ColorRGBA
Color,
float
x,
float
y,
float
w,
float
h);
37
void
Render
(
int
CountryCode
,
ColorRGBA
Color,
float
x,
float
y,
float
w,
float
h);
38
39
private
:
40
std::vector<CCountryFlag>
m_vCountryFlags
;
41
size_t
m_aCountryCodeToIndexTable
[
CountryCode::MAXIMUM
-
CountryCode::MINIMUM
+ 1];
42
43
int
m_FlagsQuadContainerIndex
;
44
45
static
bool
ValidateCountryCodeString
(
const
char
*pString);
46
void
LoadCountryflagsIndexfile
();
47
};
48
#endif
CComponent
Definition
component.h:165
CCountryFlags::CCountryFlag
Definition
countryflags.h:18
CCountryFlags::CCountryFlag::m_aCountryCodeString
char m_aCountryCodeString[8]
Definition
countryflags.h:24
CCountryFlags::CCountryFlag::m_CountryCode
int m_CountryCode
Definition
countryflags.h:23
CCountryFlags::CCountryFlag::m_Texture
IGraphics::CTextureHandle m_Texture
Definition
countryflags.h:25
CCountryFlags::CCountryFlag::operator<
bool operator<(const CCountryFlag &Other) const
Definition
countryflags.cpp:16
CCountryFlags
Definition
countryflags.h:15
CCountryFlags::Sizeof
int Sizeof() const override
Definition
countryflags.h:30
CCountryFlags::Render
void Render(const CCountryFlag &Flag, ColorRGBA Color, float x, float y, float w, float h)
Definition
countryflags.cpp:179
CCountryFlags::ValidateCountryCodeString
static bool ValidateCountryCodeString(const char *pString)
Definition
countryflags.cpp:21
CCountryFlags::GetByCountryCode
const CCountryFlag & GetByCountryCode(int CountryCode) const
Definition
countryflags.cpp:167
CCountryFlags::m_FlagsQuadContainerIndex
int m_FlagsQuadContainerIndex
Definition
countryflags.h:43
CCountryFlags::m_vCountryFlags
std::vector< CCountryFlag > m_vCountryFlags
Definition
countryflags.h:40
CCountryFlags::GetByIndex
const CCountryFlag & GetByIndex(size_t Index) const
Definition
countryflags.cpp:173
CCountryFlags::OnInit
void OnInit() override
Definition
countryflags.cpp:151
CCountryFlags::Num
size_t Num() const
Definition
countryflags.cpp:162
CCountryFlags::LoadCountryflagsIndexfile
void LoadCountryflagsIndexfile()
Definition
countryflags.cpp:44
CCountryFlags::m_aCountryCodeToIndexTable
size_t m_aCountryCodeToIndexTable[CountryCode::MAXIMUM - CountryCode::MINIMUM+1]
Definition
countryflags.h:41
ColorRGBA
Definition
color.h:183
IGraphics::CTextureHandle
Definition
graphics.h:261
component.h
graphics.h
CountryCode
Definition
protocol.h:174
CountryCode::MINIMUM
constexpr int MINIMUM
Definition
protocol.h:176
CountryCode::MAXIMUM
constexpr int MAXIMUM
Definition
protocol.h:177
protocol.h
src
game
client
components
countryflags.h
Generated by
1.18.0