Loads leaf brushes.
(lump_t l)
| 563 | |
| 564 | /** Loads leaf brushes. */ |
| 565 | public void CMod_LoadLeafBrushes(lump_t l) { |
| 566 | Com.DPrintf("CMod_LoadLeafBrushes()\n"); |
| 567 | |
| 568 | if ((l.filelen % 2) != 0) |
| 569 | Com.Error(Defines.ERR_DROP, "MOD_LoadBmodel: funny lump size"); |
| 570 | |
| 571 | int count = l.filelen / 2; |
| 572 | |
| 573 | Com.DPrintf(" numbrushes=" + count + "\n"); |
| 574 | |
| 575 | if (count < 1) |
| 576 | Com.Error(Defines.ERR_DROP, "Map with no planes"); |
| 577 | |
| 578 | // need to save space for box planes |
| 579 | if (count > Defines.MAX_MAP_LEAFBRUSHES) |
| 580 | Com.Error(Defines.ERR_DROP, "Map has too many leafbrushes"); |
| 581 | |
| 582 | int[] out = map_leafbrushes; |
| 583 | numleafbrushes = count; |
| 584 | |
| 585 | ByteBuffer bb = ByteBuffer.wrap(cmod_base, l.fileofs, count * 2).order( |
| 586 | ByteOrder.LITTLE_ENDIAN); |
| 587 | |
| 588 | if (debugloadmap) { |
| 589 | Com.DPrintf("map_brushes:\n"); |
| 590 | } |
| 591 | |
| 592 | for (int i = 0; i < count; i++) { |
| 593 | out[i] = bb.getShort(); |
| 594 | if (debugloadmap) { |
| 595 | Com.DPrintf("|%6i|%6i|\n", new Vargs().add(i).add(out[i])); |
| 596 | } |
| 597 | } |
| 598 | } |
| 599 | |
| 600 | /** Loads brush sides. */ |
| 601 | public void CMod_LoadBrushSides(lump_t l) { |
no test coverage detected