| 280 | VARP(bloodttl, 0, 10000, 30000); |
| 281 | |
| 282 | void render_particles(int time, int typemask) |
| 283 | { |
| 284 | bool rendered = false; |
| 285 | for(int i = MAXPARTYPES-1; i>=0; i--) if(typemask&(1<<parttypes[i].type) && parlist[i]) |
| 286 | { |
| 287 | if(!rendered) |
| 288 | { |
| 289 | rendered = true; |
| 290 | glDepthMask(GL_FALSE); |
| 291 | glEnable(GL_BLEND); |
| 292 | glDisable(GL_FOG); |
| 293 | } |
| 294 | |
| 295 | parttype &pt = parttypes[i]; |
| 296 | float sz = pt.sz*particlesize/100.0f; |
| 297 | |
| 298 | if(pt.tex>=0) glBindTexture(GL_TEXTURE_2D, parttex[pt.tex]->id); |
| 299 | else glDisable(GL_TEXTURE_2D); |
| 300 | switch(pt.type) |
| 301 | { |
| 302 | case PT_HUDFLASH: |
| 303 | sethudgunperspective(true); |
| 304 | // fall through |
| 305 | case PT_FLASH: |
| 306 | glBlendFunc(GL_ONE, GL_ONE_MINUS_SRC_COLOR); |
| 307 | glColor3f(pt.r, pt.g, pt.b); |
| 308 | glBegin(GL_QUADS); |
| 309 | break; |
| 310 | |
| 311 | case PT_PART: |
| 312 | glBlendFunc(GL_SRC_ALPHA, GL_ONE); |
| 313 | glColor3f(pt.r, pt.g, pt.b); |
| 314 | glBegin(GL_QUADS); |
| 315 | break; |
| 316 | |
| 317 | case PT_FIREBALL: |
| 318 | setupexplosion(); |
| 319 | glBlendFunc(GL_SRC_ALPHA, GL_ONE); |
| 320 | break; |
| 321 | |
| 322 | case PT_SHOTLINE: |
| 323 | glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); |
| 324 | glColor4f(pt.r, pt.g, pt.b, 0.5f); |
| 325 | glBegin(GL_LINES); |
| 326 | break; |
| 327 | |
| 328 | case PT_DECAL: |
| 329 | glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); |
| 330 | glBegin(GL_QUADS); |
| 331 | break; |
| 332 | |
| 333 | case PT_BULLETHOLE: |
| 334 | glBlendFunc(GL_DST_COLOR, GL_ONE_MINUS_SRC_ALPHA); |
| 335 | glBegin(GL_QUADS); |
| 336 | break; |
| 337 | |
| 338 | case PT_BLOOD: |
| 339 | glBlendFunc(GL_ZERO, GL_ONE_MINUS_SRC_COLOR); |
no test coverage detected