MCPcopy Create free account
hub / github.com/assaultcube/AC / render_igraphs

Function render_igraphs

source/src/rendertext.cpp:139–156  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

137VARP(igraphanimate, 0, 1, 1);
138
139void render_igraphs()
140{
141 igraphbatch.sort(cmpintasc);
142 int last = 0, w[2] = { (FONTH * igraphsize) / 100, (FONTH * igraphsizehardcoded) / 100 }, offs[2] = { (FONTH - w[0]) / 2, (FONTH - w[1]) / 2 }, ishc = 0;
143 igraph *ig = NULL;
144 glColor4ub(255, 255, 255, 255);
145 loopv(igraphbatch)
146 {
147 if(last != igraphbatch[i].key) ig = getusedigraph((last = igraphbatch[i].key)), ishc = last > 0 && last < 10 ? 1 : 0;
148 if(ig && ig->tex)
149 {
150 int &x = igraphbatch[i].val1, &y = igraphbatch[i].val2, fpos = ((totalmillis + x * x + VIRTW * y) % ig->frames.last() + ig->frames.last()) % ig->frames.last(), frame = 0;
151 float fw = min(1.0f, float(ig->tex->ys) / ig->tex->xs);
152 if(igraphanimate) loopvj(ig->frames) if(ig->frames[j] < fpos) frame++;
153 quad(ig->tex->id, x + offs[ishc], y + offs[ishc], w[ishc], (frame % max(1, ig->tex->xs / ig->tex->ys)) * fw, 0, fw, 1);
154 }
155 }
156}
157
158//stack[sp] is current color index
159static void text_color(char c, char *stack, int size, int &sp, bvec color, int a)

Callers 1

draw_textFunction · 0.85

Calls 1

sortMethod · 0.80

Tested by

no test coverage detected