Loads brush sides.
(lump_t l)
| 599 | |
| 600 | /** Loads brush sides. */ |
| 601 | public void CMod_LoadBrushSides(lump_t l) { |
| 602 | Com.DPrintf("CMod_LoadBrushSides()\n"); |
| 603 | int i, j; |
| 604 | cbrushside_t out; |
| 605 | qfiles.dbrushside_t in; |
| 606 | int count; |
| 607 | int num; |
| 608 | |
| 609 | if ((l.filelen % qfiles.dbrushside_t.SIZE) != 0) |
| 610 | Com.Error(Defines.ERR_DROP, "MOD_LoadBmodel: funny lump size"); |
| 611 | count = l.filelen / qfiles.dbrushside_t.SIZE; |
| 612 | |
| 613 | // need to save space for box planes |
| 614 | if (count > Defines.MAX_MAP_BRUSHSIDES) |
| 615 | Com.Error(Defines.ERR_DROP, "Map has too many planes"); |
| 616 | |
| 617 | numbrushsides = count; |
| 618 | |
| 619 | Com.DPrintf(" numbrushsides=" + count + "\n"); |
| 620 | |
| 621 | if (debugloadmap) { |
| 622 | Com.DPrintf("brushside(planenum, surfacenum):\n"); |
| 623 | } |
| 624 | for (i = 0; i < count; i++) { |
| 625 | |
| 626 | in = new qfiles.dbrushside_t(ByteBuffer.wrap(cmod_base, i |
| 627 | * qfiles.dbrushside_t.SIZE + l.fileofs, |
| 628 | qfiles.dbrushside_t.SIZE)); |
| 629 | |
| 630 | out = map_brushsides[i]; |
| 631 | |
| 632 | num = in.planenum; |
| 633 | |
| 634 | out.plane = map_planes[num]; // pointer |
| 635 | |
| 636 | j = in.texinfo; |
| 637 | |
| 638 | if (j >= numtexinfo) |
| 639 | Com.Error(Defines.ERR_DROP, "Bad brushside texinfo"); |
| 640 | |
| 641 | // java specific handling of -1 |
| 642 | if (j == -1) |
| 643 | out.surface = new mapsurface_t(); // just for safety |
| 644 | else |
| 645 | out.surface = map_surfaces[j]; |
| 646 | |
| 647 | if (debugloadmap) { |
| 648 | Com.DPrintf("| %6i| %6i|\n", new Vargs().add(num).add(j)); |
| 649 | } |
| 650 | } |
| 651 | } |
| 652 | |
| 653 | /** Loads areas. */ |
| 654 | public void CMod_LoadAreas(lump_t l) { |
no test coverage detected