Changed: #1246 Build on PPC machines (patch provided by Jeru)

hg/feature/sound
kervala 14 years ago
parent fa63539729
commit fc1deec2e8

@ -50,50 +50,10 @@ extern ULandscape *Landscape;
namespace R2 namespace R2
{ {
// create a special selectable polygon
class CCtrlPolygonSelectable : public CCtrlPolygon, public IDisplayerUIHandle
// *********************************************************************************************************
CDisplayerVisualGroup::CDisplayerVisualGroup()
{ {
_ArrayName = "Components"; public:
_DrawnThisFrame = false;
_TimeOver = 0;
_CurrPrimValid = true;
touch();
_Active = false;
_CurrPrimInaccessible = false;
_ContextualVisibilityActive = false;
_ContextualVisibilityDate = -1;
_VisibleLastFrame = false;
}
// *********************************************************************************************************
void CDisplayerVisualGroup::touch()
{
//H_AUTO(R2_CDisplayerVisualGroup_touch)
_PrimTouched = true;
_InstanceListTouched = true;
_AccessibilityTouched = true;
}
// *********************************************************************************************************
void CDisplayerVisualGroup::setDisplayedInstance(CInstance *instance)
{
//H_AUTO(R2_CDisplayerVisualGroup_setDisplayedInstance)
CDisplayerVisual::setDisplayedInstance(instance);
_Prim.DisplayedInstance = instance;
}
// *********************************************************************************************************
CCtrlPolygon *CDisplayerVisualGroup::CSelectablePrimRender::newCtrlPolygon() const
{
//H_AUTO(R2_CDisplayerVisualGroup_CSelectablePrimRender)
nlassert(DisplayedInstance);
// create a special selectable polygon
class CCtrlPolygonSelectable : public CCtrlPolygon, public IDisplayerUIHandle
{
public:
CCtrlPolygonSelectable(CInstance &instance) : Instance(instance) {} CCtrlPolygonSelectable(CInstance &instance) : Instance(instance) {}
// from IDisplayerUIHandle // from IDisplayerUIHandle
virtual CInstance &getDisplayedInstance() { return Instance; } virtual CInstance &getDisplayedInstance() { return Instance; }
@ -122,9 +82,9 @@ CCtrlPolygon *CDisplayerVisualGroup::CSelectablePrimRender::newCtrlPolygon() con
_Parent->getCorner(winX, winY, _ParentPosRef); _Parent->getCorner(winX, winY, _ParentPosRef);
return contains(x - winX, y - winY); return contains(x - winX, y - winY);
} }
public: public:
CInstance &Instance; CInstance &Instance;
protected: protected:
// TMP TMP until matrix precision is solved // TMP TMP until matrix precision is solved
// from CCtrlPolygon // from CCtrlPolygon
void computeScaledVertex(NLMISC::CVector2f &dest, const NLMISC::CVector2f &src) void computeScaledVertex(NLMISC::CVector2f &dest, const NLMISC::CVector2f &src)
@ -133,24 +93,12 @@ CCtrlPolygon *CDisplayerVisualGroup::CSelectablePrimRender::newCtrlPolygon() con
if (!gm) dest = CVector::Null; if (!gm) dest = CVector::Null;
gm->worldToWindow(dest, src); gm->worldToWindow(dest, src);
} }
}; };
CCtrlPolygonSelectable *result = new CCtrlPolygonSelectable(*DisplayedInstance);
result->setId(DisplayedInstance->getId());
result->setToolTipParent(CCtrlBase::TTMouse);
result->setToolTipParentPosRef(Hotspot_BR);
result->setToolTipPosRef(Hotspot_TL);
return result;
}
// ********************************************************************************************************* // create a special selectable polygon
CCtrlQuad *CDisplayerVisualGroup::CSelectablePrimRender::newCtrlQuad(uint edgeIndex) const class CCtrlQuadSelectable : public CCtrlQuad, public IDisplayerUIHandle
{ {
//H_AUTO(R2_CDisplayerVisualGroup_CSelectablePrimRender) public:
nlassert(DisplayedInstance);
// create a special selectable polygon
class CCtrlQuadSelectable : public CCtrlQuad, public IDisplayerUIHandle
{
public:
CCtrlQuadSelectable(CInstance &instance, uint edgeIndex) : Instance(instance), EdgeIndex(edgeIndex) {} CCtrlQuadSelectable(CInstance &instance, uint edgeIndex) : Instance(instance), EdgeIndex(edgeIndex) {}
// from IDisplayerUIHandle // from IDisplayerUIHandle
virtual CInstance &getDisplayedInstance() { return Instance; } virtual CInstance &getDisplayedInstance() { return Instance; }
@ -187,10 +135,63 @@ CCtrlQuad *CDisplayerVisualGroup::CSelectablePrimRender::newCtrlQuad(uint edgeIn
{ {
return false; return false;
} }
public: public:
CInstance &Instance; CInstance &Instance;
uint EdgeIndex; uint EdgeIndex;
}; };
// *********************************************************************************************************
CDisplayerVisualGroup::CDisplayerVisualGroup()
{
_ArrayName = "Components";
_DrawnThisFrame = false;
_TimeOver = 0;
_CurrPrimValid = true;
touch();
_Active = false;
_CurrPrimInaccessible = false;
_ContextualVisibilityActive = false;
_ContextualVisibilityDate = -1;
_VisibleLastFrame = false;
}
// *********************************************************************************************************
void CDisplayerVisualGroup::touch()
{
//H_AUTO(R2_CDisplayerVisualGroup_touch)
_PrimTouched = true;
_InstanceListTouched = true;
_AccessibilityTouched = true;
}
// *********************************************************************************************************
void CDisplayerVisualGroup::setDisplayedInstance(CInstance *instance)
{
//H_AUTO(R2_CDisplayerVisualGroup_setDisplayedInstance)
CDisplayerVisual::setDisplayedInstance(instance);
_Prim.DisplayedInstance = instance;
}
// *********************************************************************************************************
CCtrlPolygon *CDisplayerVisualGroup::CSelectablePrimRender::newCtrlPolygon() const
{
//H_AUTO(R2_CDisplayerVisualGroup_CSelectablePrimRender)
nlassert(DisplayedInstance);
CCtrlPolygonSelectable *result = new CCtrlPolygonSelectable(*DisplayedInstance);
result->setId(DisplayedInstance->getId());
result->setToolTipParent(CCtrlBase::TTMouse);
result->setToolTipParentPosRef(Hotspot_BR);
result->setToolTipPosRef(Hotspot_TL);
return result;
}
// *********************************************************************************************************
CCtrlQuad *CDisplayerVisualGroup::CSelectablePrimRender::newCtrlQuad(uint edgeIndex) const
{
//H_AUTO(R2_CDisplayerVisualGroup_CSelectablePrimRender)
nlassert(DisplayedInstance);
CCtrlQuadSelectable *result = new CCtrlQuadSelectable(*DisplayedInstance, edgeIndex); CCtrlQuadSelectable *result = new CCtrlQuadSelectable(*DisplayedInstance, edgeIndex);
result->setToolTipParent(CCtrlBase::TTMouse); result->setToolTipParent(CCtrlBase::TTMouse);
result->setToolTipParentPosRef(Hotspot_BR); result->setToolTipParentPosRef(Hotspot_BR);

Loading…
Cancel
Save