| 137 | VARP(igraphanimate, 0, 1, 1); |
| 138 | |
| 139 | void 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 |
| 159 | static void text_color(char c, char *stack, int size, int &sp, bvec color, int a) |