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

Method render

source/src/menus.cpp:274–309  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

272 return mitemmanual::width();
273 }
274 virtual void render(int x, int y, int w)
275 {
276 mitem::render(x, y, w);
277 if(image || altfont)
278 {
279 int xs = 0, c = greyedout ? 128 : 255;
280 if(image)
281 {
282 xs = (FONTH*image->xs)/image->ys;
283 framedquadtexture(image->id, x, y, xs, FONTH, 0, 255, true);
284 }
285 draw_text(text, !image || *text == '\t' ? x : x+xs + FONTH/2, y, c, c, c);
286 if(altfont && strchr(text, '\a'))
287 {
288 char *r = newstring(text), *re, *l = r;
289 while((re = strchr(l, '\a')) && re[1])
290 {
291 *re = '\0';
292 x += text_width(l);
293 l = re + 2;
294 pushfont(altfont->name);
295 draw_textf("%s%c", x, y, greyedout ? "\f4" : "", re[1]);
296 popfont();
297 }
298 delete[] r;
299 }
300 if(image && isselection() && !hidebigmenuimages && image->ys > FONTH)
301 {
302 w += FONTH;
303 int xs = (2 * VIRTW - w) / 5, ys = (xs * image->ys) / image->xs;
304 x = (6 * VIRTW + w - 2 * xs) / 4; y = VIRTH - ys / 2;
305 framedquadtexture(image->id, x, y, xs, ys, FONTH);
306 }
307 }
308 else mitemmanual::render(x, y, w);
309 }
310};
311
312struct mitemimage : mitemimagemanual

Callers

nothing calls this directly

Calls 7

framedquadtextureFunction · 0.85
draw_textFunction · 0.85
newstringFunction · 0.85
text_widthFunction · 0.85
pushfontFunction · 0.85
draw_textfFunction · 0.85
popfontFunction · 0.85

Tested by

no test coverage detected