MCPcopy Create free account
hub / github.com/crossuo/crossuo / UpdateHitsTexture

Method UpdateHitsTexture

src/GameObjects/GameCharacter.cpp:144–170  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

142}
143
144void CGameCharacter::UpdateHitsTexture(uint8_t hits)
145{
146 if (HitsPercent != hits || m_HitsTexture.Empty())
147 {
148 HitsPercent = hits;
149
150 char hitsText[10] = { 0 };
151 sprintf_s(hitsText, "[%i%%]", hits);
152
153 uint16_t color = 0x0044;
154
155 if (hits < 30)
156 {
157 color = 0x0021;
158 }
159 else if (hits < 50)
160 {
161 color = 0x0030;
162 }
163 else if (hits < 80)
164 {
165 color = 0x0058;
166 }
167
168 g_FontManager.GenerateA(3, m_HitsTexture, hitsText, color);
169 }
170}
171
172int CGameCharacter::IsSitting()
173{

Callers 1

DrawGameWindowMethod · 0.80

Calls 2

GenerateAMethod · 0.80
EmptyMethod · 0.45

Tested by

no test coverage detected