From 44861f5889b3067856bc12dd9b68fdbaeaac36bd Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Mon, 3 Feb 2014 13:05:27 +0100 Subject: [PATCH 01/16] Fixed tracks of 0 width causing division by 0 error. --- pcbnew/class_track.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pcbnew/class_track.cpp b/pcbnew/class_track.cpp index 21cca65517..79863c19f2 100644 --- a/pcbnew/class_track.cpp +++ b/pcbnew/class_track.cpp @@ -763,9 +763,9 @@ void TRACK::ViewGetLayers( int aLayers[], int& aCount ) const unsigned int TRACK::ViewGetLOD( int aLayer ) const { // Netnames will be shown only if zoom is appropriate - if( aLayer == GetNetnameLayer( GetLayer() ) ) + if( aLayer == ITEM_GAL_LAYER( TRACK_NETNAMES_VISIBLE ) ) { - return ( 20000000 / m_Width ); + return ( 20000000 / ( m_Width + 1 ) ); } // Other layers are shown without any conditions From db252ea88cebd82d5698ae238c89021cfbc7f9ea Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Mon, 3 Feb 2014 13:08:01 +0100 Subject: [PATCH 02/16] Changed BOARD_DESIGN_SETTINGS::m_VisibleElements from int to long, to assure at least 32 bits length (without depending on the platfrom int size). --- include/class_board_design_settings.h | 18 ++++++++++-------- pcbnew/kicad_plugin.cpp | 2 +- pcbnew/legacy_plugin.cpp | 4 ++-- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/include/class_board_design_settings.h b/include/class_board_design_settings.h index 9b516308b2..579d7dad38 100644 --- a/include/class_board_design_settings.h +++ b/include/class_board_design_settings.h @@ -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 }; diff --git a/pcbnew/kicad_plugin.cpp b/pcbnew/kicad_plugin.cpp index 99211a7e4d..2121c98e61 100644 --- a/pcbnew/kicad_plugin.cpp +++ b/pcbnew/kicad_plugin.cpp @@ -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 ); diff --git a/pcbnew/legacy_plugin.cpp b/pcbnew/legacy_plugin.cpp index a1fd78a9b0..1c1a920bf8 100644 --- a/pcbnew/legacy_plugin.cpp +++ b/pcbnew/legacy_plugin.cpp @@ -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; From 864c86062d79a940c34a71152e0c9d73deca69a5 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Mon, 3 Feb 2014 13:09:10 +0100 Subject: [PATCH 03/16] Changed ROUTER_PREVIEW_ITEM layer. --- pcbnew/router/router_preview_item.cpp | 1 + pcbnew/router/router_preview_item.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/pcbnew/router/router_preview_item.cpp b/pcbnew/router/router_preview_item.cpp index b29caf7322..8ce1db4721 100644 --- a/pcbnew/router/router_preview_item.cpp +++ b/pcbnew/router/router_preview_item.cpp @@ -36,6 +36,7 @@ ROUTER_PREVIEW_ITEM::ROUTER_PREVIEW_ITEM( const PNS_ITEM* aItem, VIEW_GROUP* aPa { m_Flags = 0; m_parent = aParent; + m_layer = DRAW_N; if( aItem ) Update( aItem ); diff --git a/pcbnew/router/router_preview_item.h b/pcbnew/router/router_preview_item.h index f891f3bf66..058c47f816 100644 --- a/pcbnew/router/router_preview_item.h +++ b/pcbnew/router/router_preview_item.h @@ -73,7 +73,7 @@ public: virtual void ViewGetLayers( int aLayers[], int& aCount ) const { - aLayers[0] = GP_OVERLAY; + aLayers[0] = m_layer; aCount = 1; } From 2fe85cf43d6b25ff44d8c26f44698324a87541f3 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Mon, 3 Feb 2014 13:26:25 +0100 Subject: [PATCH 04/16] Minor changes. --- pcbnew/pcb_painter.cpp | 11 ++++++----- pcbnew/pcb_painter.h | 1 + 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/pcbnew/pcb_painter.cpp b/pcbnew/pcb_painter.cpp index 105362f83c..41faebdf5c 100644 --- a/pcbnew/pcb_painter.cpp +++ b/pcbnew/pcb_painter.cpp @@ -261,13 +261,14 @@ void PCB_PAINTER::draw( const TRACK* aTrack, int aLayer ) VECTOR2D start( aTrack->GetStart() ); VECTOR2D end( aTrack->GetEnd() ); int width = aTrack->GetWidth(); - int netNumber = aTrack->GetNet(); COLOR4D color; if( m_pcbSettings->m_netNamesOnTracks && IsNetnameLayer( aLayer ) ) { + int netCode = aTrack->GetNet(); + // If there is a net name - display it on the track - if( netNumber > 0 ) + if( netCode > 0 ) { VECTOR2D line = ( end - start ); double length = line.EuclideanNorm(); @@ -276,11 +277,11 @@ void PCB_PAINTER::draw( const TRACK* aTrack, int aLayer ) if( length < 10 * width ) return; - NETINFO_ITEM* net = ( (BOARD*) aTrack->GetParent() )->FindNet( netNumber ); + NETINFO_ITEM* net = ( (BOARD*) aTrack->GetParent() )->FindNet( netCode ); if( !net ) return; - std::wstring netName = std::wstring( net->GetShortNetname().wc_str() ); + wxString netName = net->GetShortNetname(); VECTOR2D textPosition = start + line / 2.0; // center of the track double textOrientation = -atan( line.y / line.x ); double textSize = std::min( static_cast( width ), length / netName.length() ); @@ -304,7 +305,7 @@ void PCB_PAINTER::draw( const TRACK* aTrack, int aLayer ) m_gal->StrokeText( netName, textPosition, textOrientation ); } } - else if( IsCopperLayer( aLayer )) + else if( IsCopperLayer( aLayer ) ) { // Draw a regular track color = m_pcbSettings->GetColor( aTrack, aLayer ); diff --git a/pcbnew/pcb_painter.h b/pcbnew/pcb_painter.h index e5b60a82ca..cf9f242b8c 100644 --- a/pcbnew/pcb_painter.h +++ b/pcbnew/pcb_painter.h @@ -114,6 +114,7 @@ protected: ///> Colors for all layers (darkened) COLOR4D m_layerColorsDark[TOTAL_LAYER_COUNT]; + ///> Flag determining if items on a given layer should be drawn as an outline or a full item bool m_sketchModeSelect[TOTAL_LAYER_COUNT]; ///> Flag determining if pad numbers should be visible From fff616c8dced2ec1dfc5cfd540f89dd41f3ba1be Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Mon, 3 Feb 2014 14:14:53 +0100 Subject: [PATCH 05/16] Moved netnames (GAL specific layers) to a separate enum, to avoid saving/reading their settings from files. Added a check for the number of PCB_VISIBLE elements. Worksheet & general purpose overlay layers are visible by default. --- include/layers_id_colors_and_visibility.h | 62 +++++++++++++++-------- pcbnew/basepcbframe.cpp | 44 ++++++++-------- pcbnew/class_pad.cpp | 6 +-- pcbnew/class_track.cpp | 2 +- pcbnew/pcb_painter.cpp | 16 +++--- pcbnew/pcbframe.cpp | 23 +++++---- 6 files changed, 88 insertions(+), 65 deletions(-) diff --git a/include/layers_id_colors_and_visibility.h b/include/layers_id_colors_and_visibility.h index d421e6cf4e..7dc0660457 100644 --- a/include/layers_id_colors_and_visibility.h +++ b/include/layers_id_colors_and_visibility.h @@ -239,8 +239,33 @@ enum PCB_VISIBLE PADS_HOLES_VISIBLE, VIAS_HOLES_VISIBLE, - // Netname layers - LAYER_1_NETNAMES_VISIBLE, // Bottom layer + WORKSHEET, ///< worksheet frame + GP_OVERLAY, ///< general purpose overlay + + END_PCB_VISIBLE_LIST // sentinel +}; + +#ifndef NDEBUG +struct static_check { + static_check() + { + // Long (the type used for saving visibility settings) is only 32 bits guaranteed, + // be sure that we do not cross the limit + assert( END_PCB_VISIBLE_LIST <= 32 ); + }; +}; +static static_check check; +#endif + +/** + * Enum NETNAMES_VISIBLE + * is a set of layers specific for displaying net names. + * Their visiblity is not supposed to be saved in a board file, + * they are only to be used by the GAL. + */ +enum NETNAMES_VISIBLE +{ + LAYER_1_NETNAMES_VISIBLE, // bottom layer LAYER_2_NETNAMES_VISIBLE, LAYER_3_NETNAMES_VISIBLE, LAYER_4_NETNAMES_VISIBLE, @@ -255,25 +280,22 @@ enum PCB_VISIBLE LAYER_13_NETNAMES_VISIBLE, LAYER_14_NETNAMES_VISIBLE, LAYER_15_NETNAMES_VISIBLE, - LAYER_16_NETNAMES_VISIBLE, // Top layer + LAYER_16_NETNAMES_VISIBLE, // top layer + PAD_FR_NETNAMES_VISIBLE, PAD_BK_NETNAMES_VISIBLE, PADS_NETNAMES_VISIBLE, - WORKSHEET, - GP_OVERLAY, // General purpose overlay - - END_PCB_VISIBLE_LIST // sentinel + END_NETNAMES_VISIBLE_LIST // sentinel }; -#define FIRST_NETNAME_LAYER ITEM_GAL_LAYER( LAYER_1_NETNAMES_VISIBLE ) -#define LAST_NETNAME_LAYER ITEM_GAL_LAYER( PADS_NETNAMES_VISIBLE ) - /// macro for obtaining layer number for specific item (eg. pad or text) -#define ITEM_GAL_LAYER(layer) (NB_LAYERS + layer) +#define ITEM_GAL_LAYER(layer) (NB_LAYERS + layer) + +#define NETNAMES_GAL_LAYER(layer) (NB_LAYERS + END_PCB_VISIBLE_LIST + layer ) /// number of *all* layers including PCB and item layers -#define TOTAL_LAYER_COUNT 128 //(NB_LAYERS + END_PCB_VISIBLE_LIST) +#define TOTAL_LAYER_COUNT (NB_LAYERS + END_PCB_VISIBLE_LIST + END_NETNAMES_VISIBLE_LIST) /** * Function IsValidLayer @@ -390,30 +412,28 @@ wxString LayerMaskDescribe( const BOARD *aBoard, LAYER_MSK aMask ); inline LAYER_NUM GetNetnameLayer( LAYER_NUM aLayer ) { if( IsCopperLayer( aLayer ) ) - { - // Compute the offset in description layers - return FIRST_NETNAME_LAYER + ( aLayer - FIRST_COPPER_LAYER ); - } + return NETNAMES_GAL_LAYER( aLayer ); else if( aLayer == ITEM_GAL_LAYER( PADS_VISIBLE ) ) - return ITEM_GAL_LAYER( PADS_NETNAMES_VISIBLE ); + return NETNAMES_GAL_LAYER( PADS_NETNAMES_VISIBLE ); else if( aLayer == ITEM_GAL_LAYER( PAD_FR_VISIBLE ) ) - return ITEM_GAL_LAYER( PAD_FR_NETNAMES_VISIBLE ); + return NETNAMES_GAL_LAYER( PAD_FR_NETNAMES_VISIBLE ); else if( aLayer == ITEM_GAL_LAYER( PAD_BK_VISIBLE ) ) - return ITEM_GAL_LAYER( PAD_BK_NETNAMES_VISIBLE ); + return NETNAMES_GAL_LAYER( PAD_BK_NETNAMES_VISIBLE ); // Fallback return COMMENT_N; } /** - * Function IsCopperLayer + * Function IsNetnameLayer * tests whether a layer is a netname layer * @param aLayer = Layer to test * @return true if aLayer is a valid netname layer */ inline bool IsNetnameLayer( LAYER_NUM aLayer ) { - return aLayer >= FIRST_NETNAME_LAYER && aLayer <= LAST_NETNAME_LAYER; + return aLayer >= NETNAMES_GAL_LAYER( LAYER_1_NETNAMES_VISIBLE ) && + aLayer < NETNAMES_GAL_LAYER( END_NETNAMES_VISIBLE_LIST ); } #endif // _LAYERS_ID_AND_VISIBILITY_H_ diff --git a/pcbnew/basepcbframe.cpp b/pcbnew/basepcbframe.cpp index 858aa40c0e..dc26c04ee5 100644 --- a/pcbnew/basepcbframe.cpp +++ b/pcbnew/basepcbframe.cpp @@ -75,7 +75,7 @@ static const wxString FastGrid2Entry( wxT( "FastGrid2" ) ); const LAYER_NUM PCB_BASE_FRAME::GAL_LAYER_ORDER[] = { ITEM_GAL_LAYER( GP_OVERLAY ), - ITEM_GAL_LAYER( PADS_NETNAMES_VISIBLE ), + NETNAMES_GAL_LAYER( PADS_NETNAMES_VISIBLE ), DRAW_N, COMMENT_N, ECO1_N, ECO2_N, EDGE_N, UNUSED_LAYER_29, UNUSED_LAYER_30, UNUSED_LAYER_31, ITEM_GAL_LAYER( MOD_TEXT_FR_VISIBLE ), @@ -85,25 +85,25 @@ const LAYER_NUM PCB_BASE_FRAME::GAL_LAYER_ORDER[] = ITEM_GAL_LAYER( VIAS_HOLES_VISIBLE ), ITEM_GAL_LAYER( PADS_HOLES_VISIBLE ), ITEM_GAL_LAYER( VIAS_VISIBLE ), ITEM_GAL_LAYER( PADS_VISIBLE ), - ITEM_GAL_LAYER( PAD_FR_NETNAMES_VISIBLE ), ITEM_GAL_LAYER( PAD_FR_VISIBLE ), SOLDERMASK_N_FRONT, - ITEM_GAL_LAYER( LAYER_16_NETNAMES_VISIBLE ), LAYER_N_FRONT, + NETNAMES_GAL_LAYER( PAD_FR_NETNAMES_VISIBLE ), ITEM_GAL_LAYER( PAD_FR_VISIBLE ), SOLDERMASK_N_FRONT, + NETNAMES_GAL_LAYER( LAYER_16_NETNAMES_VISIBLE ), LAYER_N_FRONT, SILKSCREEN_N_FRONT, SOLDERPASTE_N_FRONT, ADHESIVE_N_FRONT, - ITEM_GAL_LAYER( LAYER_15_NETNAMES_VISIBLE ), LAYER_N_15, - ITEM_GAL_LAYER( LAYER_14_NETNAMES_VISIBLE ), LAYER_N_14, - ITEM_GAL_LAYER( LAYER_13_NETNAMES_VISIBLE ), LAYER_N_13, - ITEM_GAL_LAYER( LAYER_12_NETNAMES_VISIBLE ), LAYER_N_12, - ITEM_GAL_LAYER( LAYER_11_NETNAMES_VISIBLE ), LAYER_N_11, - ITEM_GAL_LAYER( LAYER_10_NETNAMES_VISIBLE ), LAYER_N_10, - ITEM_GAL_LAYER( LAYER_9_NETNAMES_VISIBLE ), LAYER_N_9, - ITEM_GAL_LAYER( LAYER_8_NETNAMES_VISIBLE ), LAYER_N_8, - ITEM_GAL_LAYER( LAYER_7_NETNAMES_VISIBLE ), LAYER_N_7, - ITEM_GAL_LAYER( LAYER_6_NETNAMES_VISIBLE ), LAYER_N_6, - ITEM_GAL_LAYER( LAYER_5_NETNAMES_VISIBLE ), LAYER_N_5, - ITEM_GAL_LAYER( LAYER_4_NETNAMES_VISIBLE ), LAYER_N_4, - ITEM_GAL_LAYER( LAYER_3_NETNAMES_VISIBLE ), LAYER_N_3, - ITEM_GAL_LAYER( LAYER_2_NETNAMES_VISIBLE ), LAYER_N_2, - ITEM_GAL_LAYER( PAD_BK_NETNAMES_VISIBLE ), ITEM_GAL_LAYER( PAD_BK_VISIBLE ), SOLDERMASK_N_BACK, - ITEM_GAL_LAYER( LAYER_1_NETNAMES_VISIBLE ), LAYER_N_BACK, + NETNAMES_GAL_LAYER( LAYER_15_NETNAMES_VISIBLE ), LAYER_N_15, + NETNAMES_GAL_LAYER( LAYER_14_NETNAMES_VISIBLE ), LAYER_N_14, + NETNAMES_GAL_LAYER( LAYER_13_NETNAMES_VISIBLE ), LAYER_N_13, + NETNAMES_GAL_LAYER( LAYER_12_NETNAMES_VISIBLE ), LAYER_N_12, + NETNAMES_GAL_LAYER( LAYER_11_NETNAMES_VISIBLE ), LAYER_N_11, + NETNAMES_GAL_LAYER( LAYER_10_NETNAMES_VISIBLE ), LAYER_N_10, + NETNAMES_GAL_LAYER( LAYER_9_NETNAMES_VISIBLE ), LAYER_N_9, + NETNAMES_GAL_LAYER( LAYER_8_NETNAMES_VISIBLE ), LAYER_N_8, + NETNAMES_GAL_LAYER( LAYER_7_NETNAMES_VISIBLE ), LAYER_N_7, + NETNAMES_GAL_LAYER( LAYER_6_NETNAMES_VISIBLE ), LAYER_N_6, + NETNAMES_GAL_LAYER( LAYER_5_NETNAMES_VISIBLE ), LAYER_N_5, + NETNAMES_GAL_LAYER( LAYER_4_NETNAMES_VISIBLE ), LAYER_N_4, + NETNAMES_GAL_LAYER( LAYER_3_NETNAMES_VISIBLE ), LAYER_N_3, + NETNAMES_GAL_LAYER( LAYER_2_NETNAMES_VISIBLE ), LAYER_N_2, + NETNAMES_GAL_LAYER( PAD_BK_NETNAMES_VISIBLE ), ITEM_GAL_LAYER( PAD_BK_VISIBLE ), SOLDERMASK_N_BACK, + NETNAMES_GAL_LAYER( LAYER_1_NETNAMES_VISIBLE ), LAYER_N_BACK, ADHESIVE_N_BACK, SOLDERPASTE_N_BACK, SILKSCREEN_N_BACK, ITEM_GAL_LAYER( MOD_TEXT_BK_VISIBLE ), @@ -793,14 +793,14 @@ void PCB_BASE_FRAME::LoadSettings() // Some more required layers settings view->SetRequired( ITEM_GAL_LAYER( VIAS_HOLES_VISIBLE ), ITEM_GAL_LAYER( VIAS_VISIBLE ) ); view->SetRequired( ITEM_GAL_LAYER( PADS_HOLES_VISIBLE ), ITEM_GAL_LAYER( PADS_VISIBLE ) ); - view->SetRequired( ITEM_GAL_LAYER( PADS_NETNAMES_VISIBLE ), ITEM_GAL_LAYER( PADS_VISIBLE ) ); + view->SetRequired( NETNAMES_GAL_LAYER( PADS_NETNAMES_VISIBLE ), ITEM_GAL_LAYER( PADS_VISIBLE ) ); - view->SetRequired( ITEM_GAL_LAYER( PAD_FR_NETNAMES_VISIBLE ), ITEM_GAL_LAYER( PAD_FR_VISIBLE ) ); + view->SetRequired( NETNAMES_GAL_LAYER( PAD_FR_NETNAMES_VISIBLE ), ITEM_GAL_LAYER( PAD_FR_VISIBLE ) ); view->SetRequired( ADHESIVE_N_FRONT, ITEM_GAL_LAYER( PAD_FR_VISIBLE ) ); view->SetRequired( SOLDERPASTE_N_FRONT, ITEM_GAL_LAYER( PAD_FR_VISIBLE ) ); view->SetRequired( SOLDERMASK_N_FRONT, ITEM_GAL_LAYER( PAD_FR_VISIBLE ) ); - view->SetRequired( ITEM_GAL_LAYER( PAD_BK_NETNAMES_VISIBLE ), ITEM_GAL_LAYER( PAD_BK_VISIBLE ) ); + view->SetRequired( NETNAMES_GAL_LAYER( PAD_BK_NETNAMES_VISIBLE ), ITEM_GAL_LAYER( PAD_BK_VISIBLE ) ); view->SetRequired( ADHESIVE_N_BACK, ITEM_GAL_LAYER( PAD_BK_VISIBLE ) ); view->SetRequired( SOLDERPASTE_N_BACK, ITEM_GAL_LAYER( PAD_BK_VISIBLE ) ); view->SetRequired( SOLDERMASK_N_BACK, ITEM_GAL_LAYER( PAD_BK_VISIBLE ) ); diff --git a/pcbnew/class_pad.cpp b/pcbnew/class_pad.cpp index 5a48ac461a..57d605d42f 100644 --- a/pcbnew/class_pad.cpp +++ b/pcbnew/class_pad.cpp @@ -841,7 +841,7 @@ void D_PAD::ViewGetLayers( int aLayers[], int& aCount ) const { // Multi layer pad aLayers[aCount++] = ITEM_GAL_LAYER( PADS_VISIBLE ); - aLayers[aCount++] = ITEM_GAL_LAYER( PADS_NETNAMES_VISIBLE ); + aLayers[aCount++] = NETNAMES_GAL_LAYER( PADS_NETNAMES_VISIBLE ); aLayers[aCount++] = SOLDERMASK_N_FRONT; aLayers[aCount++] = SOLDERMASK_N_BACK; aLayers[aCount++] = SOLDERPASTE_N_FRONT; @@ -850,14 +850,14 @@ void D_PAD::ViewGetLayers( int aLayers[], int& aCount ) const else if( IsOnLayer( LAYER_N_FRONT ) ) { aLayers[aCount++] = ITEM_GAL_LAYER( PAD_FR_VISIBLE ); - aLayers[aCount++] = ITEM_GAL_LAYER( PAD_FR_NETNAMES_VISIBLE ); + aLayers[aCount++] = NETNAMES_GAL_LAYER( PAD_FR_NETNAMES_VISIBLE ); aLayers[aCount++] = SOLDERMASK_N_FRONT; aLayers[aCount++] = SOLDERPASTE_N_FRONT; } else if( IsOnLayer( LAYER_N_BACK ) ) { aLayers[aCount++] = ITEM_GAL_LAYER( PAD_BK_VISIBLE ); - aLayers[aCount++] = ITEM_GAL_LAYER( PAD_BK_NETNAMES_VISIBLE ); + aLayers[aCount++] = NETNAMES_GAL_LAYER( PAD_BK_NETNAMES_VISIBLE ); aLayers[aCount++] = SOLDERMASK_N_BACK; aLayers[aCount++] = SOLDERPASTE_N_BACK; } diff --git a/pcbnew/class_track.cpp b/pcbnew/class_track.cpp index 79863c19f2..ee3e198bff 100644 --- a/pcbnew/class_track.cpp +++ b/pcbnew/class_track.cpp @@ -763,7 +763,7 @@ void TRACK::ViewGetLayers( int aLayers[], int& aCount ) const unsigned int TRACK::ViewGetLOD( int aLayer ) const { // Netnames will be shown only if zoom is appropriate - if( aLayer == ITEM_GAL_LAYER( TRACK_NETNAMES_VISIBLE ) ) + if( IsNetnameLayer( aLayer ) ) { return ( 20000000 / ( m_Width + 1 ) ); } diff --git a/pcbnew/pcb_painter.cpp b/pcbnew/pcb_painter.cpp index 41faebdf5c..2e0bec81bf 100644 --- a/pcbnew/pcb_painter.cpp +++ b/pcbnew/pcb_painter.cpp @@ -68,14 +68,14 @@ void PCB_RENDER_SETTINGS::ImportLegacyColors( COLORS_DESIGN_SETTINGS* aSettings } // Default colors for specific layers - m_layerColors[ITEM_GAL_LAYER( VIAS_HOLES_VISIBLE )] = COLOR4D( 0.5, 0.4, 0.0, 1.0 ); - m_layerColors[ITEM_GAL_LAYER( PADS_HOLES_VISIBLE )] = COLOR4D( 0.0, 0.5, 0.5, 1.0 ); - m_layerColors[ITEM_GAL_LAYER( VIAS_VISIBLE )] = COLOR4D( 0.7, 0.7, 0.7, 1.0 ); - m_layerColors[ITEM_GAL_LAYER( PADS_VISIBLE )] = COLOR4D( 0.7, 0.7, 0.7, 1.0 ); - m_layerColors[ITEM_GAL_LAYER( PADS_NETNAMES_VISIBLE )] = COLOR4D( 0.8, 0.8, 0.8, 0.7 ); - m_layerColors[ITEM_GAL_LAYER( PAD_FR_NETNAMES_VISIBLE )] = COLOR4D( 0.8, 0.8, 0.8, 0.7 ); - m_layerColors[ITEM_GAL_LAYER( PAD_BK_NETNAMES_VISIBLE )] = COLOR4D( 0.8, 0.8, 0.8, 0.7 ); - m_layerColors[ITEM_GAL_LAYER( WORKSHEET )] = COLOR4D( 0.5, 0.0, 0.0, 1.0 ); + m_layerColors[ITEM_GAL_LAYER( VIAS_HOLES_VISIBLE )] = COLOR4D( 0.5, 0.4, 0.0, 1.0 ); + m_layerColors[ITEM_GAL_LAYER( PADS_HOLES_VISIBLE )] = COLOR4D( 0.0, 0.5, 0.5, 1.0 ); + m_layerColors[ITEM_GAL_LAYER( VIAS_VISIBLE )] = COLOR4D( 0.7, 0.7, 0.7, 1.0 ); + m_layerColors[ITEM_GAL_LAYER( PADS_VISIBLE )] = COLOR4D( 0.7, 0.7, 0.7, 1.0 ); + m_layerColors[NETNAMES_GAL_LAYER( PADS_NETNAMES_VISIBLE )] = COLOR4D( 0.8, 0.8, 0.8, 0.7 ); + m_layerColors[NETNAMES_GAL_LAYER( PAD_FR_NETNAMES_VISIBLE )] = COLOR4D( 0.8, 0.8, 0.8, 0.7 ); + m_layerColors[NETNAMES_GAL_LAYER( PAD_BK_NETNAMES_VISIBLE )] = COLOR4D( 0.8, 0.8, 0.8, 0.7 ); + m_layerColors[ITEM_GAL_LAYER( WORKSHEET )] = COLOR4D( 0.5, 0.0, 0.0, 1.0 ); // Netnames for copper layers for( LAYER_NUM layer = FIRST_COPPER_LAYER; layer <= LAST_COPPER_LAYER; ++layer ) diff --git a/pcbnew/pcbframe.cpp b/pcbnew/pcbframe.cpp index 62dab6ff16..5f9cc9c09a 100644 --- a/pcbnew/pcbframe.cpp +++ b/pcbnew/pcbframe.cpp @@ -916,7 +916,7 @@ void PCB_EDIT_FRAME::setHighContrastLayer( LAYER_NUM aLayer ) LAYER_NUM layers[] = { GetNetnameLayer( aLayer ), ITEM_GAL_LAYER( VIAS_VISIBLE ), ITEM_GAL_LAYER( VIAS_HOLES_VISIBLE ), ITEM_GAL_LAYER( PADS_VISIBLE ), - ITEM_GAL_LAYER( PADS_HOLES_VISIBLE ), ITEM_GAL_LAYER( PADS_NETNAMES_VISIBLE ), + ITEM_GAL_LAYER( PADS_HOLES_VISIBLE ), NETNAMES_GAL_LAYER( PADS_NETNAMES_VISIBLE ), ITEM_GAL_LAYER( GP_OVERLAY ), ITEM_GAL_LAYER( RATSNEST_VISIBLE ) }; @@ -927,12 +927,12 @@ void PCB_EDIT_FRAME::setHighContrastLayer( LAYER_NUM aLayer ) if( aLayer == FIRST_COPPER_LAYER ) { rSettings->SetActiveLayer( ITEM_GAL_LAYER( PAD_BK_VISIBLE ) ); - rSettings->SetActiveLayer( ITEM_GAL_LAYER( PAD_BK_NETNAMES_VISIBLE ) ); + rSettings->SetActiveLayer( NETNAMES_GAL_LAYER( PAD_BK_NETNAMES_VISIBLE ) ); } else if( aLayer == LAST_COPPER_LAYER ) { rSettings->SetActiveLayer( ITEM_GAL_LAYER( PAD_FR_VISIBLE ) ); - rSettings->SetActiveLayer( ITEM_GAL_LAYER( PAD_FR_NETNAMES_VISIBLE ) ); + rSettings->SetActiveLayer( NETNAMES_GAL_LAYER( PAD_FR_NETNAMES_VISIBLE ) ); } } @@ -956,7 +956,7 @@ void PCB_EDIT_FRAME::setTopLayer( LAYER_NUM aLayer ) LAYER_NUM layers[] = { GetNetnameLayer( aLayer ), ITEM_GAL_LAYER( VIAS_VISIBLE ), ITEM_GAL_LAYER( VIAS_HOLES_VISIBLE ), ITEM_GAL_LAYER( PADS_VISIBLE ), - ITEM_GAL_LAYER( PADS_HOLES_VISIBLE ), ITEM_GAL_LAYER( PADS_NETNAMES_VISIBLE ), + ITEM_GAL_LAYER( PADS_HOLES_VISIBLE ), NETNAMES_GAL_LAYER( PADS_NETNAMES_VISIBLE ), ITEM_GAL_LAYER( GP_OVERLAY ), ITEM_GAL_LAYER( RATSNEST_VISIBLE ), DRAW_N }; @@ -969,12 +969,12 @@ void PCB_EDIT_FRAME::setTopLayer( LAYER_NUM aLayer ) if( aLayer == FIRST_COPPER_LAYER ) { view->SetTopLayer( ITEM_GAL_LAYER( PAD_BK_VISIBLE ) ); - view->SetTopLayer( ITEM_GAL_LAYER( PAD_BK_NETNAMES_VISIBLE ) ); + view->SetTopLayer( NETNAMES_GAL_LAYER( PAD_BK_NETNAMES_VISIBLE ) ); } else if( aLayer == LAST_COPPER_LAYER ) { view->SetTopLayer( ITEM_GAL_LAYER( PAD_FR_VISIBLE ) ); - view->SetTopLayer( ITEM_GAL_LAYER( PAD_FR_NETNAMES_VISIBLE ) ); + view->SetTopLayer( NETNAMES_GAL_LAYER( PAD_FR_NETNAMES_VISIBLE ) ); } } @@ -1014,10 +1014,15 @@ void PCB_EDIT_FRAME::syncLayerVisibilities() m_Layers->SyncLayerVisibilities(); KIGFX::VIEW* view = GetGalCanvas()->GetView(); + // Load layer & elements visibility settings for( LAYER_NUM i = 0; i < NB_LAYERS; ++i ) { view->SetLayerVisible( i, m_Pcb->IsLayerVisible( i ) ); + + // Synchronize netname layers as well + if( IsCopperLayer( i ) ) + view->SetLayerVisible( GetNetnameLayer( i ), m_Pcb->IsLayerVisible( i ) ); } for( LAYER_NUM i = 0; i < END_PCB_VISIBLE_LIST; ++i ) @@ -1026,12 +1031,10 @@ void PCB_EDIT_FRAME::syncLayerVisibilities() } // Enable some layers that are GAL specific - for( LAYER_NUM i = FIRST_NETNAME_LAYER; i < LAST_NETNAME_LAYER; ++i ) - { - view->SetLayerVisible( i, true ); - } view->SetLayerVisible( ITEM_GAL_LAYER( PADS_HOLES_VISIBLE ), true ); view->SetLayerVisible( ITEM_GAL_LAYER( VIAS_HOLES_VISIBLE ), true ); + view->SetLayerVisible( ITEM_GAL_LAYER( WORKSHEET ), true ); + view->SetLayerVisible( ITEM_GAL_LAYER( GP_OVERLAY ), true ); } From d124cf45f3ccd080019667c59d57686c8cdb0acd Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Thu, 6 Feb 2014 21:34:03 +0100 Subject: [PATCH 06/16] Reverted changes introduced by the revision 4655. --- include/class_board_design_settings.h | 6 +++--- pcbnew/kicad_plugin.cpp | 2 +- pcbnew/legacy_plugin.cpp | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/class_board_design_settings.h b/include/class_board_design_settings.h index 579d7dad38..a651e982fc 100644 --- a/include/class_board_design_settings.h +++ b/include/class_board_design_settings.h @@ -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. */ - long GetVisibleElements() const + int 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( long aMask ) + void SetVisibleElements( int aMask ) { m_VisibleElements = aMask; } @@ -198,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 - long m_VisibleElements; ///< Bit-mask for element category visibility + int m_VisibleElements; ///< Bit-mask for element category visibility int m_boardThickness; ///< Board thickness for 3D viewer }; diff --git a/pcbnew/kicad_plugin.cpp b/pcbnew/kicad_plugin.cpp index 2121c98e61..99211a7e4d 100644 --- a/pcbnew/kicad_plugin.cpp +++ b/pcbnew/kicad_plugin.cpp @@ -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 %lX)\n", + m_out->Print( aNestLevel+1, "(visible_elements %X)\n", aBoard->GetDesignSettings().GetVisibleElements() ); aBoard->GetPlotOptions().Format( m_out, aNestLevel+1 ); diff --git a/pcbnew/legacy_plugin.cpp b/pcbnew/legacy_plugin.cpp index 1c1a920bf8..a1fd78a9b0 100644 --- a/pcbnew/legacy_plugin.cpp +++ b/pcbnew/legacy_plugin.cpp @@ -870,7 +870,7 @@ void LEGACY_PLUGIN::loadSETUP() else if( TESTLINE( "VisibleElements" ) ) { - long visibleElements = hexParse( line + SZ( "VisibleElements" ) ); + int 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 %lX\n", bds.GetVisibleElements() ); + fprintf( m_fp, "VisibleElements %X\n", bds.GetVisibleElements() ); { STRING_FORMATTER sf; From 222017758cdc30efa7d979268a545a3d3228095f Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Fri, 7 Feb 2014 20:54:58 +0100 Subject: [PATCH 07/16] Moved PCB_VISIBLE size check to .cpp. --- include/layers_id_colors_and_visibility.h | 12 ------------ pcbnew/class_board_design_settings.cpp | 13 +++++++++++++ 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/include/layers_id_colors_and_visibility.h b/include/layers_id_colors_and_visibility.h index 7dc0660457..5df67215be 100644 --- a/include/layers_id_colors_and_visibility.h +++ b/include/layers_id_colors_and_visibility.h @@ -245,18 +245,6 @@ enum PCB_VISIBLE END_PCB_VISIBLE_LIST // sentinel }; -#ifndef NDEBUG -struct static_check { - static_check() - { - // Long (the type used for saving visibility settings) is only 32 bits guaranteed, - // be sure that we do not cross the limit - assert( END_PCB_VISIBLE_LIST <= 32 ); - }; -}; -static static_check check; -#endif - /** * Enum NETNAMES_VISIBLE * is a set of layers specific for displaying net names. diff --git a/pcbnew/class_board_design_settings.cpp b/pcbnew/class_board_design_settings.cpp index e98dc81ef1..654ca11653 100644 --- a/pcbnew/class_board_design_settings.cpp +++ b/pcbnew/class_board_design_settings.cpp @@ -243,3 +243,16 @@ void BOARD_DESIGN_SETTINGS::SetEnabledLayers( LAYER_MSK aMask ) // update m_CopperLayerCount to ensure its consistency with m_EnabledLayers m_CopperLayerCount = LayerMaskCountSet( aMask & ALL_CU_LAYERS); } + + +#ifndef NDEBUG +struct static_check { + static_check() + { + // Int (the type used for saving visibility settings) is only 32 bits guaranteed, + // be sure that we do not cross the limit + assert( END_PCB_VISIBLE_LIST <= 32 ); + }; +}; +static static_check check; +#endif From d5064b98a4a9c7faadcddcfdbab50b959891172c Mon Sep 17 00:00:00 2001 From: Cirilo Bernardo Date: Sat, 15 Feb 2014 08:39:06 +0100 Subject: [PATCH 08/16] Export VRML and IDF maintenance. Fix minor bug in eeschema (opening a relative path does not work) (patch from HennerZeller). --- eeschema/eeschema.cpp | 2 +- pcbnew/exporters/export_vrml.cpp | 46 +++++++++++++++++++++++++++++--- utils/idftools/idf_cylinder.cpp | 2 +- 3 files changed, 45 insertions(+), 5 deletions(-) diff --git a/eeschema/eeschema.cpp b/eeschema/eeschema.cpp index 5efa3e62c8..7b1d86cd90 100644 --- a/eeschema/eeschema.cpp +++ b/eeschema/eeschema.cpp @@ -205,7 +205,7 @@ bool EDA_APP::OnInit() // wxSetWorkingDirectory does not like empty paths wxSetWorkingDirectory( filename.GetPath() ); - if( frame->LoadOneEEProject( filename.GetFullPath(), false ) ) + if( frame->LoadOneEEProject( filename.GetFullName(), false ) ) frame->GetCanvas()->Refresh( true ); } else diff --git a/pcbnew/exporters/export_vrml.cpp b/pcbnew/exporters/export_vrml.cpp index 83965bfbf5..ba45f83988 100644 --- a/pcbnew/exporters/export_vrml.cpp +++ b/pcbnew/exporters/export_vrml.cpp @@ -44,6 +44,7 @@ * * 3. Export Graphics to Layer objects (see 3d_draw.cpp for clues) to ensure that custom * tracks/fills/logos are rendered. + * module->TransformGraphicShapesWithClearanceToPolygonSet * * For mechanical correctness, we should use the following settings with arcs: * 1. max. deviation: the number of edges should be determined by the max. @@ -925,7 +926,8 @@ static void export_vrml_text_module( TEXTE_MODULE* module ) } -static void export_vrml_edge_module( MODEL_VRML& aModel, EDGE_MODULE* aOutline ) +static void export_vrml_edge_module( MODEL_VRML& aModel, EDGE_MODULE* aOutline, + double aOrientation ) { LAYER_NUM layer = aOutline->GetLayer(); double x = aOutline->GetStart().x * aModel.scale + aModel.tx; @@ -936,6 +938,10 @@ static void export_vrml_edge_module( MODEL_VRML& aModel, EDGE_MODULE* aOutline ) switch( aOutline->GetShape() ) { + case S_SEGMENT: + export_vrml_line( aModel, layer, x, y, xf, yf, w ); + break; + case S_ARC: export_vrml_arc( aModel, layer, x, y, xf, yf, w, aOutline->GetAngle() / 10 ); break; @@ -944,8 +950,41 @@ static void export_vrml_edge_module( MODEL_VRML& aModel, EDGE_MODULE* aOutline ) export_vrml_circle( aModel, layer, x, y, xf, yf, w ); break; + case S_POLYGON: + { + VRML_LAYER* vl; + + if( !VRMLEXPORT::GetLayer( aModel, layer, &vl ) ) + break; + + int nvert = aOutline->GetPolyPoints().size(); + int i = 0; + + if( nvert < 3 ) break; + + int seg = vl->NewContour(); + + if( seg < 0 ) + break; + + while( i < nvert ) + { + CPolyPt corner( aOutline->GetPolyPoints()[i] ); + RotatePoint( &corner.x, &corner.y, aOrientation ); + corner.x += aOutline->GetPosition().x; + corner.y += aOutline->GetPosition().y; + + x = corner.x * aModel.scale + aModel.tx; + y = - ( corner.y * aModel.scale + aModel.ty ); + vl->AddVertex( seg, x, y ); + + ++i; + } + vl->EnsureWinding( seg, false ); + } + break; + default: - export_vrml_line( aModel, layer, x, y, xf, yf, w ); break; } } @@ -1134,7 +1173,8 @@ static void export_vrml_module( MODEL_VRML& aModel, BOARD* aPcb, MODULE* aModule break; case PCB_MODULE_EDGE_T: - export_vrml_edge_module( aModel, dynamic_cast( item ) ); + export_vrml_edge_module( aModel, dynamic_cast( item ), + aModule->GetOrientation() ); break; default: diff --git a/utils/idftools/idf_cylinder.cpp b/utils/idftools/idf_cylinder.cpp index e289a0f2d6..f64a9b3d5c 100644 --- a/utils/idftools/idf_cylinder.cpp +++ b/utils/idftools/idf_cylinder.cpp @@ -177,7 +177,7 @@ int main( int argc, char **argv ) tstr.clear(); tstr.str( line ); - if( (tstr >> extraZ) && extraZ > 0.0 ) + if( (tstr >> extraZ) && extraZ >= 0.0 ) ok = true; } From fb9e5b94ca2d089fe9fcdde9b79a55b98cae7ea2 Mon Sep 17 00:00:00 2001 From: Marco Serantoni Date: Sat, 15 Feb 2014 11:01:27 +0100 Subject: [PATCH 09/16] [MacOSX] support for plugins in the bundle --- pcbnew/CMakeLists.txt | 10 +++++++++- pcbnew/pcbnew.cpp | 8 ++++---- scripting/kicadplugins.i | 7 +++++-- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/pcbnew/CMakeLists.txt b/pcbnew/CMakeLists.txt index c1cf74bd32..6845afbdc1 100644 --- a/pcbnew/CMakeLists.txt +++ b/pcbnew/CMakeLists.txt @@ -607,6 +607,13 @@ if( KICAD_SCRIPTING ) DEPENDS FixSwigImportsScripting _pcbnew_py_copy COMMENT "Copying wxPython into pcbnew.app Framework" ) + + add_custom_target( pcbnew_copy_plugins ALL + COMMAND ${CMAKE_COMMAND} -E copy_directory ${PROJECT_SOURCE_DIR}/pcbnew/scripting/plugins ${PROJECT_SOURCE_DIR}/pcbnew/pcbnew.app/Contents/PlugIns/scripting/plugins + DEPENDS pcbnew_copy_wxpython_scripting + COMMENT "Copying plugins into bundle" + ) + # fix bundle after copying wxpython, fixing and copying add_dependencies( osx_fix_bundles pcbnew_copy_wxpython_scripting ) endif() @@ -636,10 +643,11 @@ if( KICAD_SCRIPTING_MODULES ) ) add_custom_target( pcbnew_copy_wxpython_module ALL - COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBWXPYTHON_ROOT}/wxPython ${CMAKE_SOURCE_DIR}/pcbnew/pcbnew.app/Contents/Frameworks/wxPython + COMMAND ${CMAKE_COMMAND} -E copy_directory ${LIBWXPYTHON_ROOT}/wxPython ${PROJECT_SOURCE_DIR}/pcbnew/pcbnew.app/Contents/Frameworks/wxPython DEPENDS FixSwigImportsModuleScripting _pcbnew_so_copy COMMENT "Copying wxPython into pcbnew.app Frameworks" ) + # Tell that we have to run osx_fix_bundles fix after building _pcbnew and migrating wxPython add_dependencies( osx_fix_bundles pcbnew_copy_wxpython_module ) add_dependencies( osx_fix_bundles _pcbnew ) diff --git a/pcbnew/pcbnew.cpp b/pcbnew/pcbnew.cpp index d070e1825f..a7b4db9f4c 100644 --- a/pcbnew/pcbnew.cpp +++ b/pcbnew/pcbnew.cpp @@ -170,11 +170,11 @@ bool EDA_APP::OnInit() // Prepend in PYTHONPATH the content of the bundle libraries ! wxSetEnv("PYTHONPATH",((wxGetenv("PYTHONPATH") != NULL ) ? (wxString(wxGetenv("PYTHONPATH")) + ":") : wxString("")) + - "/Library/Application Support/kicad/scripting" + ":" + - bundledir.GetPath() + "/PlugIns" + ":" + - wxString( wxGetenv("HOME") ) + "/Library/Application Support/kicad/scripting" + bundledir.GetPath() + - "/Frameworks/wxPython/lib/python2.6/site-packages/wx-3.0-osx_cocoa" + "/Frameworks/wxPython/lib/python2.6/site-packages/wx-3.0-osx_cocoa" + ":" + + "/Library/Application Support/kicad/" + ":" + + bundledir.GetPath() + "/PlugIns" + ":" + + wxString( wxGetenv("HOME") ) + "/Library/Application Support/kicad/" ); #endif #endif diff --git a/scripting/kicadplugins.i b/scripting/kicadplugins.i index 32679ed69e..7a79f31588 100644 --- a/scripting/kicadplugins.i +++ b/scripting/kicadplugins.i @@ -80,11 +80,14 @@ def LoadPlugins( plugpath ): if kicad_path and os.path.isdir(kicad_path): plugin_directories.append(os.path.join(kicad_path, 'scripting', 'plugins')) - if sys.platform.startswith('linux') or sys.platform.startswith('darwin'): + if sys.platform.startswith('linux'): plugin_directories.append(os.environ['HOME']+'/.kicad_plugins/') plugin_directories.append(os.environ['HOME']+'/.kicad/scripting/plugins/') - + if sys.platform.startswith('darwin'): + for singlepath in sys.path: + if os.path.isdir( os.path.join( singlepath, 'scripting', 'plugins') ): + plugin_directories.append( os.path.join( singlepath, 'scripting', 'plugins') ) for plugins_dir in plugin_directories: sys.path.append(plugins_dir) From 0e42a2ffd0ea3ffb1a8d3edd81cf1fa2b0b1e0f9 Mon Sep 17 00:00:00 2001 From: Marco Serantoni Date: Sat, 15 Feb 2014 19:09:14 +0100 Subject: [PATCH 10/16] =?UTF-8?q?[MacOSX]=C2=A0wxPython=20patch=20revised?= =?UTF-8?q?=20for=20http://trac.wxwidgets.org/ticket/15957?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- patches/wxpython-3.0.0_macosx_multiarch.patch | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/patches/wxpython-3.0.0_macosx_multiarch.patch b/patches/wxpython-3.0.0_macosx_multiarch.patch index d3b70dd0ec..b3d39dc7cc 100644 --- a/patches/wxpython-3.0.0_macosx_multiarch.patch +++ b/patches/wxpython-3.0.0_macosx_multiarch.patch @@ -1,6 +1,6 @@ === modified file 'wxPython/config.py' ---- wxPython/config.py 2014-02-08 12:23:31 +0000 -+++ wxPython/config.py 2014-02-08 13:58:07 +0000 +--- wxPython/config.py 2014-02-15 10:10:05 +0000 ++++ wxPython/config.py 2014-02-15 18:05:33 +0000 @@ -22,6 +22,7 @@ import sys, os, glob, fnmatch, tempfile @@ -9,7 +9,7 @@ EGGing = 'bdist_egg' in sys.argv or 'egg_info' in sys.argv if not EGGing: -@@ -1059,10 +1060,8 @@ +@@ -1059,10 +1060,9 @@ libs = ['stdc++'] NO_SCRIPTS = 1 if ARCH != "": @@ -17,8 +17,9 @@ - cflags.append(ARCH) - lflags.append("-arch") - lflags.append(ARCH) -+ cflags.append("-arch " + re.sub(","," -arch ",ARCH)) -+ #lflags.append("-arch " + re.sub(","," -arch ",ARCH)) ++ splitArch = "-arch " + re.sub(","," -arch ",ARCH) ++ cflags.extend(splitArch.split(' ')) ++ lflags.extend(splitArch.split(' ')) if not os.environ.get('CC') or not os.environ.get('CXX'): os.environ["CXX"] = getWxConfigValue('--cxx') From 40b30d43d33230b2eb453271629768fcafa52439 Mon Sep 17 00:00:00 2001 From: unknown Date: Mon, 17 Feb 2014 19:42:52 +0100 Subject: [PATCH 11/16] GLM (tool for opengl) update to 0.9.4.6 --- include/gal/opengl/glm/core/_detail.hpp | 11 +- include/gal/opengl/glm/core/_fixes.hpp | 2 +- include/gal/opengl/glm/core/_swizzle.hpp | 105 +++++---- include/gal/opengl/glm/core/_swizzle_func.hpp | 2 +- include/gal/opengl/glm/core/_vectorize.hpp | 2 +- include/gal/opengl/glm/core/dummy.cpp | 2 +- include/gal/opengl/glm/core/func_common.hpp | 100 ++++----- include/gal/opengl/glm/core/func_common.inl | 211 ++++++++++-------- .../gal/opengl/glm/core/func_exponential.hpp | 22 +- .../gal/opengl/glm/core/func_exponential.inl | 3 +- .../gal/opengl/glm/core/func_geometric.hpp | 18 +- .../gal/opengl/glm/core/func_geometric.inl | 5 +- include/gal/opengl/glm/core/func_integer.hpp | 26 +-- include/gal/opengl/glm/core/func_integer.inl | 20 +- include/gal/opengl/glm/core/func_matrix.hpp | 20 +- include/gal/opengl/glm/core/func_matrix.inl | 2 +- include/gal/opengl/glm/core/func_noise.hpp | 10 +- include/gal/opengl/glm/core/func_noise.inl | 2 +- include/gal/opengl/glm/core/func_packing.hpp | 26 +-- include/gal/opengl/glm/core/func_packing.inl | 38 +++- .../opengl/glm/core/func_trigonometric.hpp | 32 +-- .../opengl/glm/core/func_trigonometric.inl | 2 +- .../glm/core/func_vector_relational.hpp | 20 +- .../glm/core/func_vector_relational.inl | 2 +- include/gal/opengl/glm/core/hint.hpp | 2 +- .../gal/opengl/glm/core/intrinsic_common.hpp | 2 +- .../gal/opengl/glm/core/intrinsic_common.inl | 2 +- .../opengl/glm/core/intrinsic_exponential.hpp | 2 +- .../opengl/glm/core/intrinsic_exponential.inl | 2 +- .../opengl/glm/core/intrinsic_geometric.hpp | 2 +- .../opengl/glm/core/intrinsic_geometric.inl | 2 +- .../gal/opengl/glm/core/intrinsic_matrix.hpp | 2 +- .../gal/opengl/glm/core/intrinsic_matrix.inl | 2 +- .../glm/core/intrinsic_trigonometric.hpp | 2 +- .../glm/core/intrinsic_trigonometric.inl | 2 +- .../glm/core/intrinsic_vector_relational.hpp | 2 +- .../glm/core/intrinsic_vector_relational.inl | 2 +- include/gal/opengl/glm/core/setup.hpp | 166 +++++++------- include/gal/opengl/glm/core/type.hpp | 2 +- include/gal/opengl/glm/core/type_float.hpp | 2 +- include/gal/opengl/glm/core/type_gentype.hpp | 2 +- include/gal/opengl/glm/core/type_gentype.inl | 2 +- include/gal/opengl/glm/core/type_half.hpp | 32 +-- include/gal/opengl/glm/core/type_half.inl | 8 +- include/gal/opengl/glm/core/type_int.hpp | 10 +- include/gal/opengl/glm/core/type_mat.hpp | 36 +-- include/gal/opengl/glm/core/type_mat.inl | 2 +- include/gal/opengl/glm/core/type_mat2x2.hpp | 52 ++--- include/gal/opengl/glm/core/type_mat2x2.inl | 22 +- include/gal/opengl/glm/core/type_mat2x3.hpp | 46 ++-- include/gal/opengl/glm/core/type_mat2x3.inl | 22 +- include/gal/opengl/glm/core/type_mat2x4.hpp | 42 ++-- include/gal/opengl/glm/core/type_mat2x4.inl | 24 +- include/gal/opengl/glm/core/type_mat3x2.hpp | 58 ++--- include/gal/opengl/glm/core/type_mat3x2.inl | 22 +- include/gal/opengl/glm/core/type_mat3x3.hpp | 52 ++--- include/gal/opengl/glm/core/type_mat3x3.inl | 22 +- include/gal/opengl/glm/core/type_mat3x4.hpp | 46 ++-- include/gal/opengl/glm/core/type_mat3x4.inl | 22 +- include/gal/opengl/glm/core/type_mat4x2.hpp | 42 ++-- include/gal/opengl/glm/core/type_mat4x2.inl | 22 +- include/gal/opengl/glm/core/type_mat4x3.hpp | 46 ++-- include/gal/opengl/glm/core/type_mat4x3.inl | 22 +- include/gal/opengl/glm/core/type_mat4x4.hpp | 52 ++--- include/gal/opengl/glm/core/type_mat4x4.inl | 24 +- include/gal/opengl/glm/core/type_size.hpp | 2 +- include/gal/opengl/glm/core/type_vec.hpp | 2 +- include/gal/opengl/glm/core/type_vec.inl | 2 +- include/gal/opengl/glm/core/type_vec1.hpp | 2 +- include/gal/opengl/glm/core/type_vec1.inl | 2 +- include/gal/opengl/glm/core/type_vec2.hpp | 32 +-- include/gal/opengl/glm/core/type_vec2.inl | 52 +---- include/gal/opengl/glm/core/type_vec3.hpp | 30 +-- include/gal/opengl/glm/core/type_vec3.inl | 52 +---- include/gal/opengl/glm/core/type_vec4.hpp | 30 +-- include/gal/opengl/glm/core/type_vec4.inl | 52 +---- include/gal/opengl/glm/ext.hpp | 2 +- include/gal/opengl/glm/glm.hpp | 2 +- include/gal/opengl/glm/gtc/constants.hpp | 52 ++--- include/gal/opengl/glm/gtc/constants.inl | 2 +- include/gal/opengl/glm/gtc/epsilon.hpp | 2 +- include/gal/opengl/glm/gtc/epsilon.inl | 2 +- include/gal/opengl/glm/gtc/half_float.hpp | 208 +++++++++-------- include/gal/opengl/glm/gtc/half_float.inl | 13 +- include/gal/opengl/glm/gtc/matrix_access.hpp | 2 +- include/gal/opengl/glm/gtc/matrix_access.inl | 2 +- include/gal/opengl/glm/gtc/matrix_integer.hpp | 2 +- include/gal/opengl/glm/gtc/matrix_inverse.hpp | 2 +- include/gal/opengl/glm/gtc/matrix_inverse.inl | 2 +- .../gal/opengl/glm/gtc/matrix_transform.hpp | 2 +- .../gal/opengl/glm/gtc/matrix_transform.inl | 20 +- include/gal/opengl/glm/gtc/noise.hpp | 2 +- include/gal/opengl/glm/gtc/noise.inl | 2 +- include/gal/opengl/glm/gtc/quaternion.hpp | 2 +- include/gal/opengl/glm/gtc/quaternion.inl | 14 +- include/gal/opengl/glm/gtc/random.hpp | 2 +- include/gal/opengl/glm/gtc/random.inl | 2 +- include/gal/opengl/glm/gtc/reciprocal.hpp | 2 +- include/gal/opengl/glm/gtc/reciprocal.inl | 2 +- include/gal/opengl/glm/gtc/swizzle.hpp | 2 +- include/gal/opengl/glm/gtc/swizzle.inl | 2 +- include/gal/opengl/glm/gtc/type_precision.hpp | 2 +- include/gal/opengl/glm/gtc/type_precision.inl | 2 +- include/gal/opengl/glm/gtc/type_ptr.hpp | 2 +- include/gal/opengl/glm/gtc/type_ptr.inl | 19 +- include/gal/opengl/glm/gtc/ulp.hpp | 2 +- include/gal/opengl/glm/gtc/ulp.inl | 12 +- .../gal/opengl/glm/gtx/associated_min_max.hpp | 2 +- .../gal/opengl/glm/gtx/associated_min_max.inl | 2 +- include/gal/opengl/glm/gtx/bit.hpp | 2 +- include/gal/opengl/glm/gtx/bit.inl | 2 +- include/gal/opengl/glm/gtx/closest_point.hpp | 2 +- include/gal/opengl/glm/gtx/closest_point.inl | 2 +- include/gal/opengl/glm/gtx/color_cast.hpp | 2 +- include/gal/opengl/glm/gtx/color_cast.inl | 2 +- include/gal/opengl/glm/gtx/color_space.hpp | 2 +- include/gal/opengl/glm/gtx/color_space.inl | 2 +- .../gal/opengl/glm/gtx/color_space_YCoCg.hpp | 2 +- .../gal/opengl/glm/gtx/color_space_YCoCg.inl | 2 +- include/gal/opengl/glm/gtx/compatibility.hpp | 2 +- include/gal/opengl/glm/gtx/compatibility.inl | 2 +- include/gal/opengl/glm/gtx/component_wise.hpp | 2 +- include/gal/opengl/glm/gtx/component_wise.inl | 4 +- include/gal/opengl/glm/gtx/constants.hpp | 2 +- include/gal/opengl/glm/gtx/epsilon.hpp | 2 +- include/gal/opengl/glm/gtx/euler_angles.hpp | 2 +- include/gal/opengl/glm/gtx/euler_angles.inl | 6 +- include/gal/opengl/glm/gtx/extend.hpp | 2 +- include/gal/opengl/glm/gtx/extend.inl | 2 +- .../gal/opengl/glm/gtx/extented_min_max.hpp | 2 +- .../gal/opengl/glm/gtx/extented_min_max.inl | 2 +- .../gal/opengl/glm/gtx/fast_exponential.hpp | 2 +- .../gal/opengl/glm/gtx/fast_exponential.inl | 2 +- .../gal/opengl/glm/gtx/fast_square_root.hpp | 2 +- .../gal/opengl/glm/gtx/fast_square_root.inl | 2 +- .../gal/opengl/glm/gtx/fast_trigonometry.hpp | 2 +- .../gal/opengl/glm/gtx/fast_trigonometry.inl | 2 +- include/gal/opengl/glm/gtx/gradient_paint.hpp | 2 +- include/gal/opengl/glm/gtx/gradient_paint.inl | 2 +- .../glm/gtx/handed_coordinate_space.hpp | 2 +- .../glm/gtx/handed_coordinate_space.inl | 2 +- include/gal/opengl/glm/gtx/inertia.hpp | 2 +- include/gal/opengl/glm/gtx/inertia.inl | 2 +- include/gal/opengl/glm/gtx/int_10_10_10_2.hpp | 2 +- include/gal/opengl/glm/gtx/int_10_10_10_2.inl | 2 +- include/gal/opengl/glm/gtx/integer.hpp | 2 +- include/gal/opengl/glm/gtx/integer.inl | 2 +- include/gal/opengl/glm/gtx/intersect.hpp | 2 +- include/gal/opengl/glm/gtx/intersect.inl | 2 +- include/gal/opengl/glm/gtx/log_base.hpp | 2 +- include/gal/opengl/glm/gtx/log_base.inl | 2 +- .../opengl/glm/gtx/matrix_cross_product.hpp | 2 +- .../opengl/glm/gtx/matrix_cross_product.inl | 2 +- .../opengl/glm/gtx/matrix_interpolation.hpp | 2 +- .../opengl/glm/gtx/matrix_interpolation.inl | 7 +- .../opengl/glm/gtx/matrix_major_storage.hpp | 2 +- .../opengl/glm/gtx/matrix_major_storage.inl | 2 +- .../gal/opengl/glm/gtx/matrix_operation.hpp | 2 +- .../gal/opengl/glm/gtx/matrix_operation.inl | 2 +- include/gal/opengl/glm/gtx/matrix_query.hpp | 2 +- include/gal/opengl/glm/gtx/matrix_query.inl | 2 +- include/gal/opengl/glm/gtx/mixed_product.hpp | 2 +- include/gal/opengl/glm/gtx/mixed_product.inl | 2 +- include/gal/opengl/glm/gtx/multiple.hpp | 2 +- include/gal/opengl/glm/gtx/multiple.inl | 20 +- include/gal/opengl/glm/gtx/noise.hpp | 2 +- include/gal/opengl/glm/gtx/norm.hpp | 2 +- include/gal/opengl/glm/gtx/norm.inl | 2 +- include/gal/opengl/glm/gtx/normal.hpp | 2 +- include/gal/opengl/glm/gtx/normal.inl | 2 +- include/gal/opengl/glm/gtx/normalize_dot.hpp | 2 +- include/gal/opengl/glm/gtx/normalize_dot.inl | 2 +- .../gal/opengl/glm/gtx/number_precision.hpp | 2 +- .../gal/opengl/glm/gtx/number_precision.inl | 2 +- include/gal/opengl/glm/gtx/ocl_type.hpp | 10 +- include/gal/opengl/glm/gtx/ocl_type.inl | 27 +++ include/gal/opengl/glm/gtx/optimum_pow.hpp | 2 +- include/gal/opengl/glm/gtx/optimum_pow.inl | 2 +- include/gal/opengl/glm/gtx/orthonormalize.hpp | 2 +- include/gal/opengl/glm/gtx/orthonormalize.inl | 2 +- include/gal/opengl/glm/gtx/perpendicular.hpp | 2 +- include/gal/opengl/glm/gtx/perpendicular.inl | 2 +- .../gal/opengl/glm/gtx/polar_coordinates.hpp | 14 +- .../gal/opengl/glm/gtx/polar_coordinates.inl | 4 +- include/gal/opengl/glm/gtx/projection.hpp | 2 +- include/gal/opengl/glm/gtx/projection.inl | 2 +- include/gal/opengl/glm/gtx/quaternion.hpp | 5 +- include/gal/opengl/glm/gtx/quaternion.inl | 15 +- include/gal/opengl/glm/gtx/random.hpp | 2 +- include/gal/opengl/glm/gtx/raw_data.hpp | 2 +- include/gal/opengl/glm/gtx/raw_data.inl | 2 +- include/gal/opengl/glm/gtx/reciprocal.hpp | 2 +- include/gal/opengl/glm/gtx/rotate_vector.hpp | 2 +- include/gal/opengl/glm/gtx/rotate_vector.inl | 8 +- include/gal/opengl/glm/gtx/simd_mat4.hpp | 2 +- include/gal/opengl/glm/gtx/simd_mat4.inl | 2 +- include/gal/opengl/glm/gtx/simd_vec4.hpp | 6 +- include/gal/opengl/glm/gtx/simd_vec4.inl | 4 +- include/gal/opengl/glm/gtx/spline.hpp | 2 +- include/gal/opengl/glm/gtx/spline.inl | 2 +- include/gal/opengl/glm/gtx/std_based_type.hpp | 2 +- include/gal/opengl/glm/gtx/std_based_type.inl | 2 +- include/gal/opengl/glm/gtx/string_cast.hpp | 2 +- include/gal/opengl/glm/gtx/transform.hpp | 2 +- include/gal/opengl/glm/gtx/transform.inl | 2 +- include/gal/opengl/glm/gtx/transform2.hpp | 2 +- include/gal/opengl/glm/gtx/transform2.inl | 2 +- include/gal/opengl/glm/gtx/ulp.hpp | 2 +- include/gal/opengl/glm/gtx/unsigned_int.hpp | 2 +- include/gal/opengl/glm/gtx/unsigned_int.inl | 2 +- include/gal/opengl/glm/gtx/vec1.hpp | 2 +- include/gal/opengl/glm/gtx/vec1.inl | 27 +++ include/gal/opengl/glm/gtx/vector_access.hpp | 2 +- include/gal/opengl/glm/gtx/vector_access.inl | 2 +- include/gal/opengl/glm/gtx/vector_angle.hpp | 2 +- include/gal/opengl/glm/gtx/vector_angle.inl | 2 +- include/gal/opengl/glm/gtx/vector_query.hpp | 2 +- include/gal/opengl/glm/gtx/vector_query.inl | 2 +- .../gal/opengl/glm/gtx/verbose_operator.hpp | 2 +- .../gal/opengl/glm/gtx/verbose_operator.inl | 2 +- include/gal/opengl/glm/gtx/wrap.hpp | 2 +- include/gal/opengl/glm/gtx/wrap.inl | 2 +- include/gal/opengl/glm/virtrev/xstream.hpp | 2 +- 223 files changed, 1298 insertions(+), 1316 deletions(-) diff --git a/include/gal/opengl/glm/core/_detail.hpp b/include/gal/opengl/glm/core/_detail.hpp index ecc9250ecf..e6b42c26ed 100644 --- a/include/gal/opengl/glm/core/_detail.hpp +++ b/include/gal/opengl/glm/core/_detail.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) +/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) /// Permission is hereby granted, free of charge, to any person obtaining a copy /// of this software and associated documentation files (the "Software"), to deal /// in the Software without restriction, including without limitation the rights @@ -445,7 +445,14 @@ namespace detail # define GLM_RESTRICT __declspec(restrict) # define GLM_RESTRICT_VAR __restrict # define GLM_CONSTEXPR -#elif((GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_LLVM_GCC)) && (GLM_COMPILER >= GLM_COMPILER_GCC31)) +#elif(GLM_COMPILER & GLM_COMPILER_INTEL) +# define GLM_DEPRECATED +# define GLM_ALIGN(x) __declspec(align(x)) +# define GLM_ALIGNED_STRUCT(x) __declspec(align(x)) struct +# define GLM_RESTRICT +# define GLM_RESTRICT_VAR __restrict +# define GLM_CONSTEXPR +#elif(((GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_LLVM_GCC)) && (GLM_COMPILER >= GLM_COMPILER_GCC31)) || (GLM_COMPILER & GLM_COMPILER_CLANG)) # define GLM_DEPRECATED __attribute__((__deprecated__)) # define GLM_ALIGN(x) __attribute__((aligned(x))) # define GLM_ALIGNED_STRUCT(x) struct __attribute__((aligned(x))) diff --git a/include/gal/opengl/glm/core/_fixes.hpp b/include/gal/opengl/glm/core/_fixes.hpp index 1b4dddaac7..b4cec5f259 100644 --- a/include/gal/opengl/glm/core/_fixes.hpp +++ b/include/gal/opengl/glm/core/_fixes.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) +/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) /// Permission is hereby granted, free of charge, to any person obtaining a copy /// of this software and associated documentation files (the "Software"), to deal /// in the Software without restriction, including without limitation the rights diff --git a/include/gal/opengl/glm/core/_swizzle.hpp b/include/gal/opengl/glm/core/_swizzle.hpp index e234a02719..dc069443f7 100644 --- a/include/gal/opengl/glm/core/_swizzle.hpp +++ b/include/gal/opengl/glm/core/_swizzle.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) +/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) /// Permission is hereby granted, free of charge, to any person obtaining a copy /// of this software and associated documentation files (the "Software"), to deal /// in the Software without restriction, including without limitation the rights @@ -60,8 +60,8 @@ namespace detail typedef T value_type; protected: - value_type& elem (size_t i) { return (reinterpret_cast(_buffer))[i]; } - const value_type& elem (size_t i) const { return (reinterpret_cast(_buffer))[i]; } + GLM_FUNC_QUALIFIER value_type& elem (size_t i) { return (reinterpret_cast(_buffer))[i]; } + GLM_FUNC_QUALIFIER const value_type& elem (size_t i) const { return (reinterpret_cast(_buffer))[i]; } // Use an opaque buffer to *ensure* the compiler doesn't call a constructor. // The size 1 buffer is assumed to aligned to the actual members so that the @@ -77,19 +77,19 @@ namespace detail template struct _swizzle_base1 : public _swizzle_base0 { - V operator ()() const { return V(this->elem(E0), this->elem(E1)); } + GLM_FUNC_QUALIFIER V operator ()() const { return V(this->elem(E0), this->elem(E1)); } }; template struct _swizzle_base1 : public _swizzle_base0 { - V operator ()() const { return V(this->elem(E0), this->elem(E1), this->elem(E2)); } + GLM_FUNC_QUALIFIER V operator ()() const { return V(this->elem(E0), this->elem(E1), this->elem(E2)); } }; template struct _swizzle_base1 : public _swizzle_base0 { - V operator ()() const { return V(this->elem(E0), this->elem(E1), this->elem(E2), this->elem(E3)); } + GLM_FUNC_QUALIFIER V operator ()() const { return V(this->elem(E0), this->elem(E1), this->elem(E2), this->elem(E3)); } }; // Internal class for implementing swizzle operators @@ -110,67 +110,73 @@ namespace detail typedef VecType vec_type; typedef ValueType value_type; - _swizzle_base2& operator= (const ValueType& t) + GLM_FUNC_QUALIFIER _swizzle_base2& operator= (const ValueType& t) { for (int i = 0; i < N; ++i) (*this)[i] = t; return *this; } - _swizzle_base2& operator= (const VecType& that) + GLM_FUNC_QUALIFIER _swizzle_base2& operator= (const VecType& that) { struct op { - void operator() (value_type& e, value_type& t) { e = t; } + GLM_FUNC_QUALIFIER void operator() (value_type& e, value_type& t) { e = t; } }; _apply_op(that, op()); return *this; } - void operator -= (const VecType& that) + GLM_FUNC_QUALIFIER void operator -= (const VecType& that) { struct op { - void operator() (value_type& e, value_type& t) { e -= t; } + GLM_FUNC_QUALIFIER void operator() (value_type& e, value_type& t) { e -= t; } }; _apply_op(that, op()); } - void operator += (const VecType& that) + GLM_FUNC_QUALIFIER void operator += (const VecType& that) { struct op { - void operator() (value_type& e, value_type& t) { e += t; } + GLM_FUNC_QUALIFIER void operator() (value_type& e, value_type& t) { e += t; } }; _apply_op(that, op()); } - void operator *= (const VecType& that) + GLM_FUNC_QUALIFIER void operator *= (const VecType& that) { struct op { - void operator() (value_type& e, value_type& t) { e *= t; } + GLM_FUNC_QUALIFIER void operator() (value_type& e, value_type& t) { e *= t; } }; _apply_op(that, op()); } - void operator /= (const VecType& that) + GLM_FUNC_QUALIFIER void operator /= (const VecType& that) { struct op { - void operator() (value_type& e, value_type& t) { e /= t; } + GLM_FUNC_QUALIFIER void operator() (value_type& e, value_type& t) { e /= t; } }; _apply_op(that, op()); } - value_type& operator[] (size_t i) + GLM_FUNC_QUALIFIER value_type& operator[] (size_t i) { - static const int offset_dst[4] = { E0, E1, E2, E3 }; +#ifndef __CUDA_ARCH__ + static +#endif + const int offset_dst[4] = { E0, E1, E2, E3 }; return this->elem(offset_dst[i]); } - value_type operator[] (size_t i) const + GLM_FUNC_QUALIFIER value_type operator[] (size_t i) const { - static const int offset_dst[4] = { E0, E1, E2, E3 }; +#ifndef __CUDA_ARCH__ + static +#endif + const int offset_dst[4] = { E0, E1, E2, E3 }; return this->elem(offset_dst[i]); } protected: template - void _apply_op(const VecType& that, T op) + GLM_FUNC_QUALIFIER void _apply_op(const VecType& that, T op) { // Make a copy of the data in this == &that. // The copier should optimize out the copy in cases where the function is @@ -191,11 +197,14 @@ namespace detail typedef ValueType value_type; struct Stub {}; - _swizzle_base2& operator= (Stub const &) {} + GLM_FUNC_QUALIFIER _swizzle_base2& operator= (Stub const &) { return *this; } - value_type operator[] (size_t i) const + GLM_FUNC_QUALIFIER value_type operator[] (size_t i) const { - static const int offset_dst[4] = { E0, E1, E2, E3 }; +#ifndef __CUDA_ARCH__ + static +#endif + const int offset_dst[4] = { E0, E1, E2, E3 }; return this->elem(offset_dst[i]); } }; @@ -207,7 +216,7 @@ namespace detail using base_type::operator=; - operator VecType () const { return (*this)(); } + GLM_FUNC_QUALIFIER operator VecType () const { return (*this)(); } }; // @@ -223,17 +232,17 @@ namespace detail // #define _GLM_SWIZZLE_VECTOR_BINARY_OPERATOR_IMPLEMENTATION(OPERAND) \ _GLM_SWIZZLE_TEMPLATE2 \ - V operator OPERAND ( const _GLM_SWIZZLE_TYPE1& a, const _GLM_SWIZZLE_TYPE2& b) \ + GLM_FUNC_QUALIFIER V operator OPERAND ( const _GLM_SWIZZLE_TYPE1& a, const _GLM_SWIZZLE_TYPE2& b) \ { \ return a() OPERAND b(); \ } \ _GLM_SWIZZLE_TEMPLATE1 \ - V operator OPERAND ( const _GLM_SWIZZLE_TYPE1& a, const V& b) \ + GLM_FUNC_QUALIFIER V operator OPERAND ( const _GLM_SWIZZLE_TYPE1& a, const V& b) \ { \ return a() OPERAND b; \ } \ _GLM_SWIZZLE_TEMPLATE1 \ - V operator OPERAND ( const V& a, const _GLM_SWIZZLE_TYPE1& b) \ + GLM_FUNC_QUALIFIER V operator OPERAND ( const V& a, const _GLM_SWIZZLE_TYPE1& b) \ { \ return a OPERAND b(); \ } @@ -243,12 +252,12 @@ namespace detail // #define _GLM_SWIZZLE_SCALAR_BINARY_OPERATOR_IMPLEMENTATION(OPERAND) \ _GLM_SWIZZLE_TEMPLATE1 \ - V operator OPERAND ( const _GLM_SWIZZLE_TYPE1& a, const T& b) \ + GLM_FUNC_QUALIFIER V operator OPERAND ( const _GLM_SWIZZLE_TYPE1& a, const T& b) \ { \ return a() OPERAND b; \ } \ _GLM_SWIZZLE_TEMPLATE1 \ - V operator OPERAND ( const T& a, const _GLM_SWIZZLE_TYPE1& b) \ + GLM_FUNC_QUALIFIER V operator OPERAND ( const T& a, const _GLM_SWIZZLE_TYPE1& b) \ { \ return a OPERAND b(); \ } @@ -258,7 +267,7 @@ namespace detail // #define _GLM_SWIZZLE_FUNCTION_1_ARGS(RETURN_TYPE,FUNCTION) \ _GLM_SWIZZLE_TEMPLATE1 \ - typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a) \ + GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a) \ { \ return FUNCTION(a()); \ } @@ -268,22 +277,22 @@ namespace detail // #define _GLM_SWIZZLE_FUNCTION_2_ARGS(RETURN_TYPE,FUNCTION) \ _GLM_SWIZZLE_TEMPLATE2 \ - typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const _GLM_SWIZZLE_TYPE2& b) \ + GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const _GLM_SWIZZLE_TYPE2& b) \ { \ return FUNCTION(a(), b()); \ } \ _GLM_SWIZZLE_TEMPLATE1 \ - typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const _GLM_SWIZZLE_TYPE1& b) \ + GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const _GLM_SWIZZLE_TYPE1& b) \ { \ return FUNCTION(a(), b()); \ } \ _GLM_SWIZZLE_TEMPLATE1 \ - typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const typename V& b) \ + GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const typename V& b) \ { \ return FUNCTION(a(), b); \ } \ _GLM_SWIZZLE_TEMPLATE1 \ - typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const V& a, const _GLM_SWIZZLE_TYPE1& b) \ + GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const V& a, const _GLM_SWIZZLE_TYPE1& b) \ { \ return FUNCTION(a, b()); \ } @@ -293,22 +302,22 @@ namespace detail // #define _GLM_SWIZZLE_FUNCTION_2_ARGS_SCALAR(RETURN_TYPE,FUNCTION) \ _GLM_SWIZZLE_TEMPLATE2 \ - typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const _GLM_SWIZZLE_TYPE2& b, const T& c) \ + GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const _GLM_SWIZZLE_TYPE2& b, const T& c) \ { \ return FUNCTION(a(), b(), c); \ } \ _GLM_SWIZZLE_TEMPLATE1 \ - typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const _GLM_SWIZZLE_TYPE1& b, const T& c) \ + GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const _GLM_SWIZZLE_TYPE1& b, const T& c) \ { \ return FUNCTION(a(), b(), c); \ } \ _GLM_SWIZZLE_TEMPLATE1 \ - typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const typename S0::vec_type& b, const T& c)\ + GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const _GLM_SWIZZLE_TYPE1& a, const typename S0::vec_type& b, const T& c)\ { \ return FUNCTION(a(), b, c); \ } \ _GLM_SWIZZLE_TEMPLATE1 \ - typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const typename V& a, const _GLM_SWIZZLE_TYPE1& b, const T& c) \ + GLM_FUNC_QUALIFIER typename _GLM_SWIZZLE_TYPE1::RETURN_TYPE FUNCTION(const typename V& a, const _GLM_SWIZZLE_TYPE1& b, const T& c) \ { \ return FUNCTION(a, b(), c); \ } @@ -640,6 +649,22 @@ namespace glm struct { glm::detail::swizzle<4,T,P,0,2,3,1> E0 ## E2 ## E3 ## E1; }; \ struct { glm::detail::swizzle<4,T,P,0,2,3,2> E0 ## E2 ## E3 ## E2; }; \ struct { glm::detail::swizzle<4,T,P,0,2,3,3> E0 ## E2 ## E3 ## E3; }; \ + struct { glm::detail::swizzle<4,T,P,0,3,0,0> E0 ## E3 ## E0 ## E0; }; \ + struct { glm::detail::swizzle<4,T,P,0,3,0,1> E0 ## E3 ## E0 ## E1; }; \ + struct { glm::detail::swizzle<4,T,P,0,3,0,2> E0 ## E3 ## E0 ## E2; }; \ + struct { glm::detail::swizzle<4,T,P,0,3,0,3> E0 ## E3 ## E0 ## E3; }; \ + struct { glm::detail::swizzle<4,T,P,0,3,1,0> E0 ## E3 ## E1 ## E0; }; \ + struct { glm::detail::swizzle<4,T,P,0,3,1,1> E0 ## E3 ## E1 ## E1; }; \ + struct { glm::detail::swizzle<4,T,P,0,3,1,2> E0 ## E3 ## E1 ## E2; }; \ + struct { glm::detail::swizzle<4,T,P,0,3,1,3> E0 ## E3 ## E1 ## E3; }; \ + struct { glm::detail::swizzle<4,T,P,0,3,2,0> E0 ## E3 ## E2 ## E0; }; \ + struct { glm::detail::swizzle<4,T,P,0,3,2,1> E0 ## E3 ## E2 ## E1; }; \ + struct { glm::detail::swizzle<4,T,P,0,3,2,2> E0 ## E3 ## E2 ## E2; }; \ + struct { glm::detail::swizzle<4,T,P,0,3,2,3> E0 ## E3 ## E2 ## E3; }; \ + struct { glm::detail::swizzle<4,T,P,0,3,3,0> E0 ## E3 ## E3 ## E0; }; \ + struct { glm::detail::swizzle<4,T,P,0,3,3,1> E0 ## E3 ## E3 ## E1; }; \ + struct { glm::detail::swizzle<4,T,P,0,3,3,2> E0 ## E3 ## E3 ## E2; }; \ + struct { glm::detail::swizzle<4,T,P,0,3,3,3> E0 ## E3 ## E3 ## E3; }; \ struct { glm::detail::swizzle<4,T,P,1,0,0,0> E1 ## E0 ## E0 ## E0; }; \ struct { glm::detail::swizzle<4,T,P,1,0,0,1> E1 ## E0 ## E0 ## E1; }; \ struct { glm::detail::swizzle<4,T,P,1,0,0,2> E1 ## E0 ## E0 ## E2; }; \ diff --git a/include/gal/opengl/glm/core/_swizzle_func.hpp b/include/gal/opengl/glm/core/_swizzle_func.hpp index 255a3ec980..be66784373 100644 --- a/include/gal/opengl/glm/core/_swizzle_func.hpp +++ b/include/gal/opengl/glm/core/_swizzle_func.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) +/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) /// Permission is hereby granted, free of charge, to any person obtaining a copy /// of this software and associated documentation files (the "Software"), to deal /// in the Software without restriction, including without limitation the rights diff --git a/include/gal/opengl/glm/core/_vectorize.hpp b/include/gal/opengl/glm/core/_vectorize.hpp index 7e14cc17ef..9984014fa8 100644 --- a/include/gal/opengl/glm/core/_vectorize.hpp +++ b/include/gal/opengl/glm/core/_vectorize.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) +/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) /// Permission is hereby granted, free of charge, to any person obtaining a copy /// of this software and associated documentation files (the "Software"), to deal /// in the Software without restriction, including without limitation the rights diff --git a/include/gal/opengl/glm/core/dummy.cpp b/include/gal/opengl/glm/core/dummy.cpp index db03cf8970..38fcca0206 100644 --- a/include/gal/opengl/glm/core/dummy.cpp +++ b/include/gal/opengl/glm/core/dummy.cpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) +/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) /// Permission is hereby granted, free of charge, to any person obtaining a copy /// of this software and associated documentation files (the "Software"), to deal /// in the Software without restriction, including without limitation the rights diff --git a/include/gal/opengl/glm/core/func_common.hpp b/include/gal/opengl/glm/core/func_common.hpp index 9ed943ccf6..fcf7eb7619 100644 --- a/include/gal/opengl/glm/core/func_common.hpp +++ b/include/gal/opengl/glm/core/func_common.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) +/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) /// Permission is hereby granted, free of charge, to any person obtaining a copy /// of this software and associated documentation files (the "Software"), to deal /// in the Software without restriction, including without limitation the rights @@ -50,7 +50,7 @@ namespace glm /// @see GLSL abs man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template - genType abs(genType const & x); + GLM_FUNC_DECL genType abs(genType const & x); /// Returns 1.0 if x > 0, 0.0 if x == 0, or -1.0 if x < 0. /// @@ -59,7 +59,7 @@ namespace glm /// @see GLSL sign man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template - genType sign(genType const & x); + GLM_FUNC_DECL genType sign(genType const & x); /// Returns a value equal to the nearest integer that is less then or equal to x. /// @@ -68,7 +68,7 @@ namespace glm /// @see GLSL floor man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template - genType floor(genType const & x); + GLM_FUNC_DECL genType floor(genType const & x); /// Returns a value equal to the nearest integer to x /// whose absolute value is not larger than the absolute value of x. @@ -78,7 +78,7 @@ namespace glm /// @see GLSL trunc man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template - genType trunc(genType const & x); + GLM_FUNC_DECL genType trunc(genType const & x); /// Returns a value equal to the nearest integer to x. /// The fraction 0.5 will round in a direction chosen by the @@ -91,7 +91,7 @@ namespace glm /// @see GLSL round man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template - genType round(genType const & x); + GLM_FUNC_DECL genType round(genType const & x); /// Returns a value equal to the nearest integer to x. /// A fractional part of 0.5 will round toward the nearest even @@ -103,7 +103,7 @@ namespace glm /// @see GLSL 4.20.8 specification, section 8.3 Common Functions /// @see New round to even technique template - genType roundEven(genType const & x); + GLM_FUNC_DECL genType roundEven(genType const & x); /// Returns a value equal to the nearest integer /// that is greater than or equal to x. @@ -113,7 +113,7 @@ namespace glm /// @see GLSL ceil man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template - genType ceil(genType const & x); + GLM_FUNC_DECL genType ceil(genType const & x); /// Return x - floor(x). /// @@ -122,7 +122,7 @@ namespace glm /// @see GLSL fract man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template - genType fract(genType const & x); + GLM_FUNC_DECL genType fract(genType const & x); /// Modulus. Returns x - y * floor(x / y) /// for each component in x using the floating point value y. @@ -132,7 +132,7 @@ namespace glm /// @see GLSL mod man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template - genType mod( + GLM_FUNC_DECL genType mod( genType const & x, genType const & y); @@ -144,7 +144,7 @@ namespace glm /// @see GLSL mod man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template - genType mod( + GLM_FUNC_DECL genType mod( genType const & x, typename genType::value_type const & y); @@ -158,7 +158,7 @@ namespace glm /// @see GLSL modf man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template - genType modf( + GLM_FUNC_DECL genType modf( genType const & x, genType & i); @@ -169,12 +169,12 @@ namespace glm /// @see GLSL min man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template - genType min( + GLM_FUNC_DECL genType min( genType const & x, genType const & y); template - genType min( + GLM_FUNC_DECL genType min( genType const & x, typename genType::value_type const & y); @@ -185,12 +185,12 @@ namespace glm /// @see GLSL max man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template - genType max( + GLM_FUNC_DECL genType max( genType const & x, genType const & y); template - genType max( + GLM_FUNC_DECL genType max( genType const & x, typename genType::value_type const & y); @@ -202,33 +202,33 @@ namespace glm /// @see GLSL clamp man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template - genType clamp( + GLM_FUNC_DECL genType clamp( genType const & x, genType const & minVal, genType const & maxVal); template - genType clamp( + GLM_FUNC_DECL genType clamp( genType const & x, typename genType::value_type const & minVal, typename genType::value_type const & maxVal); - //! @return If genTypeU is a floating scalar or vector: - //! Returns x * (1.0 - a) + y * a, i.e., the linear blend of - //! x and y using the floating-point value a. - //! The value for a is not restricted to the range [0, 1]. - //! - //! @return If genTypeU is a boolean scalar or vector: - //! Selects which vector each returned component comes - //! from. For a component of a that is false, the - //! corresponding component of x is returned. For a - //! component of a that is true, the corresponding - //! component of y is returned. Components of x and y that - //! are not selected are allowed to be invalid floating point - //! values and will have no effect on the results. Thus, this - //! provides different functionality than - //! genType mix(genType x, genType y, genType(a)) - //! where a is a Boolean vector. + /// If genTypeU is a floating scalar or vector: + /// Returns x * (1.0 - a) + y * a, i.e., the linear blend of + /// x and y using the floating-point value a. + /// The value for a is not restricted to the range [0, 1]. + /// + /// If genTypeU is a boolean scalar or vector: + /// Selects which vector each returned component comes + /// from. For a component of that is false, the + /// corresponding component of x is returned. For a + /// component of a that is true, the corresponding + /// component of y is returned. Components of x and y that + /// are not selected are allowed to be invalid floating point + /// values and will have no effect on the results. Thus, this + /// provides different functionality than + /// genType mix(genType x, genType y, genType(a)) + /// where a is a Boolean vector. /// /// @see GLSL mix man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions @@ -256,19 +256,19 @@ namespace glm /// glm::vec4 u = glm::mix(g, h, r); // Interpolations can be perform per component with a vector for the last parameter. /// @endcode template - genTypeT mix(genTypeT const & x, genTypeT const & y, genTypeU const & a); + GLM_FUNC_DECL genTypeT mix(genTypeT const & x, genTypeT const & y, genTypeU const & a); //! Returns 0.0 if x < edge, otherwise it returns 1.0. //! /// @see GLSL step man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template - genType step( + GLM_FUNC_DECL genType step( genType const & edge, genType const & x); template - genType step( + GLM_FUNC_DECL genType step( typename genType::value_type const & edge, genType const & x); @@ -278,8 +278,8 @@ namespace glm /// you would want a threshold function with a smooth /// transition. This is equivalent to: /// genType t; - /// t = clamp ((x – edge0) / (edge1 – edge0), 0, 1); - /// return t * t * (3 – 2 * t); + /// t = clamp ((x - edge0) / (edge1 - edge0), 0, 1); + /// return t * t * (3 - 2 * t); /// Results are undefined if edge0 >= edge1. /// /// @tparam genType Floating-point scalar or vector types. @@ -287,13 +287,13 @@ namespace glm /// @see GLSL smoothstep man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template - genType smoothstep( + GLM_FUNC_DECL genType smoothstep( genType const & edge0, genType const & edge1, genType const & x); template - genType smoothstep( + GLM_FUNC_DECL genType smoothstep( typename genType::value_type const & edge0, typename genType::value_type const & edge1, genType const & x); @@ -311,7 +311,7 @@ namespace glm /// @see GLSL isnan man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template - typename genType::bool_type isnan(genType const & x); + GLM_FUNC_DECL typename genType::bool_type isnan(genType const & x); /// Returns true if x holds a positive infinity or negative /// infinity representation in the underlying implementation's @@ -324,7 +324,7 @@ namespace glm /// @see GLSL isinf man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template - typename genType::bool_type isinf(genType const & x); + GLM_FUNC_DECL typename genType::bool_type isinf(genType const & x); /// Returns a signed integer value representing /// the encoding of a floating-point value. The floatingpoint @@ -336,7 +336,7 @@ namespace glm /// @see GLSL floatBitsToInt man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template - genIType floatBitsToInt(genType const & value); + GLM_FUNC_DECL genIType floatBitsToInt(genType const & value); /// Returns a unsigned integer value representing /// the encoding of a floating-point value. The floatingpoint @@ -348,7 +348,7 @@ namespace glm /// @see GLSL floatBitsToUint man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template - genUType floatBitsToUint(genType const & value); + GLM_FUNC_DECL genUType floatBitsToUint(genType const & value); /// Returns a floating-point value corresponding to a signed /// integer encoding of a floating-point value. @@ -364,7 +364,7 @@ namespace glm /// /// @todo Clarify this declaration, we don't need to actually specify the return type template - genType intBitsToFloat(genIType const & value); + GLM_FUNC_DECL genType intBitsToFloat(genIType const & value); /// Returns a floating-point value corresponding to a /// unsigned integer encoding of a floating-point value. @@ -380,7 +380,7 @@ namespace glm /// /// @todo Clarify this declaration, we don't need to actually specify the return type template - genType uintBitsToFloat(genUType const & value); + GLM_FUNC_DECL genType uintBitsToFloat(genUType const & value); /// Computes and returns a * b + c. /// @@ -389,7 +389,7 @@ namespace glm /// @see GLSL fma man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template - genType fma(genType const & a, genType const & b, genType const & c); + GLM_FUNC_DECL genType fma(genType const & a, genType const & b, genType const & c); /// Splits x into a floating-point significand in the range /// [0.5, 1.0) and an integral exponent of two, such that: @@ -406,7 +406,7 @@ namespace glm /// @see GLSL frexp man page /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template - genType frexp(genType const & x, genIType & exp); + GLM_FUNC_DECL genType frexp(genType const & x, genIType & exp); /// Builds a floating-point number from x and the /// corresponding integral exponent of two in exp, returning: @@ -420,7 +420,7 @@ namespace glm /// @see GLSL ldexp man page; /// @see GLSL 4.20.8 specification, section 8.3 Common Functions template - genType ldexp(genType const & x, genIType const & exp); + GLM_FUNC_DECL genType ldexp(genType const & x, genIType const & exp); /// @} }//namespace glm diff --git a/include/gal/opengl/glm/core/func_common.inl b/include/gal/opengl/glm/core/func_common.inl index 9c1c0470c2..1c0d9df979 100644 --- a/include/gal/opengl/glm/core/func_common.inl +++ b/include/gal/opengl/glm/core/func_common.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) +/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) /// Permission is hereby granted, free of charge, to any person obtaining a copy /// of this software and associated documentation files (the "Software"), to deal /// in the Software without restriction, including without limitation the rights @@ -36,7 +36,7 @@ namespace detail template struct Abs_ { - static genFIType get(genFIType const & x) + GLM_FUNC_QUALIFIER static genFIType get(genFIType const & x) { GLM_STATIC_ASSERT( detail::type::is_float || @@ -49,7 +49,7 @@ namespace detail template struct Abs_ { - static genFIType get(genFIType const & x) + GLM_FUNC_QUALIFIER static genFIType get(genFIType const & x) { GLM_STATIC_ASSERT( detail::type::is_uint, "'abs' only accept floating-point and integer inputs"); @@ -275,7 +275,7 @@ namespace detail //// Only valid if (INT_MIN <= x-y <= INT_MAX) //// min(x,y) //r = y + ((x - y) & ((x - y) >> (sizeof(int) * - //CHAR_BIT – 1))); + //CHAR_BIT - 1))); //// max(x,y) //r = x - ((x - y) & ((x - y) >> (sizeof(int) * //CHAR_BIT - 1))); @@ -420,93 +420,87 @@ namespace detail } // mix - template - GLM_FUNC_QUALIFIER genTypeT mix + template + GLM_FUNC_QUALIFIER genType mix ( - genTypeT const & x, - genTypeT const & y, - genTypeU const & a + genType const & x, + genType const & y, + genType const & a ) { - // It could be a vector too - //GLM_STATIC_ASSERT( - // detail::type::is_float && - // detail::type::is_float); + GLM_STATIC_ASSERT(detail::type::is_float , "'genType' is not floating-point type"); - //return x + a * (y - x); - return genTypeT(genTypeU(x) + a * genTypeU(y - x)); + return x + a * (y - x); } - template - GLM_FUNC_QUALIFIER detail::tvec2 mix + template + GLM_FUNC_QUALIFIER detail::tvec2 mix ( - detail::tvec2 const & x, - detail::tvec2 const & y, - valTypeB const & a + detail::tvec2 const & x, + detail::tvec2 const & y, + valType const & a ) { - return detail::tvec2( - detail::tvec2(x) + a * detail::tvec2(y - x)); + GLM_STATIC_ASSERT(detail::type::is_float , "'genType' is not floating-point type"); + + return x + a * (y - x); } - template - GLM_FUNC_QUALIFIER detail::tvec3 mix + template + GLM_FUNC_QUALIFIER detail::tvec3 mix ( - detail::tvec3 const & x, - detail::tvec3 const & y, - valTypeB const & a + detail::tvec3 const & x, + detail::tvec3 const & y, + valType const & a ) { - return detail::tvec3( - detail::tvec3(x) + a * detail::tvec3(y - x)); + return x + a * (y - x); } - template - GLM_FUNC_QUALIFIER detail::tvec4 mix + template + GLM_FUNC_QUALIFIER detail::tvec4 mix ( - detail::tvec4 const & x, - detail::tvec4 const & y, - valTypeB const & a + detail::tvec4 const & x, + detail::tvec4 const & y, + valType const & a ) { - return detail::tvec4( - detail::tvec4(x) + a * detail::tvec4(y - x)); + return x + a * (y - x); } - template - GLM_FUNC_QUALIFIER detail::tvec2 mix + template + GLM_FUNC_QUALIFIER detail::tvec2 mix ( - detail::tvec2 const & x, - detail::tvec2 const & y, - detail::tvec2 const & a + detail::tvec2 const & x, + detail::tvec2 const & y, + detail::tvec2 const & a ) { - return detail::tvec2( - detail::tvec2(x) + a * detail::tvec2(y - x)); + return x + a * (y - x); } - template - GLM_FUNC_QUALIFIER detail::tvec3 mix + template + GLM_FUNC_QUALIFIER detail::tvec3 mix ( - detail::tvec3 const & x, - detail::tvec3 const & y, - detail::tvec3 const & a + detail::tvec3 const & x, + detail::tvec3 const & y, + detail::tvec3 const & a ) { - return detail::tvec3( - detail::tvec3(x) + a * detail::tvec3(y - x)); + GLM_STATIC_ASSERT(detail::type::is_float , "'genType' is not floating-point type"); + + return x + a * (y - x); } - template - GLM_FUNC_QUALIFIER detail::tvec4 mix + template + GLM_FUNC_QUALIFIER detail::tvec4 mix ( - detail::tvec4 const & x, - detail::tvec4 const & y, - detail::tvec4 const & a + detail::tvec4 const & x, + detail::tvec4 const & y, + detail::tvec4 const & a ) { - return detail::tvec4( - detail::tvec4(x) + a * detail::tvec4(y - x)); + return x + a * (y - x); } //template @@ -525,15 +519,63 @@ namespace detail // return x + a * (y - x); //} - template - GLM_FUNC_QUALIFIER genType mix + template <> + GLM_FUNC_QUALIFIER float mix ( - genType const & x, - genType const & y, + float const & x, + float const & y, bool const & a ) { - GLM_STATIC_ASSERT(detail::type::is_float, "'mix' only accept floating-point inputs"); + return a ? y : x; + } + + template <> + GLM_FUNC_QUALIFIER double mix + ( + double const & x, + double const & y, + bool const & a + ) + { + return a ? y : x; + } + + template + GLM_FUNC_QUALIFIER detail::tvec2 mix + ( + detail::tvec2 const & x, + detail::tvec2 const & y, + bool a + ) + { + GLM_STATIC_ASSERT(detail::type::is_float, "'mix' only accept floating-point inputs"); + + return a ? y : x; + } + + template + GLM_FUNC_QUALIFIER detail::tvec3 mix + ( + detail::tvec3 const & x, + detail::tvec3 const & y, + bool a + ) + { + GLM_STATIC_ASSERT(detail::type::is_float, "'mix' only accept floating-point inputs"); + + return a ? y : x; + } + + template + GLM_FUNC_QUALIFIER detail::tvec4 mix + ( + detail::tvec4 const & x, + detail::tvec4 const & y, + bool a + ) + { + GLM_STATIC_ASSERT(detail::type::is_float, "'mix' only accept floating-point inputs"); return a ? y : x; } @@ -552,8 +594,7 @@ namespace detail for ( typename detail::tvec2::size_type i = 0; - i < detail::tvec2::value_size(); - ++i + i < x.length(); ++i ) { result[i] = a[i] ? y[i] : x[i]; @@ -575,8 +616,7 @@ namespace detail for ( typename detail::tvec3::size_type i = 0; - i < detail::tvec3::value_size(); - ++i + i < x.length(); ++i ) { result[i] = a[i] ? y[i] : x[i]; @@ -598,8 +638,7 @@ namespace detail for ( typename detail::tvec4::size_type i = 0; - i < detail::tvec4::value_size(); - ++i + i < x.length(); ++i ) { result[i] = a[i] ? y[i] : x[i]; @@ -803,17 +842,19 @@ namespace detail { GLM_STATIC_ASSERT(detail::type::is_float, "'isnan' only accept floating-point inputs"); -# if(GLM_COMPILER & (GLM_COMPILER_VC | GLM_COMPILER_INTEL)) +# if(GLM_COMPILER & (GLM_COMPILER_VC | GLM_COMPILER_INTEL)) return _isnan(x) != 0; -# elif(GLM_COMPILER & GLM_COMPILER_GCC) +# elif(GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_CLANG)) # if(GLM_PLATFORM & GLM_PLATFORM_ANDROID) return _isnan(x) != 0; # else return std::isnan(x); # endif -# else +# elif(GLM_COMPILER & GLM_COMPILER_CUDA) + return isnan(x) != 0; +# else return std::isnan(x); -# endif +# endif } template @@ -858,32 +899,20 @@ namespace detail { GLM_STATIC_ASSERT(detail::type::is_float, "'isinf' only accept floating-point inputs"); -# if(GLM_COMPILER & (GLM_COMPILER_INTEL | GLM_COMPILER_VC)) +# if(GLM_COMPILER & (GLM_COMPILER_INTEL | GLM_COMPILER_VC)) return _fpclass(x) == _FPCLASS_NINF || _fpclass(x) == _FPCLASS_PINF; -# elif(GLM_COMPILER & GLM_COMPILER_GCC) +# elif(GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_CLANG)) # if(GLM_PLATFORM & GLM_PLATFORM_ANDROID) return _isinf(x) != 0; # else return std::isinf(x); # endif -# else +# elif(GLM_COMPILER & GLM_COMPILER_CUDA) + // http://developer.download.nvidia.com/compute/cuda/4_2/rel/toolkit/docs/online/group__CUDA__MATH__DOUBLE_g13431dd2b40b51f9139cbb7f50c18fab.html#g13431dd2b40b51f9139cbb7f50c18fab + return isinf(double(x)) != 0; +# else return std::isinf(x); -# endif -/* -# if(GLM_COMPILER & GLM_COMPILER_VC) - return _fpclass(x) == _FPCLASS_NINF || _fpclass(x) == _FPCLASS_PINF; -# elif(GLM_COMPILER & GLM_COMPILER_GCC) -# if(GLM_PLATFORM & GLM_PLATFORM_ANDROID) - return _isinf(x) != 0; -# else - return std::isinf(x); -# endif -# elif(GLM_COMPILER & GLM_COMPILER_INTEL) - return isinf(x) != 0; -# else - return std::isinf(x); -# endif -*/ +# endif } template diff --git a/include/gal/opengl/glm/core/func_exponential.hpp b/include/gal/opengl/glm/core/func_exponential.hpp index 557ac175d2..dc76fcbb93 100644 --- a/include/gal/opengl/glm/core/func_exponential.hpp +++ b/include/gal/opengl/glm/core/func_exponential.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) +/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) /// Permission is hereby granted, free of charge, to any person obtaining a copy /// of this software and associated documentation files (the "Software"), to deal /// in the Software without restriction, including without limitation the rights @@ -41,16 +41,16 @@ namespace glm /// @addtogroup core_func_exponential /// @{ - /// Returns x raised to the y power. + /// Returns 'base' raised to the power 'exponent'. /// - /// @param x pow function is defined for input values of x defined in the range (inf-, inf+) in the limit of the type precision. - /// @param y + /// @param base Floating point value. pow function is defined for input values of x defined in the range (inf-, inf+) in the limit of the type precision. + /// @param exponent Floating point value representing the 'exponent'. /// @tparam genType Floating-point scalar or vector types. /// /// @see GLSL pow man page /// @see GLSL 4.20.8 specification, section 8.2 Exponential Functions template - genType pow(genType const & x, genType const & y); + GLM_FUNC_DECL genType pow(genType const & base, genType const & exponent); /// Returns the natural exponentiation of x, i.e., e^x. /// @@ -60,7 +60,7 @@ namespace glm /// @see GLSL exp man page /// @see GLSL 4.20.8 specification, section 8.2 Exponential Functions template - genType exp(genType const & x); + GLM_FUNC_DECL genType exp(genType const & x); /// Returns the natural logarithm of x, i.e., /// returns the value y which satisfies the equation x = e^y. @@ -72,7 +72,7 @@ namespace glm /// @see GLSL log man page /// @see GLSL 4.20.8 specification, section 8.2 Exponential Functions template - genType log(genType const & x); + GLM_FUNC_DECL genType log(genType const & x); /// Returns 2 raised to the x power. /// @@ -82,7 +82,7 @@ namespace glm /// @see GLSL exp2 man page /// @see GLSL 4.20.8 specification, section 8.2 Exponential Functions template - genType exp2(genType const & x); + GLM_FUNC_DECL genType exp2(genType const & x); /// Returns the base 2 log of x, i.e., returns the value y, /// which satisfies the equation x = 2 ^ y. @@ -93,7 +93,7 @@ namespace glm /// @see GLSL log2 man page /// @see GLSL 4.20.8 specification, section 8.2 Exponential Functions template - genType log2(genType const & x); + GLM_FUNC_DECL genType log2(genType const & x); /// Returns the positive square root of x. /// @@ -103,7 +103,7 @@ namespace glm /// @see GLSL sqrt man page /// @see GLSL 4.20.8 specification, section 8.2 Exponential Functions template - genType sqrt(genType const & x); + GLM_FUNC_DECL genType sqrt(genType const & x); /// Returns the reciprocal of the positive square root of x. /// @@ -113,7 +113,7 @@ namespace glm /// @see GLSL inversesqrt man page /// @see GLSL 4.20.8 specification, section 8.2 Exponential Functions template - genType inversesqrt(genType const & x); + GLM_FUNC_DECL genType inversesqrt(genType const & x); /// @} }//namespace glm diff --git a/include/gal/opengl/glm/core/func_exponential.inl b/include/gal/opengl/glm/core/func_exponential.inl index 6ae709c6de..1b08786df6 100644 --- a/include/gal/opengl/glm/core/func_exponential.inl +++ b/include/gal/opengl/glm/core/func_exponential.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) +/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) /// Permission is hereby granted, free of charge, to any person obtaining a copy /// of this software and associated documentation files (the "Software"), to deal /// in the Software without restriction, including without limitation the rights @@ -146,6 +146,7 @@ namespace _detail ) { GLM_STATIC_ASSERT(detail::type::is_float, "'inversesqrt' only accept floating-point input"); + assert(x > genType(0)); return genType(1) / ::std::sqrt(x); } diff --git a/include/gal/opengl/glm/core/func_geometric.hpp b/include/gal/opengl/glm/core/func_geometric.hpp index 1c92e1b88b..c221084f14 100644 --- a/include/gal/opengl/glm/core/func_geometric.hpp +++ b/include/gal/opengl/glm/core/func_geometric.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) +/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) /// Permission is hereby granted, free of charge, to any person obtaining a copy /// of this software and associated documentation files (the "Software"), to deal /// in the Software without restriction, including without limitation the rights @@ -48,7 +48,7 @@ namespace glm /// @see GLSL length man page /// @see GLSL 4.20.8 specification, section 8.5 Geometric Functions template - typename genType::value_type length( + GLM_FUNC_DECL typename genType::value_type length( genType const & x); /// Returns the distance betwwen p0 and p1, i.e., length(p0 - p1). @@ -58,7 +58,7 @@ namespace glm /// @see GLSL distance man page /// @see GLSL 4.20.8 specification, section 8.5 Geometric Functions template - typename genType::value_type distance( + GLM_FUNC_DECL typename genType::value_type distance( genType const & p0, genType const & p1); @@ -69,7 +69,7 @@ namespace glm /// @see GLSL dot man page /// @see GLSL 4.20.8 specification, section 8.5 Geometric Functions template - typename genType::value_type dot( + GLM_FUNC_DECL typename genType::value_type dot( genType const & x, genType const & y); @@ -80,7 +80,7 @@ namespace glm /// @see GLSL cross man page /// @see GLSL 4.20.8 specification, section 8.5 Geometric Functions template - detail::tvec3 cross( + GLM_FUNC_DECL detail::tvec3 cross( detail::tvec3 const & x, detail::tvec3 const & y); @@ -89,7 +89,7 @@ namespace glm /// @see GLSL normalize man page /// @see GLSL 4.20.8 specification, section 8.5 Geometric Functions template - genType normalize( + GLM_FUNC_DECL genType normalize( genType const & x); /// If dot(Nref, I) < 0.0, return N, otherwise, return -N. @@ -99,7 +99,7 @@ namespace glm /// @see GLSL faceforward man page /// @see GLSL 4.20.8 specification, section 8.5 Geometric Functions template - genType faceforward( + GLM_FUNC_DECL genType faceforward( genType const & N, genType const & I, genType const & Nref); @@ -112,7 +112,7 @@ namespace glm /// @see GLSL reflect man page /// @see GLSL 4.20.8 specification, section 8.5 Geometric Functions template - genType reflect( + GLM_FUNC_DECL genType reflect( genType const & I, genType const & N); @@ -125,7 +125,7 @@ namespace glm /// @see GLSL refract man page /// @see GLSL 4.20.8 specification, section 8.5 Geometric Functions template - genType refract( + GLM_FUNC_DECL genType refract( genType const & I, genType const & N, typename genType::value_type const & eta); diff --git a/include/gal/opengl/glm/core/func_geometric.inl b/include/gal/opengl/glm/core/func_geometric.inl index 1923d05d1b..259a0ffdf9 100644 --- a/include/gal/opengl/glm/core/func_geometric.inl +++ b/include/gal/opengl/glm/core/func_geometric.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) +/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) /// Permission is hereby granted, free of charge, to any person obtaining a copy /// of this software and associated documentation files (the "Software"), to deal /// in the Software without restriction, including without limitation the rights @@ -132,7 +132,6 @@ namespace glm ( genType const & x, genType const & y - ) { GLM_STATIC_ASSERT(detail::type::is_float, "'dot' only accept floating-point inputs"); @@ -271,7 +270,7 @@ namespace glm // reflect template - genType reflect + GLM_FUNC_QUALIFIER genType reflect ( genType const & I, genType const & N diff --git a/include/gal/opengl/glm/core/func_integer.hpp b/include/gal/opengl/glm/core/func_integer.hpp index affbcd8fa5..df9a401591 100644 --- a/include/gal/opengl/glm/core/func_integer.hpp +++ b/include/gal/opengl/glm/core/func_integer.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) +/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) /// Permission is hereby granted, free of charge, to any person obtaining a copy /// of this software and associated documentation files (the "Software"), to deal /// in the Software without restriction, including without limitation the rights @@ -52,7 +52,7 @@ namespace glm /// @see GLSL uaddCarry man page /// @see GLSL 4.20.8 specification, section 8.8 Integer Functions template - genUType uaddCarry( + GLM_FUNC_DECL genUType uaddCarry( genUType const & x, genUType const & y, genUType & carry); @@ -66,7 +66,7 @@ namespace glm /// @see GLSL usubBorrow man page /// @see GLSL 4.20.8 specification, section 8.8 Integer Functions template - genUType usubBorrow( + GLM_FUNC_DECL genUType usubBorrow( genUType const & x, genUType const & y, genUType & borrow); @@ -80,7 +80,7 @@ namespace glm /// @see GLSL umulExtended man page /// @see GLSL 4.20.8 specification, section 8.8 Integer Functions template - void umulExtended( + GLM_FUNC_DECL void umulExtended( genUType const & x, genUType const & y, genUType & msb, @@ -95,7 +95,7 @@ namespace glm /// @see GLSL imulExtended man page /// @see GLSL 4.20.8 specification, section 8.8 Integer Functions template - void imulExtended( + GLM_FUNC_DECL void imulExtended( genIType const & x, genIType const & y, genIType & msb, @@ -105,7 +105,7 @@ namespace glm /// returning them in the least significant bits of the result. /// For unsigned data types, the most significant bits of the /// result will be set to zero. For signed data types, the - /// most significant bits will be set to the value of bit offset + base – 1. + /// most significant bits will be set to the value of bit offset + base - 1. /// /// If bits is zero, the result will be zero. The result will be /// undefined if offset or bits is negative, or if the sum of @@ -117,7 +117,7 @@ namespace glm /// @see GLSL bitfieldExtract man page /// @see GLSL 4.20.8 specification, section 8.8 Integer Functions template - genIUType bitfieldExtract( + GLM_FUNC_DECL genIUType bitfieldExtract( genIUType const & Value, int const & Offset, int const & Bits); @@ -125,7 +125,7 @@ namespace glm /// Returns the insertion the bits least-significant bits of insert into base. /// /// The result will have bits [offset, offset + bits - 1] taken - /// from bits [0, bits – 1] of insert, and all other bits taken + /// from bits [0, bits - 1] of insert, and all other bits taken /// directly from the corresponding bits of base. If bits is /// zero, the result will simply be base. The result will be /// undefined if offset or bits is negative, or if the sum of @@ -137,7 +137,7 @@ namespace glm /// @see GLSL bitfieldInsert man page /// @see GLSL 4.20.8 specification, section 8.8 Integer Functions template - genIUType bitfieldInsert( + GLM_FUNC_DECL genIUType bitfieldInsert( genIUType const & Base, genIUType const & Insert, int const & Offset, @@ -152,7 +152,7 @@ namespace glm /// @see GLSL bitfieldReverse man page /// @see GLSL 4.20.8 specification, section 8.8 Integer Functions template - genIUType bitfieldReverse(genIUType const & Value); + GLM_FUNC_DECL genIUType bitfieldReverse(genIUType const & Value); /// Returns the number of bits set to 1 in the binary representation of value. /// @@ -163,7 +163,7 @@ namespace glm /// /// @todo Clarify the declaration to specify that scalars are suported. template class genIUType> - typename genIUType::signed_type bitCount(genIUType const & Value); + GLM_FUNC_DECL typename genIUType::signed_type bitCount(genIUType const & Value); /// Returns the bit number of the least significant bit set to /// 1 in the binary representation of value. @@ -176,7 +176,7 @@ namespace glm /// /// @todo Clarify the declaration to specify that scalars are suported. template class genIUType> - typename genIUType::signed_type findLSB(genIUType const & Value); + GLM_FUNC_DECL typename genIUType::signed_type findLSB(genIUType const & Value); /// Returns the bit number of the most significant bit in the binary representation of value. /// For positive integers, the result will be the bit number of the most significant bit set to 1. @@ -190,7 +190,7 @@ namespace glm /// /// @todo Clarify the declaration to specify that scalars are suported. template class genIUType> - typename genIUType::signed_type findMSB(genIUType const & Value); + GLM_FUNC_DECL typename genIUType::signed_type findMSB(genIUType const & Value); /// @} }//namespace glm diff --git a/include/gal/opengl/glm/core/func_integer.inl b/include/gal/opengl/glm/core/func_integer.inl index ae7bf8af36..ad8b1fe83c 100644 --- a/include/gal/opengl/glm/core/func_integer.inl +++ b/include/gal/opengl/glm/core/func_integer.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) +/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) /// Permission is hereby granted, free of charge, to any person obtaining a copy /// of this software and associated documentation files (the "Software"), to deal /// in the Software without restriction, including without limitation the rights @@ -26,10 +26,12 @@ /// @author Christophe Riccio /////////////////////////////////////////////////////////////////////////////////// +#if(GLM_ARCH != GLM_ARCH_PURE) #if(GLM_COMPILER & GLM_COMPILER_VC) -#include -#pragma intrinsic(_BitScanReverse) -#endif +# include +# pragma intrinsic(_BitScanReverse) +#endif//(GLM_COMPILER & GLM_COMPILER_VC) +#endif//(GLM_ARCH != GLM_ARCH_PURE) namespace glm { @@ -103,7 +105,7 @@ namespace glm if(x > y) return genUType(detail::highp_int_t(x) - detail::highp_int_t(y)); else - return genUType(detail::highp_int_t(1) << detail::highp_int_t(32) + detail::highp_int_t(x) - detail::highp_int_t(y)); + return genUType((detail::highp_int_t(1) << detail::highp_int_t(32)) + detail::highp_int_t(x) - detail::highp_int_t(y)); } template @@ -521,7 +523,6 @@ namespace glm } // findMSB -/* #if((GLM_ARCH != GLM_ARCH_PURE) && (GLM_COMPILER & GLM_COMPILER_VC)) template @@ -538,7 +539,7 @@ namespace glm _BitScanReverse(&Result, Value); return int(Result); } - +/* // __builtin_clz seems to be buggy as it crasks for some values, from 0x00200000 to 80000000 #elif((GLM_ARCH != GLM_ARCH_PURE) && (GLM_COMPILER & GLM_COMPILER_GCC) && (GLM_COMPILER >= GLM_COMPILER_GCC40)) @@ -560,8 +561,9 @@ namespace glm // return 31 - __builtin_clzl(Value); } -#else */ +#else + /* SSE implementation idea __m128i const Zero = _mm_set_epi32( 0, 0, 0, 0); @@ -606,7 +608,7 @@ namespace glm return MostSignificantBit; } } -//#endif//(GLM_COMPILER) +#endif//(GLM_COMPILER) template GLM_FUNC_QUALIFIER detail::tvec2 findMSB diff --git a/include/gal/opengl/glm/core/func_matrix.hpp b/include/gal/opengl/glm/core/func_matrix.hpp index ac1fda8482..3c92cbbaba 100644 --- a/include/gal/opengl/glm/core/func_matrix.hpp +++ b/include/gal/opengl/glm/core/func_matrix.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) +/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) /// Permission is hereby granted, free of charge, to any person obtaining a copy /// of this software and associated documentation files (the "Software"), to deal /// in the Software without restriction, including without limitation the rights @@ -53,7 +53,7 @@ namespace glm /// @see GLSL matrixCompMult man page /// @see GLSL 4.20.8 specification, section 8.6 Matrix Functions template - matType matrixCompMult( + GLM_FUNC_DECL matType matrixCompMult( matType const & x, matType const & y); @@ -68,7 +68,7 @@ namespace glm /// /// @todo Clarify the declaration to specify that matType doesn't have to be provided when used. template - matType outerProduct( + GLM_FUNC_DECL matType outerProduct( vecType const & c, vecType const & r); @@ -79,7 +79,7 @@ namespace glm /// @see GLSL transpose man page /// @see GLSL 4.20.8 specification, section 8.6 Matrix Functions template - typename matType::transpose_type transpose( + GLM_FUNC_DECL typename matType::transpose_type transpose( matType const & x); /// Return the determinant of a mat2 matrix. @@ -89,7 +89,7 @@ namespace glm /// @see GLSL determinant man page /// @see GLSL 4.20.8 specification, section 8.6 Matrix Functions template - typename detail::tmat2x2::value_type determinant( + GLM_FUNC_DECL typename detail::tmat2x2::value_type determinant( detail::tmat2x2 const & m); /// Return the determinant of a mat3 matrix. @@ -99,7 +99,7 @@ namespace glm /// @see GLSL determinant man page /// @see GLSL 4.20.8 specification, section 8.6 Matrix Functions template - typename detail::tmat3x3::value_type determinant( + GLM_FUNC_DECL typename detail::tmat3x3::value_type determinant( detail::tmat3x3 const & m); /// Return the determinant of a mat4 matrix. @@ -109,7 +109,7 @@ namespace glm /// @see GLSL determinant man page /// @see GLSL 4.20.8 specification, section 8.6 Matrix Functions template - typename detail::tmat4x4::value_type determinant( + GLM_FUNC_DECL typename detail::tmat4x4::value_type determinant( detail::tmat4x4 const & m); /// Return the inverse of a mat2 matrix. @@ -119,7 +119,7 @@ namespace glm /// @see GLSL inverse man page /// @see GLSL 4.20.8 specification, section 8.6 Matrix Functions template - detail::tmat2x2 inverse( + GLM_FUNC_DECL detail::tmat2x2 inverse( detail::tmat2x2 const & m); /// Return the inverse of a mat3 matrix. @@ -129,7 +129,7 @@ namespace glm /// @see GLSL inverse man page /// @see GLSL 4.20.8 specification, section 8.6 Matrix Functions template - detail::tmat3x3 inverse( + GLM_FUNC_DECL detail::tmat3x3 inverse( detail::tmat3x3 const & m); /// Return the inverse of a mat4 matrix. @@ -139,7 +139,7 @@ namespace glm /// @see GLSL inverse man page /// @see GLSL 4.20.8 specification, section 8.6 Matrix Functions template - detail::tmat4x4 inverse( + GLM_FUNC_DECL detail::tmat4x4 inverse( detail::tmat4x4 const & m); /// @} diff --git a/include/gal/opengl/glm/core/func_matrix.inl b/include/gal/opengl/glm/core/func_matrix.inl index 3b07b74b1d..d89d5d4b16 100644 --- a/include/gal/opengl/glm/core/func_matrix.inl +++ b/include/gal/opengl/glm/core/func_matrix.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) +/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) /// Permission is hereby granted, free of charge, to any person obtaining a copy /// of this software and associated documentation files (the "Software"), to deal /// in the Software without restriction, including without limitation the rights diff --git a/include/gal/opengl/glm/core/func_noise.hpp b/include/gal/opengl/glm/core/func_noise.hpp index 369f56de6f..3e5f874187 100644 --- a/include/gal/opengl/glm/core/func_noise.hpp +++ b/include/gal/opengl/glm/core/func_noise.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) +/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) /// Permission is hereby granted, free of charge, to any person obtaining a copy /// of this software and associated documentation files (the "Software"), to deal /// in the Software without restriction, including without limitation the rights @@ -50,7 +50,7 @@ namespace glm /// @see GLSL noise1 man page /// @see GLSL 4.20.8 specification, section 8.13 Noise Functions template - typename genType::value_type noise1(genType const & x); + GLM_FUNC_DECL typename genType::value_type noise1(genType const & x); /// Returns a 2D noise value based on the input value x. /// @@ -59,7 +59,7 @@ namespace glm /// @see GLSL noise2 man page /// @see GLSL 4.20.8 specification, section 8.13 Noise Functions template - detail::tvec2 noise2(genType const & x); + GLM_FUNC_DECL detail::tvec2 noise2(genType const & x); /// Returns a 3D noise value based on the input value x. /// @@ -68,7 +68,7 @@ namespace glm /// @see GLSL noise3 man page /// @see GLSL 4.20.8 specification, section 8.13 Noise Functions template - detail::tvec3 noise3(genType const & x); + GLM_FUNC_DECL detail::tvec3 noise3(genType const & x); /// Returns a 4D noise value based on the input value x. /// @@ -77,7 +77,7 @@ namespace glm /// @see GLSL noise4 man page /// @see GLSL 4.20.8 specification, section 8.13 Noise Functions template - detail::tvec4 noise4(genType const & x); + GLM_FUNC_DECL detail::tvec4 noise4(genType const & x); /// @} }//namespace glm diff --git a/include/gal/opengl/glm/core/func_noise.inl b/include/gal/opengl/glm/core/func_noise.inl index a53ba5a75b..68a19333f1 100644 --- a/include/gal/opengl/glm/core/func_noise.inl +++ b/include/gal/opengl/glm/core/func_noise.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) +/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) /// Permission is hereby granted, free of charge, to any person obtaining a copy /// of this software and associated documentation files (the "Software"), to deal /// in the Software without restriction, including without limitation the rights diff --git a/include/gal/opengl/glm/core/func_packing.hpp b/include/gal/opengl/glm/core/func_packing.hpp index e4f26dcbf5..b4312e12b4 100644 --- a/include/gal/opengl/glm/core/func_packing.hpp +++ b/include/gal/opengl/glm/core/func_packing.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) +/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) /// Permission is hereby granted, free of charge, to any person obtaining a copy /// of this software and associated documentation files (the "Software"), to deal /// in the Software without restriction, including without limitation the rights @@ -52,7 +52,7 @@ namespace glm //! /// @see GLSL packUnorm2x16 man page /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions - detail::uint32 packUnorm2x16(detail::tvec2 const & v); + GLM_FUNC_DECL detail::uint32 packUnorm2x16(detail::tvec2 const & v); //! First, converts each component of the normalized floating-point value v into 8- or 16-bit integer values. //! Then, the results are packed into the returned 32-bit unsigned integer. @@ -65,7 +65,7 @@ namespace glm //! /// @see GLSL packSnorm2x16 man page /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions - detail::uint32 packSnorm2x16(detail::tvec2 const & v); + GLM_FUNC_DECL detail::uint32 packSnorm2x16(detail::tvec2 const & v); //! First, converts each component of the normalized floating-point value v into 8- or 16-bit integer values. //! Then, the results are packed into the returned 32-bit unsigned integer. @@ -78,7 +78,7 @@ namespace glm //! /// @see GLSL packUnorm4x8 man page /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions - detail::uint32 packUnorm4x8(detail::tvec4 const & v); + GLM_FUNC_DECL detail::uint32 packUnorm4x8(detail::tvec4 const & v); //! First, converts each component of the normalized floating-point value v into 8- or 16-bit integer values. //! Then, the results are packed into the returned 32-bit unsigned integer. @@ -91,7 +91,7 @@ namespace glm //! /// @see GLSL packSnorm4x8 man page /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions - detail::uint32 packSnorm4x8(detail::tvec4 const & v); + GLM_FUNC_DECL detail::uint32 packSnorm4x8(detail::tvec4 const & v); //! First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers. //! Then, each component is converted to a normalized floating-point value to generate the returned two- or four-component vector. @@ -104,7 +104,7 @@ namespace glm //! /// @see GLSL unpackUnorm2x16 man page /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions - detail::tvec2 unpackUnorm2x16(detail::uint32 const & p); + GLM_FUNC_DECL detail::tvec2 unpackUnorm2x16(detail::uint32 const & p); //! First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers. //! Then, each component is converted to a normalized floating-point value to generate the returned two- or four-component vector. @@ -117,7 +117,7 @@ namespace glm //! /// @see GLSL unpackSnorm2x16 man page /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions - detail::tvec2 unpackSnorm2x16(detail::uint32 const & p); + GLM_FUNC_DECL detail::tvec2 unpackSnorm2x16(detail::uint32 const & p); /// First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers. /// Then, each component is converted to a normalized floating-point value to generate the returned two- or four-component vector. @@ -130,7 +130,7 @@ namespace glm /// /// @see GLSL unpackUnorm4x8 man page /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions - detail::tvec4 unpackUnorm4x8(detail::uint32 const & p); + GLM_FUNC_DECL detail::tvec4 unpackUnorm4x8(detail::uint32 const & p); /// First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers. /// Then, each component is converted to a normalized floating-point value to generate the returned two- or four-component vector. @@ -143,7 +143,7 @@ namespace glm /// /// @see GLSL unpackSnorm4x8 man page /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions - detail::tvec4 unpackSnorm4x8(detail::uint32 const & p); + GLM_FUNC_DECL detail::tvec4 unpackSnorm4x8(detail::uint32 const & p); /// Returns a double-precision value obtained by packing the components of v into a 64-bit value. /// If an IEEE 754 Inf or NaN is created, it will not signal, and the resulting floating point value is unspecified. @@ -153,7 +153,7 @@ namespace glm /// /// @see GLSL packDouble2x32 man page /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions - double packDouble2x32(detail::tvec2 const & v); + GLM_FUNC_DECL double packDouble2x32(detail::tvec2 const & v); /// Returns a two-component unsigned integer vector representation of v. /// The bit-level representation of v is preserved. @@ -162,7 +162,7 @@ namespace glm /// /// @see GLSL unpackDouble2x32 man page /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions - detail::tvec2 unpackDouble2x32(double const & v); + GLM_FUNC_DECL detail::tvec2 unpackDouble2x32(double const & v); /// Returns an unsigned integer obtained by converting the components of a two-component floating-point vector /// to the 16-bit floating-point representation found in the OpenGL Specification, @@ -172,7 +172,7 @@ namespace glm /// /// @see GLSL packHalf2x16 man page /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions - uint packHalf2x16(vec2 const & v); + GLM_FUNC_DECL uint packHalf2x16(vec2 const & v); /// Returns a two-component floating-point vector with components obtained by unpacking a 32-bit unsigned integer into a pair of 16-bit values, /// interpreting those values as 16-bit floating-point numbers according to the OpenGL Specification, @@ -182,7 +182,7 @@ namespace glm /// /// @see GLSL unpackHalf2x16 man page /// @see GLSL 4.20.8 specification, section 8.4 Floating-Point Pack and Unpack Functions - vec2 unpackHalf2x16(uint const & v); + GLM_FUNC_DECL vec2 unpackHalf2x16(uint const & v); /// @} }//namespace glm diff --git a/include/gal/opengl/glm/core/func_packing.inl b/include/gal/opengl/glm/core/func_packing.inl index 27197151bb..e10e161840 100644 --- a/include/gal/opengl/glm/core/func_packing.inl +++ b/include/gal/opengl/glm/core/func_packing.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) +/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) /// Permission is hereby granted, free of charge, to any person obtaining a copy /// of this software and associated documentation files (the "Software"), to deal /// in the Software without restriction, including without limitation the rights @@ -136,12 +136,42 @@ namespace glm GLM_FUNC_QUALIFIER double packDouble2x32(detail::tvec2 const & v) { - return *(double*)&v; + struct uint32_pair + { + detail::uint32 x; + detail::uint32 y; + }; + + union helper + { + uint32_pair input; + double output; + } Helper; + + Helper.input.x = v.x; + Helper.input.y = v.y; + + return Helper.output; + //return *(double*)&v; } GLM_FUNC_QUALIFIER detail::tvec2 unpackDouble2x32(double const & v) { - return *(detail::tvec2*)&v; + struct uint32_pair + { + detail::uint32 x; + detail::uint32 y; + }; + + union helper + { + double input; + uint32_pair output; + } Helper; + + Helper.input = v; + + return detail::tvec2(Helper.output.x, Helper.output.y); } GLM_FUNC_QUALIFIER uint packHalf2x16(detail::tvec2 const & v) @@ -157,7 +187,7 @@ namespace glm Pack.orig.a = detail::toFloat16(v.x); Pack.orig.b = detail::toFloat16(v.y); - return *(uint*)&Pack; + return Pack.other; } GLM_FUNC_QUALIFIER vec2 unpackHalf2x16(uint const & v) diff --git a/include/gal/opengl/glm/core/func_trigonometric.hpp b/include/gal/opengl/glm/core/func_trigonometric.hpp index ccb7f9ea6d..9954d9cea6 100644 --- a/include/gal/opengl/glm/core/func_trigonometric.hpp +++ b/include/gal/opengl/glm/core/func_trigonometric.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) +/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) /// Permission is hereby granted, free of charge, to any person obtaining a copy /// of this software and associated documentation files (the "Software"), to deal /// in the Software without restriction, including without limitation the rights @@ -52,7 +52,7 @@ namespace glm /// @see GLSL radians man page /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions template - genType radians(genType const & degrees); + GLM_FUNC_DECL genType radians(genType const & degrees); /// Converts radians to degrees and returns the result. /// @@ -61,7 +61,7 @@ namespace glm /// @see GLSL degrees man page /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions template - genType degrees(genType const & radians); + GLM_FUNC_DECL genType degrees(genType const & radians); /// The standard trigonometric sine function. /// The values returned by this function will range from [-1, 1]. @@ -71,7 +71,7 @@ namespace glm /// @see GLSL sin man page /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions template - genType sin(genType const & angle); + GLM_FUNC_DECL genType sin(genType const & angle); /// The standard trigonometric cosine function. /// The values returned by this function will range from [-1, 1]. @@ -81,7 +81,7 @@ namespace glm /// @see GLSL cos man page /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions template - genType cos(genType const & angle); + GLM_FUNC_DECL genType cos(genType const & angle); /// The standard trigonometric tangent function. /// @@ -90,7 +90,7 @@ namespace glm /// @see GLSL tan man page /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions template - genType tan(genType const & angle); + GLM_FUNC_DECL genType tan(genType const & angle); /// Arc sine. Returns an angle whose sine is x. /// The range of values returned by this function is [-PI/2, PI/2]. @@ -101,7 +101,7 @@ namespace glm /// @see GLSL asin man page /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions template - genType asin(genType const & x); + GLM_FUNC_DECL genType asin(genType const & x); /// Arc cosine. Returns an angle whose sine is x. /// The range of values returned by this function is [0, PI]. @@ -112,7 +112,7 @@ namespace glm /// @see GLSL acos man page /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions template - genType acos(genType const & x); + GLM_FUNC_DECL genType acos(genType const & x); /// Arc tangent. Returns an angle whose tangent is y/x. /// The signs of x and y are used to determine what @@ -125,7 +125,7 @@ namespace glm /// @see GLSL atan man page /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions template - genType atan(genType const & y, genType const & x); + GLM_FUNC_DECL genType atan(genType const & y, genType const & x); /// Arc tangent. Returns an angle whose tangent is y_over_x. /// The range of values returned by this function is [-PI/2, PI/2]. @@ -135,7 +135,7 @@ namespace glm /// @see GLSL atan man page /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions template - genType atan(genType const & y_over_x); + GLM_FUNC_DECL genType atan(genType const & y_over_x); /// Returns the hyperbolic sine function, (exp(x) - exp(-x)) / 2 /// @@ -144,7 +144,7 @@ namespace glm /// @see GLSL sinh man page /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions template - genType sinh(genType const & angle); + GLM_FUNC_DECL genType sinh(genType const & angle); /// Returns the hyperbolic cosine function, (exp(x) + exp(-x)) / 2 /// @@ -153,7 +153,7 @@ namespace glm /// @see GLSL cosh man page /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions template - genType cosh(genType const & angle); + GLM_FUNC_DECL genType cosh(genType const & angle); /// Returns the hyperbolic tangent function, sinh(angle) / cosh(angle) /// @@ -162,7 +162,7 @@ namespace glm /// @see GLSL tanh man page /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions template - genType tanh(genType const & angle); + GLM_FUNC_DECL genType tanh(genType const & angle); /// Arc hyperbolic sine; returns the inverse of sinh. /// @@ -171,7 +171,7 @@ namespace glm /// @see GLSL asinh man page /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions template - genType asinh(genType const & x); + GLM_FUNC_DECL genType asinh(genType const & x); /// Arc hyperbolic cosine; returns the non-negative inverse /// of cosh. Results are undefined if x < 1. @@ -181,7 +181,7 @@ namespace glm /// @see GLSL acosh man page /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions template - genType acosh(genType const & x); + GLM_FUNC_DECL genType acosh(genType const & x); /// Arc hyperbolic tangent; returns the inverse of tanh. /// Results are undefined if abs(x) >= 1. @@ -191,7 +191,7 @@ namespace glm /// @see GLSL atanh man page /// @see GLSL 4.20.8 specification, section 8.1 Angle and Trigonometry Functions template - genType atanh(genType const & x); + GLM_FUNC_DECL genType atanh(genType const & x); /// @} }//namespace glm diff --git a/include/gal/opengl/glm/core/func_trigonometric.inl b/include/gal/opengl/glm/core/func_trigonometric.inl index 240cdafca0..bd59cd73d4 100644 --- a/include/gal/opengl/glm/core/func_trigonometric.inl +++ b/include/gal/opengl/glm/core/func_trigonometric.inl @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) +/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) /// Permission is hereby granted, free of charge, to any person obtaining a copy /// of this software and associated documentation files (the "Software"), to deal /// in the Software without restriction, including without limitation the rights diff --git a/include/gal/opengl/glm/core/func_vector_relational.hpp b/include/gal/opengl/glm/core/func_vector_relational.hpp index 7b5a7cd080..4ffe14eab7 100644 --- a/include/gal/opengl/glm/core/func_vector_relational.hpp +++ b/include/gal/opengl/glm/core/func_vector_relational.hpp @@ -1,7 +1,7 @@ /////////////////////////////////////////////////////////////////////////////////// /// OpenGL Mathematics (glm.g-truc.net) /// -/// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) +/// Copyright (c) 2005 - 2013 G-Truc Creation (www.g-truc.net) /// Permission is hereby granted, free of charge, to any person obtaining a copy /// of this software and associated documentation files (the "Software"), to deal /// in the Software without restriction, including without limitation the rights @@ -55,7 +55,7 @@ namespace glm /// @see GLSL lessThan man page /// @see GLSL 4.20.8 specification, section 8.7 Vector Relational Functions template - typename vecType::bool_type lessThan(vecType const & x, vecType const & y); + GLM_FUNC_DECL typename vecType::bool_type lessThan(vecType const & x, vecType const & y); /// Returns the component-wise comparison of result x <= y. /// @@ -64,7 +64,7 @@ namespace glm /// @see GLSL lessThanEqual man page /// @see GLSL 4.20.8 specification, section 8.7 Vector Relational Functions template - typename vecType::bool_type lessThanEqual(vecType const & x, vecType const & y); + GLM_FUNC_DECL typename vecType::bool_type lessThanEqual(vecType const & x, vecType const & y); /// Returns the component-wise comparison of result x > y. /// @@ -73,7 +73,7 @@ namespace glm /// @see GLSL greaterThan man page /// @see GLSL 4.20.8 specification, section 8.7 Vector Relational Functions template - typename vecType::bool_type greaterThan(vecType const & x, vecType const & y); + GLM_FUNC_DECL typename vecType::bool_type greaterThan(vecType const & x, vecType const & y); /// Returns the component-wise comparison of result x >= y. /// @@ -82,7 +82,7 @@ namespace glm /// @see GLSL greaterThanEqual man page /// @see GLSL 4.20.8 specification, section 8.7 Vector Relational Functions template - typename vecType::bool_type greaterThanEqual(vecType const & x, vecType const & y); + GLM_FUNC_DECL typename vecType::bool_type greaterThanEqual(vecType const & x, vecType const & y); /// Returns the component-wise comparison of result x == y. /// @@ -91,7 +91,7 @@ namespace glm /// @see GLSL equal man page /// @see GLSL 4.20.8 specification, section 8.7 Vector Relational Functions template - typename vecType::bool_type equal(vecType const & x, vecType const & y); + GLM_FUNC_DECL typename vecType::bool_type equal(vecType const & x, vecType const & y); /// Returns the component-wise comparison of result x != y. /// @@ -100,7 +100,7 @@ namespace glm /// @see GLSL notEqual man page /// @see GLSL 4.20.8 specification, section 8.7 Vector Relational Functions template - typename vecType::bool_type notEqual(vecType const & x, vecType const & y); + GLM_FUNC_DECL typename vecType::bool_type notEqual(vecType const & x, vecType const & y); /// Returns true if any component of x is true. /// @@ -109,7 +109,7 @@ namespace glm /// @see GLSL any man page /// @see GLSL 4.20.8 specification, section 8.7 Vector Relational Functions template