| 344 | } |
| 345 | |
| 346 | S32 xDecalEmitter::select_texture_unit() |
| 347 | { |
| 348 | switch (this->cfg.texture.mode) |
| 349 | { |
| 350 | case TM_RANDOM: |
| 351 | return (xrand() / 8192) % this->texture.units; |
| 352 | case TM_CYCLE: |
| 353 | S32 id = this->texture.prev; |
| 354 | this->texture.prev = this->texture.prev + 1; |
| 355 | return id % this->texture.units; |
| 356 | case TM_DEFAULT: |
| 357 | default: |
| 358 | return 0; |
| 359 | } |
| 360 | } |