MCPcopy Create free account
hub / github.com/ClassiCube/ClassiCube / HUDScreen_BuildPosition

Function HUDScreen_BuildPosition

src/Screens.c:128–157  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

126}
127
128static void HUDScreen_BuildPosition(struct HUDScreen* s, struct VertexTextured* data) {
129 struct VertexTextured* cur = data;
130 struct TextAtlas* atlas = &s->posAtlas;
131 struct Texture tex;
132 IVec3 pos;
133
134 /* Make "Position: " prefix */
135 tex = atlas->tex;
136 tex.x = 2 + DisplayInfo.ContentOffsetX;
137 tex.width = atlas->offset;
138 Gfx_Make2DQuad(&tex, PACKEDCOL_WHITE, &cur);
139
140 IVec3_Floor(&pos, &Entities.CurPlayer->Base.Position);
141 atlas->curX = tex.x + tex.width;
142
143 /* Make (X, Y, Z) suffix */
144 TextAtlas_Add(atlas, 13, &cur);
145 TextAtlas_AddInt(atlas, pos.x, &cur);
146 TextAtlas_Add(atlas, 11, &cur);
147 TextAtlas_AddInt(atlas, pos.y, &cur);
148 TextAtlas_Add(atlas, 11, &cur);
149 TextAtlas_AddInt(atlas, pos.z, &cur);
150 TextAtlas_Add(atlas, 14, &cur);
151
152 s->lastX = pos.x;
153 s->lastY = pos.y;
154 s->lastZ = pos.z;
155
156 s->posCount = (int)(cur - data);
157}
158
159static cc_bool HUDScreen_HasHacksChanged(struct HUDScreen* s) {
160 struct HacksComp* hacks = &Entities.CurPlayer->Hacks;

Callers 1

HUDScreen_BuildMeshFunction · 0.85

Calls 4

Gfx_Make2DQuadFunction · 0.85
IVec3_FloorFunction · 0.85
TextAtlas_AddFunction · 0.85
TextAtlas_AddIntFunction · 0.85

Tested by

no test coverage detected