void NodePalette::disconnectSignals() { // signals and slots disconnetions disconnect(editEditButton, SIGNAL(clicked()), this, SLOT(EndEdit())); disconnect(DeleteNode, SIGNAL(clicked()), this, SLOT(DelN())); disconnect(AddNode, SIGNAL(clicked()), this, SLOT(AddN())); disconnect(MoveNode, SIGNAL(clicked()), this, SLOT(MoveN())); disconnect(AsymMove, SIGNAL(clicked()), this, SLOT(SetAsym())); disconnect(SymMove, SIGNAL(clicked()), this, SLOT(SetSym())); disconnect(ResNode, SIGNAL(clicked()), this, SLOT(ResetControl())); disconnect(Res1Node, SIGNAL(clicked()), this, SLOT(Reset1Control())); disconnect(BezierClose, SIGNAL(clicked()), this, SLOT(CloseBezier())); disconnect(PolySplit, SIGNAL(clicked()), this, SLOT(SplitPoly())); disconnect(MoveControl, SIGNAL(clicked()), this, SLOT(MoveK())); disconnect(XSpin, SIGNAL(valueChanged(double)), this, SLOT(MovePoint())); disconnect(YSpin, SIGNAL(valueChanged(double)), this, SLOT(MovePoint())); disconnect(PolyMirrorH, SIGNAL(clicked()), this, SLOT(MirrorH())); disconnect(PolyMirrorV, SIGNAL(clicked()), this, SLOT(MirrorV())); disconnect(PolyShearR, SIGNAL(clicked()), this, SLOT(ShearR())); disconnect(PolyShearL, SIGNAL(clicked()), this, SLOT(ShearL())); disconnect(PolyShearU, SIGNAL(clicked()), this, SLOT(ShearU())); disconnect(PolyShearD, SIGNAL(clicked()), this, SLOT(ShearD())); disconnect(RotateCCW, SIGNAL(clicked()), this, SLOT(doRotCCW())); disconnect(RotateCW, SIGNAL(clicked()), this, SLOT(doRotCW())); disconnect(Shrink, SIGNAL(clicked()), this, SLOT(doShrink())); disconnect(Expand, SIGNAL(clicked()), this, SLOT(doExpand())); disconnect(Reduce, SIGNAL(clicked()), this, SLOT(doReduce())); disconnect(Enlarge, SIGNAL(clicked()), this, SLOT(doEnlarge())); disconnect(ResetCont, SIGNAL(clicked()), this, SLOT(ResetContour())); disconnect(ResetContClip, SIGNAL(clicked()), this, SLOT(ResetContourToImageClip())); disconnect(ResetShape2Clip, SIGNAL(clicked()), this, SLOT(ResetShapeToImageClip())); }
Poly *Poly::ClipToList ( Poly *pPoly_, bool bClipOnPlane_ ) { switch ( ClassifyPoly ( pPoly_ ) ) { case eCP::FRONT: { return pPoly_->CopyPoly ( ); } break; case eCP::BACK: { if ( IsLast ( ) ) { return NULL; } return m_pNext->ClipToList ( pPoly_, bClipOnPlane_ ); } break; case eCP::ONPLANE: { double Angle = plane.n.Dot ( pPoly_->plane.n ) - 1; if ( ( Angle < epsilon ) && ( Angle > -epsilon ) ) { if ( !bClipOnPlane_ ) { return pPoly_->CopyPoly ( ); } } if ( IsLast ( ) ) { return NULL; } return m_pNext->ClipToList ( pPoly_, bClipOnPlane_ ); } break; case eCP::SPLIT: { Poly *pFront = NULL; Poly *pBack = NULL; SplitPoly ( pPoly_, &pFront, &pBack ); if ( IsLast ( ) ) { delete pBack; return pFront; } Poly *pBackFrags = m_pNext->ClipToList ( pBack, bClipOnPlane_ ); if ( pBackFrags == NULL ) { delete pBack; return pFront; } if ( *pBackFrags == *pBack ) { delete pFront; delete pBack; delete pBackFrags; return pPoly_->CopyPoly ( ); } delete pBack; pFront->AddPoly ( pBackFrags ); return pFront; } break; } return NULL; }
// poly : the convex polygon that encloses all child subsectors static void WalkBSPNode(INT32 bspnum, poly_t *poly, UINT16 *leafnode, fixed_t *bbox) { node_t *bsp; poly_t *backpoly, *frontpoly; fdivline_t fdivline; polyvertex_t *pt; INT32 i; // Found a subsector? if (bspnum & NF_SUBSECTOR) { if (bspnum == -1) { // BP: i think this code is useless and wrong because // - bspnum==-1 happens only when numsubsectors == 0 // - it can't happens in bsp recursive call since bspnum is a INT32 and children is UINT16 // - the BSP is complet !! (there just can have subsector without segs) (i am not sure of this point) // do we have a valid polygon ? if (poly && poly->numpts > 2) { DEBPRINT("Adding a new subsector\n"); if (addsubsector == numsubsectors + NEWSUBSECTORS) I_Error("WalkBSPNode: not enough addsubsectors\n"); else if (addsubsector > 0x7fff) I_Error("WalkBSPNode: addsubsector > 0x7fff\n"); *leafnode = (UINT16)((UINT16)addsubsector | NF_SUBSECTOR); extrasubsectors[addsubsector].planepoly = poly; addsubsector++; } //add subsectors without segs here? //HWR_SubsecPoly(0, NULL); } else { HWR_SubsecPoly(bspnum&(~NF_SUBSECTOR), poly); //Hurdler: implement a loading status if (ls_count-- <= 0) { char s[16]; int x, y; I_OsPolling(); ls_count = numsubsectors/50; CON_Drawer(); sprintf(s, "%d%%", (++ls_percent)<<1); x = BASEVIDWIDTH/2; y = BASEVIDHEIGHT/2; V_DrawFill(0, 0, vid.width, vid.height, 31); // Black background to match fade in effect //V_DrawPatchFill(W_CachePatchName("SRB2BACK",PU_CACHE)); // SRB2 background, ehhh too bright. M_DrawTextBox(x-58, y-8, 13, 1); V_DrawString(x-50, y, V_YELLOWMAP, "Loading..."); V_DrawString(x+50-V_StringWidth(s), y, V_YELLOWMAP, s); // Is this really necessary at this point..? V_DrawCenteredString(BASEVIDWIDTH/2, 40, V_YELLOWMAP, "OPENGL MODE IS INCOMPLETE AND MAY"); V_DrawCenteredString(BASEVIDWIDTH/2, 50, V_YELLOWMAP, "NOT DISPLAY SOME SURFACES."); V_DrawCenteredString(BASEVIDWIDTH/2, 70, V_YELLOWMAP, "USE AT SONIC'S RISK."); I_UpdateNoVsync(); } } M_ClearBox(bbox); poly = extrasubsectors[bspnum&~NF_SUBSECTOR].planepoly; for (i = 0, pt = poly->pts; i < poly->numpts; i++,pt++) M_AddToBox(bbox, FLOAT_TO_FIXED(pt->x), FLOAT_TO_FIXED(pt->y)); return; } bsp = &nodes[bspnum]; SearchDivline(bsp, &fdivline); SplitPoly(&fdivline, poly, &frontpoly, &backpoly); poly = NULL; //debug if (!backpoly) nobackpoly++; // Recursively divide front space. if (frontpoly) { WalkBSPNode(bsp->children[0], frontpoly, &bsp->children[0],bsp->bbox[0]); // copy child bbox M_Memcpy(bbox, bsp->bbox[0], 4*sizeof (fixed_t)); } else I_Error("WalkBSPNode: no front poly?"); // Recursively divide back space. if (backpoly) { // Correct back bbox to include floor/ceiling convex polygon WalkBSPNode(bsp->children[1], backpoly, &bsp->children[1], bsp->bbox[1]); // enlarge bbox with seconde child M_AddToBox(bbox, bsp->bbox[1][BOXLEFT ], bsp->bbox[1][BOXTOP ]); M_AddToBox(bbox, bsp->bbox[1][BOXRIGHT ], bsp->bbox[1][BOXBOTTOM]); } }