| 490 | //========================================================================== |
| 491 | |
| 492 | SectionGeometryPlane* SectionGeometry::get(Section* section, int plane, const FVector2& offset, TArray<int>** pIndices) |
| 493 | { |
| 494 | if (!section || section->index >= data.Size()) return nullptr; |
| 495 | auto sectp = §or[section->sector]; |
| 496 | if (sectp->dirty) MarkDirty(sectp); |
| 497 | if (section->dirty & EDirty::GeometryDirty) |
| 498 | { |
| 499 | bool res = CreateMesh(section); |
| 500 | if (!res) |
| 501 | { |
| 502 | section->dirty &= ~EDirty::GeometryDirty; // sector is in an invalid state, so pretend the old setup is still valid. Happens in some SW maps. |
| 503 | } |
| 504 | } |
| 505 | if (!ValidateSection(section, plane)) |
| 506 | { |
| 507 | CreatePlaneMesh(section, plane, offset); |
| 508 | } |
| 509 | *pIndices = &data[section->index].meshIndices; |
| 510 | return &data[section->index].planes[plane]; |
| 511 | } |
no test coverage detected