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

Function drawexplosion

source/src/renderparticles.cpp:134–164  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

132}
133
134void drawexplosion(bool inside, float r, float g, float b, float a)
135{
136 if(mtexplosion && maxtmus>=2 && lastexpmodtex != expmodtex[inside ? 1 : 0])
137 {
138 glActiveTexture_(GL_TEXTURE1_ARB);
139 lastexpmodtex = expmodtex[inside ? 1 :0];
140 glBindTexture(GL_TEXTURE_2D, lastexpmodtex);
141 glActiveTexture_(GL_TEXTURE0_ARB);
142 }
143 loopi(!reflecting && inside ? 2 : 1)
144 {
145 glColor4f(r, g, b, i ? a/2 : a);
146 if(i)
147 {
148 glScalef(1, 1, -1);
149 glDepthFunc(GL_GEQUAL);
150 }
151 if(inside)
152 {
153 if(!reflecting)
154 {
155 glCullFace(GL_BACK);
156 glDrawElements(GL_TRIANGLES, heminumindices, GL_UNSIGNED_SHORT, hemiindices);
157 glCullFace(GL_FRONT);
158 }
159 glScalef(1, 1, -1);
160 }
161 glDrawElements(GL_TRIANGLES, heminumindices, GL_UNSIGNED_SHORT, hemiindices);
162 if(i) glDepthFunc(GL_LESS);
163 }
164}
165
166void cleanupexplosion()
167{

Callers 1

render_particlesFunction · 0.85

Calls 1

loopiFunction · 0.70

Tested by

no test coverage detected