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

Function addstrip

source/src/rendercubes.cpp:76–102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

74}
75
76void addstrip(int type, int tex, int start, int n)
77{
78 stripbatch *sb = NULL;
79 if(tex==DEFAULT_SKY)
80 {
81 if(minimap) return;
82 sb = &skystrips;
83 loopi(n) skyfloor = min(skyfloor, verts[start + i].z);
84 }
85 else
86 {
87 sb = &stripbatches[renderedtex[tex]];
88 if(sb->tex!=tex || sb>=&stripbatches[renderedtexs])
89 {
90 sb = &stripbatches[renderedtex[tex] = renderedtexs++];
91 sb->tex = tex;
92 }
93 }
94 strips &s = (type==GL_QUADS ? sb->quads : (type==GL_TRIANGLES ? sb->tris : sb->tristrips));
95 if(type!=GL_TRIANGLE_STRIP && s.first.length() && s.first.last()+s.count.last() == start)
96 {
97 s.count.last() += n;
98 return;
99 }
100 s.first.add(start);
101 s.count.add(n);
102}
103
104// generating the actual vertices is done dynamically every frame and sits at the
105// leaves of all these functions, and are part of the cpu bottleneck on really slow

Callers 2

render_2trisFunction · 0.85
rendershadow_triFunction · 0.85

Calls 4

minFunction · 0.85
loopiFunction · 0.70
lengthMethod · 0.45
addMethod · 0.45

Tested by

no test coverage detected