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

Function render_2tris

source/src/rendercubes.cpp:302–323  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

300}
301
302void render_2tris(sqr *h, sqr *s, int x1, int y1, int x2, int y2, int x3, int y3, sqr *l1, sqr *l2, sqr *l3) // floor/ceil tris on a corner cube
303{
304 stripend(verts);
305
306 Texture *t = lookupworldtexture(h->ftex);
307 float xf = TEXTURESCALE/t->xs;
308 float yf = TEXTURESCALE/t->ys;
309 vert(x1, y1, h->floor, l1, xf*x1, yf*y1);
310 vert(x2, y2, h->floor, l2, xf*x2, yf*y2);
311 vert(x3, y3, h->floor, l3, xf*x3, yf*y3);
312 addstrip(mergestrips ? GL_TRIANGLES : GL_TRIANGLE_STRIP, h->ftex, verts.length()-3, 3);
313
314 t = lookupworldtexture(h->ctex);
315 xf = TEXTURESCALE/t->xs;
316 yf = TEXTURESCALE/t->ys;
317
318 vert(x3, y3, h->ceil, l3, xf*x3, yf*y3);
319 vert(x2, y2, h->ceil, l2, xf*x2, yf*y2);
320 vert(x1, y1, h->ceil, l1, xf*x1, yf*y1);
321 addstrip(mergestrips ? GL_TRIANGLES : GL_TRIANGLE_STRIP, h->ctex, verts.length()-3, 3);
322 nquads++;
323}
324
325void render_tris(int x, int y, int size, bool topleft,
326 sqr *h1, sqr *h2, sqr *s, sqr *t, sqr *u, sqr *v)

Callers 1

render_trisFunction · 0.85

Calls 3

lookupworldtextureFunction · 0.85
addstripFunction · 0.85
lengthMethod · 0.45

Tested by

no test coverage detected