| 74 | } |
| 75 | |
| 76 | void 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 |
no test coverage detected