Commit db252ea8 authored by Maciej Suminski's avatar Maciej Suminski

Changed BOARD_DESIGN_SETTINGS::m_VisibleElements from int to long, to assure...

Changed BOARD_DESIGN_SETTINGS::m_VisibleElements from int to long, to assure at least 32 bits length (without depending on the platfrom int size).
parent 44861f58
......@@ -100,7 +100,7 @@ public:
* returns a bit-mask of all the element categories that are visible
* @return int - the visible element categories in bit-mapped form.
*/
int GetVisibleElements() const
long GetVisibleElements() const
{
return m_VisibleElements;
}
......@@ -110,7 +110,7 @@ public:
* changes the bit-mask of visible element categories
* @param aMask = The new bit-mask of visible element categories
*/
void SetVisibleElements( int aMask )
void SetVisibleElements( long aMask )
{
m_VisibleElements = aMask;
}
......@@ -119,23 +119,25 @@ public:
* Function IsElementVisible
* tests whether a given element category is visible. Keep this as an
* inline function.
* @param aPCB_VISIBLE is from the enum by the same name
* @param aElementCategory is from the enum by the same name
* @return bool - true if the element is visible.
* @see enum PCB_VISIBLE
*/
bool IsElementVisible( int aPCB_VISIBLE ) const
bool IsElementVisible( int aElementCategory ) const
{
return bool( m_VisibleElements & (1 << aPCB_VISIBLE) );
assert( aElementCategory >= 0 && aElementCategory < END_PCB_VISIBLE_LIST );
return ( m_VisibleElements & ( 1 << aElementCategory ) );
}
/**
* Function SetElementVisibility
* changes the visibility of an element category
* @param aPCB_VISIBLE is from the enum by the same name
* @param aElementCategory is from the enum by the same name
* @param aNewState = The new visibility state of the element category
* @see enum PCB_VISIBLE
*/
void SetElementVisibility( int aPCB_VISIBLE, bool aNewState );
void SetElementVisibility( int aElementCategory, bool aNewState );
/**
* Function GetEnabledLayers
......@@ -196,7 +198,7 @@ private:
int m_CopperLayerCount; ///< Number of copper layers for this design
LAYER_MSK m_EnabledLayers; ///< Bit-mask for layer enabling
LAYER_MSK m_VisibleLayers; ///< Bit-mask for layer visibility
int m_VisibleElements; ///< Bit-mask for element category visibility
long m_VisibleElements; ///< Bit-mask for element category visibility
int m_boardThickness; ///< Board thickness for 3D viewer
};
......
......@@ -647,7 +647,7 @@ void PCB_IO::format( BOARD* aBoard, int aNestLevel ) const
FMTIU( aBoard->GetGridOrigin().x ).c_str(),
FMTIU( aBoard->GetGridOrigin().y ).c_str() );
m_out->Print( aNestLevel+1, "(visible_elements %X)\n",
m_out->Print( aNestLevel+1, "(visible_elements %lX)\n",
aBoard->GetDesignSettings().GetVisibleElements() );
aBoard->GetPlotOptions().Format( m_out, aNestLevel+1 );
......
......@@ -870,7 +870,7 @@ void LEGACY_PLUGIN::loadSETUP()
else if( TESTLINE( "VisibleElements" ) )
{
int visibleElements = hexParse( line + SZ( "VisibleElements" ) );
long visibleElements = hexParse( line + SZ( "VisibleElements" ) );
bds.SetVisibleElements( visibleElements );
}
......@@ -3071,7 +3071,7 @@ void LEGACY_PLUGIN::saveSETUP( const BOARD* aBoard ) const
fprintf( m_fp, "GridOrigin %s\n", fmtBIUPoint( aBoard->GetGridOrigin() ).c_str() );
fprintf( m_fp, "AuxiliaryAxisOrg %s\n", fmtBIUPoint( aBoard->GetAuxOrigin() ).c_str() );
fprintf( m_fp, "VisibleElements %X\n", bds.GetVisibleElements() );
fprintf( m_fp, "VisibleElements %lX\n", bds.GetVisibleElements() );
{
STRING_FORMATTER sf;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment