MCPcopy Create free account
hub / github.com/Meridian59/Meridian59 / SplitLineDefsAndSector

Function SplitLineDefsAndSector

roomedit/source/objects.cpp:2318–2353  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2316*/
2317
2318void SplitLineDefsAndSector (SHORT linedef1, SHORT linedef2)
2319{
2320 SelPtr llist;
2321 SHORT s1, s2, s3, s4;
2322
2323 /* check if the two LineDefs are adjacent to the same Sector */
2324 // ObjectsNeeded( OBJ_LINEDEFS, 0);
2325 s1 = LineDefs[ linedef1].sidedef1;
2326 s2 = LineDefs[ linedef1].sidedef2;
2327 s3 = LineDefs[ linedef2].sidedef1;
2328 s4 = LineDefs[ linedef2].sidedef2;
2329 // ObjectsNeeded( OBJ_SIDEDEFS, 0);
2330 if (s1 >= 0)
2331 s1 = SideDefs[ s1].sector;
2332 if (s2 >= 0)
2333 s2 = SideDefs[ s2].sector;
2334 if (s3 >= 0)
2335 s3 = SideDefs[ s3].sector;
2336 if (s4 >= 0)
2337 s4 = SideDefs[ s4].sector;
2338 if ((s1 < 0 || (s1 != s3 && s1 != s4)) && (s2 < 0 || (s2 != s3 && s2 != s4)))
2339 {
2340 Beep();
2341 Notify("LineDefs #%d and #%d are not adjacent to the same Sector",
2342 linedef1, linedef2);
2343 return;
2344 }
2345 /* split the two LineDefs and create two new Vertices */
2346 llist = NULL;
2347 SelectObject( &llist, linedef1);
2348 SelectObject( &llist, linedef2);
2349 SplitLineDefs( llist);
2350 ForgetSelection( &llist);
2351 /* split the Sector and create a LineDef between the two Vertices */
2352 SplitSector( NumVertexes - 1, NumVertexes - 2);
2353}
2354
2355
2356

Callers 1

CmMiscLDSplitSectorMethod · 0.85

Calls 6

BeepFunction · 0.85
NotifyFunction · 0.85
SelectObjectFunction · 0.85
SplitLineDefsFunction · 0.85
ForgetSelectionFunction · 0.85
SplitSectorFunction · 0.85

Tested by

no test coverage detected